Skip to content

Commit a760355

Browse files
committed
1 parent 54f7e28 commit a760355

27 files changed

Lines changed: 19464 additions & 17642 deletions

Z-Wave/include/ZW_SerialAPI.h

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,22 @@ typedef enum
323323
#define FUNC_ID_SERIAL_API_POWER_MANAGEMENT 0xEE
324324
#define FUNC_ID_SERIAL_API_READY 0xEF
325325

326-
/* Allocated for proprietary serial API commands */
327-
#define FUNC_ID_PROPRIETARY_0 0xF0
326+
/* Host hibernation extension: Serial API command 0xF0 + sub-command byte */
327+
#define FUNC_ID_SERIAL_API_HOST_HIBERNATION 0xF0
328+
#define HOST_HIBERNATION_SUBCMD_IMPORTANT_DEVICES_LIST 0x00
329+
#define HOST_HIBERNATION_SUBCMD_IMPORTANT_DEVICES_CLEAR 0x01
330+
#define HOST_HIBERNATION_SUBCMD_NOTIFY_HOST_STATE 0x02
331+
#define HOST_HIBERNATION_SUBCMD_MODULE_CAPABILITIES 0x03
332+
#define HOST_HIBERNATION_SUBCMD_REQUEST_WAKEUP_REPORT 0x04
333+
#define HOST_HIBERNATION_SUBCMD_DEVICE_LOST_REPORT 0x05
334+
#define HOST_HIBERNATION_SUBCMD_REQUEST_S2_MSG_COUNT_LIST 0x06
335+
/* Notify host state payload */
336+
#define HOST_HIBERNATION_STATE_AWAKE 0x00
337+
#define HOST_HIBERNATION_STATE_GOING_TO_SLEEP 0x01
338+
339+
/* Allocated for proprietary serial API commands.
340+
* 0xF0 is used by FUNC_ID_SERIAL_API_HOST_HIBERNATION (Host Hibernation). */
341+
/* #define FUNC_ID_PROPRIETARY_0 0xF0 -- see FUNC_ID_SERIAL_API_HOST_HIBERNATION */
328342
#define FUNC_ID_PROPRIETARY_1 0xF1
329343
#define FUNC_ID_PROPRIETARY_2 0xF2
330344
#define FUNC_ID_PROPRIETARY_3 0xF3

Z-Wave/include/ZW_classcmd.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2473,6 +2473,7 @@
24732473
#define COMMAND_CLASS_FIRMWARE_UPDATE_MD_V3 0x7A
24742474
#define COMMAND_CLASS_FIRMWARE_UPDATE_MD_V4 0x7A
24752475
#define COMMAND_CLASS_GEOGRAPHIC_LOCATION 0x8C
2476+
#define COMMAND_CLASS_WAKE_ON_CRITICAL_MESSAGE 0x8D
24762477
#define COMMAND_CLASS_GROUPING_NAME 0x7B /*DEPRECATED*/
24772478
#define COMMAND_CLASS_HAIL 0x82 /*DEPRECATED*/
24782479
#define COMMAND_CLASS_HRV_CONTROL 0x39
@@ -3795,6 +3796,13 @@
37953796
#define GEOGRAPHIC_LOCATION_SET_LEVEL2_LATITUDE_MINUTES_MASK 0x7F
37963797
#define GEOGRAPHIC_LOCATION_SET_LEVEL2_LAT_SIGN_BIT_MASK 0x80
37973798

3799+
/* Wake On Critical Message command class commands */
3800+
#define WAKE_ON_CRITICAL_MESSAGE_VERSION 0x01
3801+
#define WAKE_ON_CRITICAL_MESSAGE_CONFIGURATION_SET 0x01
3802+
#define WAKE_ON_CRITICAL_MESSAGE_CONFIGURATION_GET 0x02
3803+
#define WAKE_ON_CRITICAL_MESSAGE_CONFIGURATION_REPORT 0x03
3804+
#define WAKE_ON_CRITICAL_MESSAGE_NOTIFY 0x04
3805+
37983806
/* Grouping Name command class commands */
37993807
#define GROUPING_NAME_VERSION 0x01
38003808
#define GROUPING_NAME_GET 0x02

