From 577174cfb9d1a986eb798c08c8a7fa1a44460e3e Mon Sep 17 00:00:00 2001 From: amatilda Date: Mon, 23 Sep 2024 20:30:45 +0300 Subject: [PATCH] change report for 'SET duration' --- .../zunoG2/cores/ZWSupport/ZWCCBasic.c | 10 ++++----- .../zunoG2/cores/ZWSupport/ZWCCBasic.h | 2 +- .../cores/ZWSupport/ZWCCSoundSwitch.cpp | 21 +++++++++++-------- .../zunoG2/cores/ZWSupport/ZWCCSoundSwitch.h | 2 +- .../cores/ZWSupport/ZWCCSwitchBinary.cpp | 2 +- .../cores/ZWSupport/ZWCCSwitchMultilevel.cpp | 8 +++---- .../zunoG2/cores/ZWSupport/ZWCCTimer.cpp | 15 +++++++++---- .../zunoG2/cores/ZWSupport/ZWCCTimer.h | 3 ++- .../cores/ZWSupport/ZWCCWindowCovering.c | 12 +++++------ .../zunoG2/cores/ZWSupport/ZWSupport.c | 6 +++--- .../zunoG2/cores/ZWSupport/ZWSupport.h | 10 ++++++++- 11 files changed, 55 insertions(+), 36 deletions(-) diff --git a/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCBasic.c b/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCBasic.c index 7023a166..6143f322 100644 --- a/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCBasic.c +++ b/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCBasic.c @@ -160,8 +160,8 @@ void __zuno_BasicUniversalGetCurrentValueDurationTargetValue(uint8_t channel, ui #ifdef WITH_CC_BASIC size_t zuno_CCThermostatModeTobasic(size_t channel, size_t value); -int zuno_CCSoundSwitchBasicSet(size_t channel, size_t toneIdentifier); -static int _basic_set(byte channel, const ZwBasicSetFrame_t *paket) { +int zuno_CCSoundSwitchBasicSet(size_t channel, size_t toneIdentifier, const ZUNOCommandHandlerOption_t *options); +static int _basic_set(byte channel, const ZwBasicSetFrame_t *paket, const ZUNOCommandHandlerOption_t *options) { size_t value; size_t type; @@ -170,7 +170,7 @@ static int _basic_set(byte channel, const ZwBasicSetFrame_t *paket) { switch (type) { #if defined(WITH_CC_SOUND_SWITCH) case ZUNO_SOUND_SWITCH_CHANNEL_NUMBER: - return (zuno_CCSoundSwitchBasicSet(channel, value)); + return (zuno_CCSoundSwitchBasicSet(channel, value, options)); break ; #endif } @@ -228,7 +228,7 @@ static int _basic_get(byte channel, ZUNOCommandPacketReport_t *frame_report) { return (ZUNO_COMMAND_ANSWERED); } -int zuno_CCBasicHandler(byte channel, const ZUNOCommandCmd_t *cmd, ZUNOCommandPacketReport_t *frame_report) { +int zuno_CCBasicHandler(byte channel, const ZUNOCommandCmd_t *cmd, ZUNOCommandPacketReport_t *frame_report, const ZUNOCommandHandlerOption_t *options) { int rs; switch(ZW_CMD){ @@ -236,7 +236,7 @@ int zuno_CCBasicHandler(byte channel, const ZUNOCommandCmd_t *cmd, ZUNOCommandPa rs = _basic_get(channel, frame_report); break ; case BASIC_SET: - rs = _basic_set(channel, (const ZwBasicSetFrame_t *)cmd->cmd); + rs = _basic_set(channel, (const ZwBasicSetFrame_t *)cmd->cmd, options); break ; default: rs = ZUNO_COMMAND_BLOCKED_NO_SUPPORT; diff --git a/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCBasic.h b/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCBasic.h index ba96da63..02f89d3f 100644 --- a/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCBasic.h +++ b/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCBasic.h @@ -53,5 +53,5 @@ void __zuno_BasicUniversalTimerStop(uint8_t channel); void __zuno_BasicUniversalDimingStop(uint8_t channel); void __zuno_BasicUniversalGetCurrentValueDurationTargetValue(uint8_t channel, uint8_t *current_value, uint8_t *duration_table_8, uint8_t *target_value); -int zuno_CCBasicHandler(byte channel, const ZUNOCommandCmd_t *cmd, ZUNOCommandPacketReport_t *frame_report); +int zuno_CCBasicHandler(byte channel, const ZUNOCommandCmd_t *cmd, ZUNOCommandPacketReport_t *frame_report, const ZUNOCommandHandlerOption_t *options); #endif // BASIC_CC_H \ No newline at end of file diff --git a/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCSoundSwitch.cpp b/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCSoundSwitch.cpp index 63995567..6c228ad4 100644 --- a/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCSoundSwitch.cpp +++ b/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCSoundSwitch.cpp @@ -208,7 +208,7 @@ static int _soundSwitchConfigurationSet(const ZW_SOUND_SWITCH_CONFIGURATION_SET_ return (ZUNO_COMMAND_PROCESSED); } -static int _soundSwitchTonePlaySetAdd(size_t channel, size_t toneIdentifier, size_t playCommandToneVolume) { +static int _soundSwitchTonePlaySetAdd(size_t channel, size_t toneIdentifier, size_t playCommandToneVolume, const ZUNOCommandHandlerOption_t *options) { uint16_t sec_duration; uint64_t time_stamp; const ZunoSoundSwitchParameterArray_t *parameter_array; @@ -271,12 +271,12 @@ static int _soundSwitchTonePlaySetAdd(size_t channel, size_t toneIdentifier, siz parameter_diming->current_value = playCommandToneVolume; parameter_diming->target_value = toneIdentifier; parameter_diming->type = zunoTimerTreadDimingTypeSoundSwitch; - zunoTimerTreadDimingAdd(parameter_diming); + zunoTimerTreadDimingAdd(parameter_diming, options); _zunoSoundSwitchPlay(channel, toneIdentifier, playCommandToneVolume); return (result); } -static int _soundSwitchTonePlaySet(const ZwSoundSwitchTonePlayFrame_t *frame, size_t channel, size_t len) { +static int _soundSwitchTonePlaySet(const ZwSoundSwitchTonePlayFrame_t *frame, size_t channel, size_t len, const ZUNOCommandHandlerOption_t *options) { size_t toneIdentifier; size_t playCommandToneVolume; ZwSoundSwitchSave_t switch_save; @@ -295,10 +295,10 @@ static int _soundSwitchTonePlaySet(const ZwSoundSwitchTonePlayFrame_t *frame, si return (ZUNO_COMMAND_BLOCKED_FAILL); break ; } - return (_soundSwitchTonePlaySetAdd(channel, toneIdentifier, playCommandToneVolume)); + return (_soundSwitchTonePlaySetAdd(channel, toneIdentifier, playCommandToneVolume, options)); } -int zuno_CCSoundSwitchHandler(uint8_t channel, const ZUNOCommandCmd_t *cmd, ZUNOCommandPacketReport_t *frame_report) { +int zuno_CCSoundSwitchHandler(uint8_t channel, const ZUNOCommandCmd_t *cmd, ZUNOCommandPacketReport_t *frame_report, const ZUNOCommandHandlerOption_t *options) { int rs; switch (ZW_CMD) { @@ -307,7 +307,7 @@ int zuno_CCSoundSwitchHandler(uint8_t channel, const ZUNOCommandCmd_t *cmd, ZUNO rs = zuno_CCSoundSwitchReport(channel, &frame_report->info); break ; case SOUND_SWITCH_TONE_PLAY_SET_V2: - rs = _soundSwitchTonePlaySet((const ZwSoundSwitchTonePlayFrame_t *)&cmd->cmd[0x0], channel, cmd->len); + rs = _soundSwitchTonePlaySet((const ZwSoundSwitchTonePlayFrame_t *)&cmd->cmd[0x0], channel, cmd->len, options); if (rs == ZUNO_COMMAND_PROCESSED) _config_report_asyn(channel); break ; @@ -331,6 +331,8 @@ int zuno_CCSoundSwitchHandler(uint8_t channel, const ZUNOCommandCmd_t *cmd, ZUNO } void zuno_CCSoundSwitchPlay(uint8_t channel, uint8_t toneIdentifier, uint8_t playCommandToneVolume) { + ZUNOCommandHandlerOption_t options; + if (channel == 0x0) return ; channel--; @@ -338,7 +340,8 @@ void zuno_CCSoundSwitchPlay(uint8_t channel, uint8_t toneIdentifier, uint8_t pla return ; if (ZUNO_CFG_CHANNEL(channel).type != ZUNO_SOUND_SWITCH_CHANNEL_NUMBER) return ; - _soundSwitchTonePlaySetAdd(channel, toneIdentifier, playCommandToneVolume); + options = ZUNO_COMMAND_HANDLER_OPTIONS_DEFAULT(); + _soundSwitchTonePlaySetAdd(channel, toneIdentifier, playCommandToneVolume, &options); } void zuno_CCSoundSwitchStop(uint8_t channel) { @@ -381,11 +384,11 @@ bool zuno_CCSoundSwitchIsRun(uint8_t channel) { return (true); } -int zuno_CCSoundSwitchBasicSet(size_t channel, size_t toneIdentifier) { +int zuno_CCSoundSwitchBasicSet(size_t channel, size_t toneIdentifier, const ZUNOCommandHandlerOption_t *options) { ZwSoundSwitchSave_t switch_save; zunoSoundSwitchSaveGet(channel, &switch_save); - return (_soundSwitchTonePlaySetAdd(channel, toneIdentifier, switch_save.volume)); + return (_soundSwitchTonePlaySetAdd(channel, toneIdentifier, switch_save.volume, options)); } #include "ZWCCZWavePlusInfo.h" diff --git a/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCSoundSwitch.h b/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCSoundSwitch.h index 9865c26d..5ffada5f 100644 --- a/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCSoundSwitch.h +++ b/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCSoundSwitch.h @@ -173,7 +173,7 @@ typedef struct ZunoSoundSwitchParameterArray_s bool zuno_CCSoundSwitchIsRun(uint8_t channel); -int zuno_CCSoundSwitchHandler(uint8_t channel, const ZUNOCommandCmd_t *cmd, ZUNOCommandPacketReport_t *frame_report); +int zuno_CCSoundSwitchHandler(uint8_t channel, const ZUNOCommandCmd_t *cmd, ZUNOCommandPacketReport_t *frame_report, const ZUNOCommandHandlerOption_t *options); int zuno_CCSoundSwitchReport(uint8_t channel, ZUNOCommandPacket_t *packet); void zuno_CCSoundSwitchPlay(uint8_t channel, uint8_t toneIdentifier, uint8_t playCommandToneVolume); void zuno_CCSoundSwitchStop(uint8_t channel); diff --git a/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCSwitchBinary.cpp b/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCSwitchBinary.cpp index 0c583fc8..e750d0d5 100644 --- a/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCSwitchBinary.cpp +++ b/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCSwitchBinary.cpp @@ -67,7 +67,7 @@ static int _set(ZwSwitchBinarySetFrame_t *cmd, size_t len, size_t channel, ZUNOC parameter->ticks_end = (rtcc_micros() / 1000) + duration; parameter->target_value = targetValue; parameter->type = zunoTimerTreadDimingTypeSwitchBinary; - zunoTimerTreadDimingAdd(parameter); + zunoTimerTreadDimingAdd(parameter, options); return (ZUNO_COMMAND_PROCESSED); break ; default: diff --git a/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCSwitchMultilevel.cpp b/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCSwitchMultilevel.cpp index ff04bbf2..664e7995 100644 --- a/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCSwitchMultilevel.cpp +++ b/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCSwitchMultilevel.cpp @@ -37,7 +37,7 @@ static void _start_level_set(uint8_t channel, uint8_t current_level) { __zuno_BasicUniversalSetter1P(channel, current_level); } -static int _start_level(uint8_t channel, const ZUNOCommandCmd_t *cmd, ZUNOCommandPacketReport_t *frame_report) {// Prepare the structure for dimming +static int _start_level(uint8_t channel, const ZUNOCommandCmd_t *cmd, ZUNOCommandPacketReport_t *frame_report, const ZUNOCommandHandlerOption_t *options) {// Prepare the structure for dimming const ZwSwitchMultilevelStartLevelChangeFrame_t *pk; uint32_t step; uint8_t current_level; @@ -104,7 +104,7 @@ static int _start_level(uint8_t channel, const ZUNOCommandCmd_t *cmd, ZUNOComman zuno_CCSupervisionAsyncProcessedSet(cmd, ¶meter->super_vision); } parameter->flag = flag; - zunoTimerTreadDimingAdd(parameter); + zunoTimerTreadDimingAdd(parameter, options); return (ZUNO_COMMAND_PROCESSED); } @@ -169,7 +169,7 @@ static int _set(SwitchMultilevelSetFrame_t *cmd, uint8_t len, uint8_t channel, Z parameter->target_value = value; parameter->type = zunoTimerTreadDimingTypeSwitchMultilevel; parameter->channel = channel; - zunoTimerTreadDimingAdd(parameter); + zunoTimerTreadDimingAdd(parameter, options); return (ZUNO_COMMAND_PROCESSED); break ; default: @@ -222,7 +222,7 @@ int zuno_CCSwitchMultilevelHandler(byte channel, const ZUNOCommandCmd_t *cmd, ZU (pk->v1.properties1 & (1 << 6)) == 0, (uint8_t*) cmd); } - rs = _start_level(channel, cmd, frame_report); + rs = _start_level(channel, cmd, frame_report, options); break ; case SWITCH_MULTILEVEL_STOP_LEVEL_CHANGE: zcustom_SWLStartStopHandler(channel, diff --git a/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCTimer.cpp b/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCTimer.cpp index 47218bc1..342f590a 100644 --- a/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCTimer.cpp +++ b/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCTimer.cpp @@ -45,8 +45,9 @@ zunoTimerTreadDiming_t *zunoTimerTreadDimingCreate(void) { return (list); } -void zunoTimerTreadDimingAdd(zunoTimerTreadDiming_t *list) { +void zunoTimerTreadDimingAdd(zunoTimerTreadDiming_t *list, const ZUNOCommandHandlerOption_t *options) { zunoEnterCritical(); + list->options = options[0x0]; list->next = _diming; _diming = list; g_sleep_data.latch++; @@ -141,7 +142,6 @@ static bool _zunoTimerTreadDimingLoop_set(zunoTimerTreadDiming_t *list, uint8_t __zuno_BasicUniversalSetter1P(list->channel, new_value); break ; } - zunoSendReport(list->channel + 0x1); return (true); } @@ -170,8 +170,15 @@ static bool _zunoTimerTreadDimingLoop(zunoTimerTreadDiming_t *list) { return (false); } +void zunoTimerTreadDimingLoopReportSet(ZUNOCommandPacketReport_t *frame_report, const zunoTimerTreadDiming_t *list) { + if ((list->flag & ZUNO_TIMER_TREA_DIMING_FLAG_SUPERVISION) != 0x0) + zuno_CCSupervisionReportAsyncProcessed(frame_report, &list->super_vision); + zunoSendReportSet(list->channel, &list->options); +} + void zunoTimerTreadDimingLoop(ZUNOCommandPacketReport_t *frame_report) { zunoTimerTreadDiming_t *list; + zunoTimerTreadDiming_t list_tmp; zunoTimerTreadDiming_t *list_array[0x10]; zunoTimerTreadDiming_t *prev; size_t i; @@ -204,11 +211,11 @@ void zunoTimerTreadDimingLoop(ZUNOCommandPacketReport_t *frame_report) { while (i < i_max) { list = list_array[i]; i++; - if ((list->flag & ZUNO_TIMER_TREA_DIMING_FLAG_SUPERVISION) != 0x0) - zuno_CCSupervisionReportAsyncProcessed(frame_report, &list->super_vision); zunoEnterCritical(); + list_tmp = list[0x0]; _free_list(list); zunoExitCritical(); + zunoTimerTreadDimingLoopReportSet(frame_report, &list_tmp); } } #endif diff --git a/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCTimer.h b/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCTimer.h index e31762c4..63dadf12 100644 --- a/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCTimer.h +++ b/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCTimer.h @@ -23,6 +23,7 @@ typedef struct zunoTimerTreadDiming_s uint64_t ticks_end; ZwCSuperVisionReportAsyncProcessed_t super_vision; zunoTimerTreadDimingType_t type; + ZUNOCommandHandlerOption_t options; uint8_t flag; uint8_t channel; uint8_t target_value; @@ -40,7 +41,7 @@ bool zunoTimerTreadDimingGetValues(zunoTimerTreadDimingType_t type, uint8_t chan bool zunoTimerTreadDimingGetValues(zunoTimerTreadDimingType_t type, uint8_t channel, uint8_t current_value, uint8_t *duration_table_8, uint8_t *target_value, const void *data, uint8_t length); void zunoTimerTreadDimingStop(zunoTimerTreadDimingType_t type, uint8_t channel); void zunoTimerTreadDimingStop(zunoTimerTreadDimingType_t type, uint8_t channel, const void *data, uint8_t length); -void zunoTimerTreadDimingAdd(zunoTimerTreadDiming_t *list); +void zunoTimerTreadDimingAdd(zunoTimerTreadDiming_t *list, const ZUNOCommandHandlerOption_t *options); zunoTimerTreadDiming_t *zunoTimerTreadDimingCreate(void); #define ZUNO_TIMER_SWITCH_MAX_VALUE 0x63//Maximum value when dimming diff --git a/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCWindowCovering.c b/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCWindowCovering.c index a7e28c3b..15ea9cdc 100644 --- a/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCWindowCovering.c +++ b/hardware/arduino/zunoG2/cores/ZWSupport/ZWCCWindowCovering.c @@ -147,7 +147,7 @@ static int _set(uint8_t channel, const ZW_WINDOW_COVERING_SET_1BYTE_FRAME *paket parameter->target_value = targetValue; parameter->step = step; parameter->ticks_end = (rtcc_micros() / 1000) + duration; - zunoTimerTreadDimingAdd(parameter); + zunoTimerTreadDimingAdd(parameter, options); } i++; } @@ -176,7 +176,7 @@ static int _get(uint8_t channel, const ZW_WINDOW_COVERING_GET_FRAME *paket, ZUNO return (ZUNO_COMMAND_ANSWERED); } -static int _start_level_sdfdsfgsd(uint8_t channel, uint8_t parameterId, uint8_t duration, uint8_t targetValue, uint8_t flag) { +static int _start_level_sdfdsfgsd(uint8_t channel, uint8_t parameterId, uint8_t duration, uint8_t targetValue, uint8_t flag, const ZUNOCommandHandlerOption_t *options) { uint8_t currentValue; size_t step; zunoTimerTreadDiming_t *parameter; @@ -202,11 +202,11 @@ static int _start_level_sdfdsfgsd(uint8_t channel, uint8_t parameterId, uint8_t else step = step * (currentValue - targetValue); parameter->ticks_end = (rtcc_micros() / 1000) + step; - zunoTimerTreadDimingAdd(parameter); + zunoTimerTreadDimingAdd(parameter, options); return (ZUNO_COMMAND_PROCESSED); } -static int _start_level_change(uint8_t channel, const ZW_WINDOW_COVERING_START_LEVEL_CHANGE_FRAME *paket) { +static int _start_level_change(uint8_t channel, const ZW_WINDOW_COVERING_START_LEVEL_CHANGE_FRAME *paket, const ZUNOCommandHandlerOption_t *options) { uint32_t mask; uint8_t parameterId; uint8_t targetValue; @@ -224,7 +224,7 @@ static int _start_level_change(uint8_t channel, const ZW_WINDOW_COVERING_START_L targetValue = 0x0; flag = ZUNO_TIMER_TREA_DIMING_FLAG_MODE_DOWN; } - return (_start_level_sdfdsfgsd(channel, parameterId, paket->duration, targetValue, flag)); + return (_start_level_sdfdsfgsd(channel, parameterId, paket->duration, targetValue, flag, options)); } static int _stop_level_change(uint8_t channel, const ZW_WINDOW_COVERING_STOP_LEVEL_CHANGE_FRAME *paket) { @@ -249,7 +249,7 @@ int zuno_CCWindowCoveringHandler(uint8_t channel, const ZUNOCommandCmd_t *cmd, Z rs = _get(channel, (const ZW_WINDOW_COVERING_GET_FRAME *)cmd->cmd, frame_report); break ; case WINDOW_COVERING_START_LEVEL_CHANGE: - rs = _start_level_change(channel, (const ZW_WINDOW_COVERING_START_LEVEL_CHANGE_FRAME *)cmd->cmd); + rs = _start_level_change(channel, (const ZW_WINDOW_COVERING_START_LEVEL_CHANGE_FRAME *)cmd->cmd, options); break ; case WINDOW_COVERING_STOP_LEVEL_CHANGE: rs = _stop_level_change(channel, (const ZW_WINDOW_COVERING_STOP_LEVEL_CHANGE_FRAME *)cmd->cmd); diff --git a/hardware/arduino/zunoG2/cores/ZWSupport/ZWSupport.c b/hardware/arduino/zunoG2/cores/ZWSupport/ZWSupport.c index 398d6ac2..c757455c 100644 --- a/hardware/arduino/zunoG2/cores/ZWSupport/ZWSupport.c +++ b/hardware/arduino/zunoG2/cores/ZWSupport/ZWSupport.c @@ -1047,11 +1047,11 @@ int zuno_CommandHandler(ZUNOCommandCmd_t *cmd) { LOGGING_UART.print("CHANNEL WAS FOUND:"); LOGGING_UART.println(zuno_ch); #endif - options = ZUNO_COMMAND_HANDLER_DEFAULT(cmd->src_node, multi, supervision, ZW_CMD_CLASS); + options = ZUNO_COMMAND_HANDLER_OPTIONS(cmd->src_node, multi, supervision, ZW_CMD_CLASS); switch(ZW_CMD_CLASS) { #ifdef WITH_CC_BASIC case COMMAND_CLASS_BASIC: - result = zuno_CCBasicHandler(zuno_ch, cmd, &frame_report); + result = zuno_CCBasicHandler(zuno_ch, cmd, &frame_report, &options); break; #endif #ifdef WITH_CC_SWITCH_BINARY @@ -1101,7 +1101,7 @@ int zuno_CommandHandler(ZUNOCommandCmd_t *cmd) { #endif #ifdef WITH_CC_SOUND_SWITCH case COMMAND_CLASS_SOUND_SWITCH: - result = zuno_CCSoundSwitchHandler(zuno_ch, cmd, &frame_report); + result = zuno_CCSoundSwitchHandler(zuno_ch, cmd, &frame_report, &options); break; #endif #ifdef WITH_CC_THERMOSTAT_MODE diff --git a/hardware/arduino/zunoG2/cores/ZWSupport/ZWSupport.h b/hardware/arduino/zunoG2/cores/ZWSupport/ZWSupport.h index c71f30bd..34a67ab0 100644 --- a/hardware/arduino/zunoG2/cores/ZWSupport/ZWSupport.h +++ b/hardware/arduino/zunoG2/cores/ZWSupport/ZWSupport.h @@ -118,7 +118,7 @@ typedef struct ZUNOCommandHandlerOption_s uint8_t cmd_class; } ZUNOCommandHandlerOption_t; -#define ZUNO_COMMAND_HANDLER_DEFAULT(_src_node, _multi, _supervision, _cmd_class) \ +#define ZUNO_COMMAND_HANDLER_OPTIONS(_src_node, _multi, _supervision, _cmd_class) \ { \ .src_node = _src_node, \ .multi = _multi, \ @@ -126,6 +126,14 @@ typedef struct ZUNOCommandHandlerOption_s .cmd_class = _cmd_class, \ } \ +#define ZUNO_COMMAND_HANDLER_OPTIONS_DEFAULT() \ +{ \ + .src_node = 0x0, \ + .multi = false, \ + .supervision = false, \ + .cmd_class = COMMAND_CLASS_UNKNOWN, \ +} \ + typedef struct ZUNOCommandReport_t { node_id_t src_node;