helper.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ ${build_dir}/CMakeCache.txt ${build_dir}/Makefile: CMakeLists.txt
7171
mkdir -p ${@D}
7272
${cmake} --version
7373
${cmake} --help
74-
git describe --tags --always --dirty
74+
-git describe --tags --always --dirty
7575
cd ${@D} && ${cmake} ${cmake_options} ${CURDIR}
7676
ls ${CURDIR}/$@
7777

libzwaveip/libedit/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ add_library(edit
22
chared.c common.c eln.c filecomplete.c history.c keymacro.c parse.c read.c refresh.c sig.c tokenizer.c tty.c
33
chartype.c el.c emacs.c hist.c historyn.c map.c prompt.c readline.c search.c terminal.c tokenizern.c vi.c
44
)
5+
target_compile_options(edit PRIVATE -Wno-error=cpp)

src/CC_Gateway.c

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* © 2014 Silicon Laboratories Inc.
22
*/
33
#include "CC_Gateway.h"
4+
#include "CC_GatewayKeepAlive.h"
45
#include "DataStore.h"
56
#include "ZW_classcmd.h"
67
#include "ZW_classcmd_ex.h"
@@ -11,8 +12,13 @@
1112
#include "ZW_udp_server.h"
1213
#include "Serialapi.h"
1314
#include "ZW_ZIPApplication.h"
15+
#include "ClassicZIPNode.h"
1416
#include "command_handler.h"
17+
#include "ZIP_Router_logging.h"
18+
#include "zw_network_info.h"
19+
#include "zip_router_ipv6_utils.h"
1520
#include <stdlib.h>
21+
#include <string.h>
1622

1723
static u8_t tunnelTimer = 0xFF;
1824

@@ -379,6 +385,53 @@ static command_handler_codes_t Gateway_CommandHandler(zwave_connection_t *c, uin
379385

380386
break;
381387

388+
case GATEWAY_IMPORTANT_NODE_LIST_SET:
389+
{
390+
uint8_t report[3];
391+
int rc;
392+
393+
if (bDatalen < 4)
394+
{
395+
printf("GATEWAY_IMPORTANT_NODE_LIST_SET: payload too short (%u)\r\n", bDatalen);
396+
report[0] = COMMAND_CLASS_ZIP_GATEWAY;
397+
report[1] = GATEWAY_IMPORTANT_NODE_LIST_REPORT;
398+
report[2] = 0xFF;
399+
ZW_SendDataZIP(c, report, sizeof(report), NULL);
400+
break;
401+
}
402+
403+
rc = gw_keepalive_handle_important_node_set(pData + 2, bDatalen - 2);
404+
report[0] = COMMAND_CLASS_ZIP_GATEWAY;
405+
report[1] = GATEWAY_IMPORTANT_NODE_LIST_REPORT;
406+
report[2] = (rc == 0) ? 0x00 : 0xFF;
407+
ZW_SendDataZIP(c, report, sizeof(report), NULL);
408+
}
409+
break;
410+
411+
case GATEWAY_APP_STATE_SET:
412+
{
413+
uint8_t report[3];
414+
int rc;
415+
416+
if (bDatalen < 3)
417+
{
418+
printf("GATEWAY_APP_STATE_SET: payload too short (%u)\r\n", bDatalen);
419+
report[0] = COMMAND_CLASS_ZIP_GATEWAY;
420+
report[1] = GATEWAY_APP_STATE_REPORT;
421+
report[2] = 0xFF;
422+
ZW_SendDataZIP(c, report, sizeof(report), NULL);
423+
break;
424+
}
425+
426+
rc = gw_keepalive_handle_app_state_set(pData[2],
427+
(bDatalen >= 4) ? pData[3] : 0x00);
428+
report[0] = COMMAND_CLASS_ZIP_GATEWAY;
429+
report[1] = GATEWAY_APP_STATE_REPORT;
430+
report[2] = (rc == 0) ? 0x00 : 0xFF;
431+
ZW_SendDataZIP(c, report, sizeof(report), NULL);
432+
}
433+
break;
434+
382435
default:
383436
printf("Gateway_CommandHandler: Unsupported command received.\r\n");
384437
return COMMAND_NOT_SUPPORTED;

0 commit comments

Comments
 (0)