From 6bc15fef7b151f9d1ccbda9ca5533d73ec92e1dc Mon Sep 17 00:00:00 2001 From: BlueAndi Date: Wed, 3 Jun 2020 23:10:04 +0200 Subject: [PATCH] Updated to VSCP framework v1.1.0 --- CHANGELOG.md | 4 + README.md | 51 +- library.json | 2 +- library.properties | 2 +- src/VSCP.cpp | 2 +- src/framework/core/vscp_core.c | 16 +- src/framework/core/vscp_core.h | 11 +- src/framework/core/vscp_dm.c | 12 +- src/framework/core/vscp_type_information.h | 10 + src/framework/core/vscp_types.h | 6 + src/framework/events/vscp_evt_control.c | 1282 ++++++++++++++++- src/framework/events/vscp_evt_control.h | 455 +++++- src/framework/events/vscp_evt_display.c | 17 +- src/framework/events/vscp_evt_display.h | 5 +- src/framework/events/vscp_evt_gnss.c | 16 +- src/framework/events/vscp_evt_gnss.h | 2 +- src/framework/events/vscp_evt_information.c | 79 +- src/framework/events/vscp_evt_information.h | 26 +- src/framework/events/vscp_evt_ir.c | 2 +- src/framework/events/vscp_evt_measurement32.c | 464 +++--- src/framework/events/vscp_evt_protocol.c | 20 +- src/framework/events/vscp_evt_wireless.c | 2 +- 22 files changed, 2099 insertions(+), 387 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92b2c2e..ecdc8d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.1.0 + +- Update to VSCP framework v1.1.0, please see the ![changelog](https://github.com/BlueAndi/vscp-framework/releases/tag/v1.1.0) there. + ## 1.0.0 - Update to VSCP framework v1.0.0, please see the ![changelog](https://github.com/BlueAndi/vscp-framework/releases/tag/v1.0.0) there. diff --git a/README.md b/README.md index 36a70be..83e2a16 100644 --- a/README.md +++ b/README.md @@ -147,36 +147,35 @@ Please take a look to the provided examples because they guide you through all n You will find the class defines here: ``` -src/framework/vscp_class_l1.h -src/framework/vscp_class_l1_l2.h +src/framework/core/vscp_class_l1.h +src/framework/core/vscp_class_l1_l2.h ``` You will find the type defines here: ``` -src/framework/vscp_type_alarm.h -src/framework/vscp_type_aol.h -src/framework/vscp_type_control.h -src/framework/vscp_type_data.h -src/framework/vscp_type_diagnostic.h -src/framework/vscp_type_display.h -src/framework/vscp_type_error.h -src/framework/vscp_type_gnss.h -src/framework/vscp_type_information.h -src/framework/vscp_type_ir.h -src/framework/vscp_type_log.h -src/framework/vscp_type_measurement.h -src/framework/vscp_type_measurement32.h -src/framework/vscp_type_measurement64.h -src/framework/vscp_type_measurezone.h -src/framework/vscp_type_multimedia.h -src/framework/vscp_type_phone.h -src/framework/vscp_type_protocol.h -src/framework/vscp_type_remote.h -src/framework/vscp_type_security.h -src/framework/vscp_type_setvaluezone.h -src/framework/vscp_type_weather.h -src/framework/vscp_type_weather_forecast.h -src/framework/vscp_type_wireless.h +src/framework/events/vscp_evt_alarm.h +src/framework/events/vscp_evt_aol.h +src/framework/events/vscp_evt_control.h +src/framework/events/vscp_evt_data.h +src/framework/events/vscp_evt_diagnostic.h +src/framework/events/vscp_evt_display.h +src/framework/events/vscp_evt_error.h +src/framework/events/vscp_evt_gnss.h +src/framework/events/vscp_evt_information.h +src/framework/events/vscp_evt_ir.h +src/framework/events/vscp_evt_log.h +src/framework/events/vscp_evt_measurement.h +src/framework/events/vscp_evt_measurement32.h +src/framework/events/vscp_evt_measurement64.h +src/framework/events/vscp_evt_measurezone.h +src/framework/events/vscp_evt_multimedia.h +src/framework/events/vscp_evt_phone.h +src/framework/events/vscp_evt_protocol.h +src/framework/events/vscp_evt_security.h +src/framework/events/vscp_evt_setvaluezone.h +src/framework/events/vscp_evt_weather.h +src/framework/events/vscp_evt_weather_forecast.h +src/framework/events/vscp_evt_wireless.h ``` ### Does the library only support the CAN-bus as transport protocotol? diff --git a/library.json b/library.json index 3d328f3..40936bb 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "vscp-arduino", - "version": "1.0.0", + "version": "1.1.0", "keywords": "vscp, arduino-library, vscp-arduino, automation, home automation", "description": "Very Simple Control Procotol (VSCP) Level 1 Library for the arduino IDE.", "repository": { diff --git a/library.properties b/library.properties index 9e8796b..cfab459 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=VSCP -version=1.0.0 +version=1.1.0 author=Andreas Merkle maintainer=Andreas Merkle sentence=Very Simple Control Protocol L1 framework for all Arduino boards. diff --git a/src/VSCP.cpp b/src/VSCP.cpp index c231af1..d6afecd 100644 --- a/src/VSCP.cpp +++ b/src/VSCP.cpp @@ -164,7 +164,7 @@ void VSCP::process(void) if (true == mIsInitialized) { /* Process the whole framework */ - vscp_core_process(); + (void)vscp_core_process(); /* Process all member timers */ mStatusLampTimer.process(); diff --git a/src/framework/core/vscp_core.c b/src/framework/core/vscp_core.c index e4b40e7..5138ea0 100644 --- a/src/framework/core/vscp_core.c +++ b/src/framework/core/vscp_core.c @@ -456,14 +456,24 @@ extern void vscp_core_restoreFactoryDefaultSettings(void) /** * This function process the whole VSCP core stack. Call it in a user defined * cyclic period. + * + * Note, for a fast handling of received events, this function returns TRUE in + * case a event was handled, otherwise FALSE. Call it e.g. in a loop until no + * event is handled anymore. If its not necessary in your application, just + * skip the return value. + * + * @return If a received event was handled, it will return TRUE otherwise FALSE. */ -extern void vscp_core_process(void) +extern BOOL vscp_core_process(void) { + BOOL isEventHandled = FALSE; + /* Get any received message. * Note, only in the active state all received messages are processed. * In the other ones it depends on their sub state. */ vscp_core_rxMessageValid = vscp_transport_readMessage(&vscp_core_rxMessage); + isEventHandled = vscp_core_rxMessageValid; #if VSCP_CONFIG_BASE_IS_ENABLED( VSCP_CONFIG_ENABLE_LOGGER ) @@ -531,7 +541,7 @@ extern void vscp_core_process(void) /* Invalidate received message */ vscp_core_rxMessageValid = FALSE; - return; + return isEventHandled; } /** @@ -1153,7 +1163,7 @@ static inline void vscp_core_stateActive(void) #if VSCP_CONFIG_BASE_IS_ENABLED( VSCP_CONFIG_ENABLE_CUSTOM_HEARTBEAT ) (void)vscp_portable_sendNodeHeartbeatEvent(); #else - (void)vscp_evt_information_sendNodeHeartbeat(0, vscp_dev_data_getNodeZone(), vscp_dev_data_getNodeSubZone()); + (void)vscp_evt_information_sendNodeHeartbeat(0, vscp_dev_data_getNodeZone(), vscp_dev_data_getNodeSubZone(), NULL, 0); #endif /* Restart timer */ diff --git a/src/framework/core/vscp_core.h b/src/framework/core/vscp_core.h index c83d489..66fb76c 100644 --- a/src/framework/core/vscp_core.h +++ b/src/framework/core/vscp_core.h @@ -102,7 +102,7 @@ extern "C" #define VSCP_CORE_VERSION_STR "v1.11.00" /** VSCP framework version string */ -#define VSCP_CORE_FRAMEWORK_VERSION "v1.0.0" +#define VSCP_CORE_FRAMEWORK_VERSION "v1.1.0" /******************************************************************************* MACROS @@ -147,8 +147,15 @@ extern void vscp_core_restoreFactoryDefaultSettings(void); /** * This function process the whole VSCP core stack. Call it in a user defined * cyclic period. + * + * Note, for a fast handling of received events, this function returns TRUE in + * case a event was handled, otherwise FALSE. Call it e.g. in a loop until no + * event is handled anymore. If its not necessary in your application, just + * skip the return value. + * + * @return If a received event was handled, it will return TRUE otherwise FALSE. */ -extern void vscp_core_process(void); +extern BOOL vscp_core_process(void); /** * This function reads the nickname id of the node. diff --git a/src/framework/core/vscp_dm.c b/src/framework/core/vscp_dm.c index 1a82250..67d9e3a 100644 --- a/src/framework/core/vscp_dm.c +++ b/src/framework/core/vscp_dm.c @@ -405,11 +405,12 @@ extern void vscp_dm_executeActions(vscp_RxMessage const * const msg) (VSCP_L1_DATA_SIZE > zoneIndex)) { uint8_t subZoneIndex = zoneIndex + 1; + uint8_t zone = msg->data[zoneIndex]; + uint8_t subZone = msg->data[subZoneIndex]; - /* Zone match? */ - if (0 != (row.flags & VSCP_DM_FLAG_MATCH_ZONE)) + /* Zone match and event shall not apply to all zones? */ + if ((0 != (row.flags & VSCP_DM_FLAG_MATCH_ZONE)) && (VSCP_ZONE_BROADCAST != zone)) { - uint8_t zone = msg->data[zoneIndex]; uint8_t dmZone = vscp_dev_data_getNodeZone(); #if VSCP_CONFIG_BASE_IS_ENABLED( VSCP_CONFIG_ENABLE_DM_EXTENSION ) @@ -431,10 +432,9 @@ extern void vscp_dm_executeActions(vscp_RxMessage const * const msg) } } - /* Sub zone match? */ - if (0 != (row.flags & VSCP_DM_FLAG_MATCH_SUB_ZONE)) + /* Sub zone match and event shall not apply to all sub-zones? */ + if ((0 != (row.flags & VSCP_DM_FLAG_MATCH_SUB_ZONE)) && (VSCP_SUBZONE_BROADCAST != subZone)) { - uint8_t subZone = msg->data[subZoneIndex]; uint8_t dmSubZone = vscp_dev_data_getNodeSubZone(); #if VSCP_CONFIG_BASE_IS_ENABLED( VSCP_CONFIG_ENABLE_DM_EXTENSION ) diff --git a/src/framework/core/vscp_type_information.h b/src/framework/core/vscp_type_information.h index 42e036a..5e19f3e 100644 --- a/src/framework/core/vscp_type_information.h +++ b/src/framework/core/vscp_type_information.h @@ -590,6 +590,16 @@ extern "C" */ #define VSCP_TYPE_INFORMATION_RECONNECT 83 +/** + * Enter, something has been entered. + */ +#define VSCP_TYPE_INFORMATION_ENTER 84 + +/** + * Exit, something has been exited. + */ +#define VSCP_TYPE_INFORMATION_EXIT 85 + /******************************************************************************* MACROS *******************************************************************************/ diff --git a/src/framework/core/vscp_types.h b/src/framework/core/vscp_types.h index 6d28011..9e0268e 100644 --- a/src/framework/core/vscp_types.h +++ b/src/framework/core/vscp_types.h @@ -95,6 +95,12 @@ extern "C" /** GUID size */ #define VSCP_GUID_SIZE (16) +/** Zone value which means that this event shall apply for all zones. */ +#define VSCP_ZONE_BROADCAST (0xFF) + +/** Sub-zone value which means that this event shall apply for all sub-zones. */ +#define VSCP_SUBZONE_BROADCAST (0xFF) + /** Application register start address (page 0) */ #define VSCP_REGISTER_APP_START_ADDR (0x00) diff --git a/src/framework/events/vscp_evt_control.c b/src/framework/events/vscp_evt_control.c index e968b6d..54a6759 100644 --- a/src/framework/events/vscp_evt_control.c +++ b/src/framework/events/vscp_evt_control.c @@ -87,91 +87,1287 @@ extern BOOL vscp_evt_control_sendGeneralEvent(void) return vscp_core_sendEvent(&txMsg); } -/* "Mute on/off" not supported. No frame defined. */ +/** + * Mute on/off + * + * @param[in] command If equal to zero no mute else mute. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendMuteOnOff(uint8_t command, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_MUTE, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = command; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * (All) Lamp(s) on/off + * + * @param[in] state If equal to zero off else on. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendAllLampSOnOff(uint8_t state, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_ALL_LAMPS, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = state; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Open + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendOpen(uint8_t userSpecific, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_OPEN, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = userSpecific; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Close + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendClose(uint8_t userSpecific, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_CLOSE, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = userSpecific; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * TurnOn + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendTurnon(uint8_t userSpecific, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_TURNON, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = userSpecific; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * TurnOff + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendTurnoff(uint8_t userSpecific, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_TURNOFF, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = userSpecific; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Start + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendStart(uint8_t userSpecific, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_START, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = userSpecific; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Stop + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendStop(uint8_t userSpecific, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_STOP, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = userSpecific; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Reset + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendReset(uint8_t userSpecific, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_RESET, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = userSpecific; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Interrupt + * + * @param[in] interruptLevel Interrupt level. (0 – 255 , zero is lowest interrupt level. ). + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendInterrupt(uint8_t interruptLevel, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_INTERRUPT, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = interruptLevel; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Sleep + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendSleep(uint8_t userSpecific, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_SLEEP, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = userSpecific; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Wakeup + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendWakeup(uint8_t userSpecific, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_WAKEUP, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = userSpecific; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Resume + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendResume(uint8_t userSpecific, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_RESUME, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = userSpecific; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Pause + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendPause(uint8_t userSpecific, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_PAUSE, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = userSpecific; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Activate + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendActivate(uint8_t userSpecific, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_ACTIVATE, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = userSpecific; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Deactivate + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendDeactivate(uint8_t userSpecific, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_DEACTIVATE, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = userSpecific; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/* "Reserved for future use" not supported. No frame defined. */ + +/* "Reserved for future use" not supported. No frame defined. */ + +/* "Reserved for future use" not supported. No frame defined. */ + +/** + * Dim lamp(s) + * + * @param[in] value Value (0 – 100) . 0 = off, 100 = full on. 254 dim down one step. 255 dim up one + * step. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendDimLampS(uint8_t value, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_DIM_LAMPS, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = value; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Change Channel + * + * @param[in] channel A value between 0 and 127 indicates the channel number. A value between 128 to + * 157 is change down by the specified number of channels. A value between 160 to 191 is change up by + * the specified number of channels. A value of 255 means that this is an extended change channel + * event and that the channel number is sent in byte 3 and after if needed. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendChangeChannel(uint8_t channel, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_CHANGE_CHANNEL, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = channel; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Change Level + * + * @param[in] level Absolute level. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendChangeLevel(uint8_t level, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_CHANGE_LEVEL, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = level; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Relative Change Level + * + * @param[in] level Relative level. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendRelativeChangeLevel(uint8_t level, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_RELATIVE_CHANGE_LEVEL, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = level; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Measurement Request + * + * @param[in] index Zero indicates all measurements supported by node should be sent (as separate + * events). Non-zero indicates a node specific index specifying which measurement to send. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendMeasurementRequest(uint8_t index, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_MEASUREMENT_REQUEST, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = index; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Stream Data + * + * @param[in] index Sequence number which is increase by one for each stream data event sent. + * @param[in] data Stream data. (optional) (array[7]) + * @param[in] datasize Size in byte. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendStreamData(uint8_t index, uint8_t const * const data, uint8_t dataSize) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + uint8_t byteIndex = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_STREAM_DATA, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = index; + size += 1; + + if (NULL != data) + { + for(byteIndex = 0; byteIndex < dataSize; ++byteIndex) + { + txMsg.data[1 + byteIndex] = data[byteIndex]; + size += 1; + + if (VSCP_L1_DATA_SIZE <= size) + { + break; + } + } + } + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Sync + * + * @param[in] index Sensor index for a sensor within a module (see data coding). 255 is all sensors. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendSync(uint8_t index, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_SYNC, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = index; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Zoned Stream Data + * + * @param[in] index Sequence number which is increase by one for each stream data event sent. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * @param[in] data Stream data. (optional) (array[5]) + * @param[in] datasize Size in byte. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendZonedStreamData(uint8_t index, uint8_t zone, uint8_t subZone, uint8_t const * const data, uint8_t dataSize) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + uint8_t byteIndex = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_ZONED_STREAM_DATA, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = index; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + if (NULL != data) + { + for(byteIndex = 0; byteIndex < dataSize; ++byteIndex) + { + txMsg.data[3 + byteIndex] = data[byteIndex]; + size += 1; + + if (VSCP_L1_DATA_SIZE <= size) + { + break; + } + } + } + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Set Pre-set + * + * @param[in] presetCode Code for pre-set to set. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendSetPreSet(uint8_t presetCode, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_SET_PRESET, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = presetCode; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Toggle state + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendToggleState(uint8_t userSpecific, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_TOGGLE_STATE, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = userSpecific; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Timed pulse on + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * @param[in] control Control byte. + * @param[in] time Set time as a long with MSB in the first byte. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendTimedPulseOn(uint8_t userSpecific, uint8_t zone, uint8_t subZone, uint8_t control, uint32_t time) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_TIMED_PULSE_ON, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = userSpecific; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.data[3] = control; + size += 1; + + txMsg.data[4] = (uint8_t)((time >> 24) & 0xff); + txMsg.data[5] = (uint8_t)((time >> 16) & 0xff); + txMsg.data[6] = (uint8_t)((time >> 8) & 0xff); + txMsg.data[7] = (uint8_t)((time >> 0) & 0xff); + size += 4; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Timed pulse off + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * @param[in] control Control byte. + * @param[in] time Set time as a long with MSB in the first byte. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendTimedPulseOff(uint8_t userSpecific, uint8_t zone, uint8_t subZone, uint8_t control, uint32_t time) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_TIMED_PULSE_OFF, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = userSpecific; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.data[3] = control; + size += 1; + + txMsg.data[4] = (uint8_t)((time >> 24) & 0xff); + txMsg.data[5] = (uint8_t)((time >> 16) & 0xff); + txMsg.data[6] = (uint8_t)((time >> 8) & 0xff); + txMsg.data[7] = (uint8_t)((time >> 0) & 0xff); + size += 4; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Set country/language + * + * @param[in] code Country/Language code. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * @param[in] codeSpecific Country/Language code specific (array[4]) + * @param[in] codeSpecificsize Size in byte. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendSetCountryLanguage(uint8_t code, uint8_t zone, uint8_t subZone, uint8_t const * const codeSpecific, uint8_t codeSpecificSize) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + uint8_t byteIndex = 0; + + if ((NULL == codeSpecific) || (0 == codeSpecificSize)) + { + return FALSE; + } + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_SET_COUNTRY_LANGUAGE, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = code; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; -/* "(All) Lamp(s) on/off" not supported. No frame defined. */ + for(byteIndex = 0; byteIndex < codeSpecificSize; ++byteIndex) + { + txMsg.data[3 + byteIndex] = codeSpecific[byteIndex]; + size += 1; + + if (VSCP_L1_DATA_SIZE <= size) + { + break; + } + } -/* "Open" not supported. No frame defined. */ + txMsg.dataNum = size; -/* "Close" not supported. No frame defined. */ + return vscp_core_sendEvent(&txMsg); +} -/* "TurnOn" not supported. No frame defined. */ +/** + * Big Change level + * + * @param[in] index Index. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * @param[in] level Level as signed Integer. The range can be adjusted by the user by sending the + * needed number of bytes 1-5. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendBigChangeLevel(uint8_t index, uint8_t zone, uint8_t subZone, int32_t level) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; -/* "TurnOff" not supported. No frame defined. */ + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_BIG_CHANGE_LEVEL, VSCP_PRIORITY_3_NORMAL); -/* "Start" not supported. No frame defined. */ + txMsg.data[0] = index; + size += 1; -/* "Stop" not supported. No frame defined. */ + txMsg.data[1] = zone; + size += 1; -/* "Reset" not supported. No frame defined. */ + txMsg.data[2] = subZone; + size += 1; -/* "Interrupt" not supported. No frame defined. */ + /* level not supported! */ -/* "Sleep" not supported. No frame defined. */ + txMsg.dataNum = size; -/* "Wakeup" not supported. No frame defined. */ + return vscp_core_sendEvent(&txMsg); +} -/* "Resume" not supported. No frame defined. */ +/** + * Move shutter up + * + * @param[in] index Index. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendMoveShutterUp(uint8_t index, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; -/* "Pause" not supported. No frame defined. */ + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_SHUTTER_UP, VSCP_PRIORITY_3_NORMAL); -/* "Activate" not supported. No frame defined. */ + txMsg.data[0] = index; + size += 1; -/* "Deactivate" not supported. No frame defined. */ + txMsg.data[1] = zone; + size += 1; -/* "Reserved for future use" not supported. No frame defined. */ + txMsg.data[2] = subZone; + size += 1; -/* "Reserved for future use" not supported. No frame defined. */ + txMsg.dataNum = size; -/* "Reserved for future use" not supported. No frame defined. */ + return vscp_core_sendEvent(&txMsg); +} + +/** + * Move shutter down + * + * @param[in] index Index. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendMoveShutterDown(uint8_t index, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_SHUTTER_DOWN, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = index; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Move shutter left + * + * @param[in] index Index. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendMoveShutterLeft(uint8_t index, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_SHUTTER_LEFT, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = index; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Move shutter right + * + * @param[in] index Index. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendMoveShutterRight(uint8_t index, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_SHUTTER_RIGHT, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = index; + size += 1; + + txMsg.data[1] = zone; + size += 1; -/* "Dim lamp(s)" not supported. No frame defined. */ + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Move shutter to middle position + * + * @param[in] index Index. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendMoveShutterToMiddlePosition(uint8_t index, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_SHUTTER_MIDDLE, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = index; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Move shutter to preset position + * + * @param[in] index Index. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendMoveShutterToPresetPosition(uint8_t index, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_SHUTTER_PRESET, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = index; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * (All) Lamp(s) on + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendAllLampSOn(uint8_t userSpecific, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_ALL_LAMPS_ON, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = userSpecific; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; -/* "Change Channel" not supported. No frame defined. */ + txMsg.dataNum = size; -/* "Change Level" not supported. No frame defined. */ + return vscp_core_sendEvent(&txMsg); +} -/* "Relative Change Level" not supported. No frame defined. */ +/** + * (All) Lamp(s) off + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendAllLampSOff(uint8_t userSpecific, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; -/* "Measurement Request" not supported. No frame defined. */ + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_ALL_LAMPS_OFF, VSCP_PRIORITY_3_NORMAL); -/* "Stream Data" not supported. No frame defined. */ + txMsg.data[0] = userSpecific; + size += 1; -/* "Sync" not supported. No frame defined. */ + txMsg.data[1] = zone; + size += 1; -/* "Zoned Stream Data" not supported. No frame defined. */ + txMsg.data[2] = subZone; + size += 1; -/* "Set Pre-set" not supported. No frame defined. */ + txMsg.dataNum = size; -/* "Toggle state" not supported. No frame defined. */ + return vscp_core_sendEvent(&txMsg); +} -/* "Timed pulse on" not supported. No frame defined. */ +/** + * Lock + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendLock(uint8_t userSpecific, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; -/* "Timed pulse off" not supported. No frame defined. */ + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_LOCK, VSCP_PRIORITY_3_NORMAL); -/* "Set country/language" not supported. No frame defined. */ + txMsg.data[0] = userSpecific; + size += 1; -/* "Big Change level" not supported. No frame defined. */ + txMsg.data[1] = zone; + size += 1; -/* "Move shutter up" not supported. No frame defined. */ + txMsg.data[2] = subZone; + size += 1; -/* "Move shutter down" not supported. No frame defined. */ + txMsg.dataNum = size; -/* "Move shutter left" not supported. No frame defined. */ + return vscp_core_sendEvent(&txMsg); +} -/* "Move shutter right" not supported. No frame defined. */ +/** + * Unlock + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendUnlock(uint8_t userSpecific, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; -/* "Move shutter to middle position" not supported. No frame defined. */ + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_CONTROL, VSCP_TYPE_CONTROL_UNLOCK, VSCP_PRIORITY_3_NORMAL); -/* "Move shutter to preset position" not supported. No frame defined. */ + txMsg.data[0] = userSpecific; + size += 1; -/* "(All) Lamp(s) on" not supported. No frame defined. */ + txMsg.data[1] = zone; + size += 1; -/* "(All) Lamp(s) off" not supported. No frame defined. */ + txMsg.data[2] = subZone; + size += 1; -/* "Lock" not supported. No frame defined. */ + txMsg.dataNum = size; -/* "Unlock" not supported. No frame defined. */ + return vscp_core_sendEvent(&txMsg); +} /** * PWM set diff --git a/src/framework/events/vscp_evt_control.h b/src/framework/events/vscp_evt_control.h index 2632fb1..e269c04 100644 --- a/src/framework/events/vscp_evt_control.h +++ b/src/framework/events/vscp_evt_control.h @@ -83,37 +83,181 @@ This file is automatically generated. Don't change it manually. */ extern BOOL vscp_evt_control_sendGeneralEvent(void); -/* "Mute on/off" not supported. No frame defined. */ +/** + * Mute on/off + * + * @param[in] command If equal to zero no mute else mute. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendMuteOnOff(uint8_t command, uint8_t zone, uint8_t subZone); -/* "(All) Lamp(s) on/off" not supported. No frame defined. */ +/** + * (All) Lamp(s) on/off + * + * @param[in] state If equal to zero off else on. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendAllLampSOnOff(uint8_t state, uint8_t zone, uint8_t subZone); -/* "Open" not supported. No frame defined. */ +/** + * Open + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendOpen(uint8_t userSpecific, uint8_t zone, uint8_t subZone); -/* "Close" not supported. No frame defined. */ +/** + * Close + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendClose(uint8_t userSpecific, uint8_t zone, uint8_t subZone); -/* "TurnOn" not supported. No frame defined. */ +/** + * TurnOn + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendTurnon(uint8_t userSpecific, uint8_t zone, uint8_t subZone); -/* "TurnOff" not supported. No frame defined. */ +/** + * TurnOff + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendTurnoff(uint8_t userSpecific, uint8_t zone, uint8_t subZone); -/* "Start" not supported. No frame defined. */ +/** + * Start + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendStart(uint8_t userSpecific, uint8_t zone, uint8_t subZone); -/* "Stop" not supported. No frame defined. */ +/** + * Stop + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendStop(uint8_t userSpecific, uint8_t zone, uint8_t subZone); -/* "Reset" not supported. No frame defined. */ +/** + * Reset + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendReset(uint8_t userSpecific, uint8_t zone, uint8_t subZone); -/* "Interrupt" not supported. No frame defined. */ +/** + * Interrupt + * + * @param[in] interruptLevel Interrupt level. (0 – 255 , zero is lowest interrupt level. ). + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendInterrupt(uint8_t interruptLevel, uint8_t zone, uint8_t subZone); -/* "Sleep" not supported. No frame defined. */ +/** + * Sleep + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendSleep(uint8_t userSpecific, uint8_t zone, uint8_t subZone); -/* "Wakeup" not supported. No frame defined. */ +/** + * Wakeup + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendWakeup(uint8_t userSpecific, uint8_t zone, uint8_t subZone); -/* "Resume" not supported. No frame defined. */ +/** + * Resume + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendResume(uint8_t userSpecific, uint8_t zone, uint8_t subZone); -/* "Pause" not supported. No frame defined. */ +/** + * Pause + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendPause(uint8_t userSpecific, uint8_t zone, uint8_t subZone); -/* "Activate" not supported. No frame defined. */ +/** + * Activate + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendActivate(uint8_t userSpecific, uint8_t zone, uint8_t subZone); -/* "Deactivate" not supported. No frame defined. */ +/** + * Deactivate + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendDeactivate(uint8_t userSpecific, uint8_t zone, uint8_t subZone); /* "Reserved for future use" not supported. No frame defined. */ @@ -121,53 +265,284 @@ extern BOOL vscp_evt_control_sendGeneralEvent(void); /* "Reserved for future use" not supported. No frame defined. */ -/* "Dim lamp(s)" not supported. No frame defined. */ +/** + * Dim lamp(s) + * + * @param[in] value Value (0 – 100) . 0 = off, 100 = full on. 254 dim down one step. 255 dim up one + * step. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendDimLampS(uint8_t value, uint8_t zone, uint8_t subZone); -/* "Change Channel" not supported. No frame defined. */ +/** + * Change Channel + * + * @param[in] channel A value between 0 and 127 indicates the channel number. A value between 128 to + * 157 is change down by the specified number of channels. A value between 160 to 191 is change up by + * the specified number of channels. A value of 255 means that this is an extended change channel + * event and that the channel number is sent in byte 3 and after if needed. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendChangeChannel(uint8_t channel, uint8_t zone, uint8_t subZone); -/* "Change Level" not supported. No frame defined. */ +/** + * Change Level + * + * @param[in] level Absolute level. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendChangeLevel(uint8_t level, uint8_t zone, uint8_t subZone); -/* "Relative Change Level" not supported. No frame defined. */ +/** + * Relative Change Level + * + * @param[in] level Relative level. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendRelativeChangeLevel(uint8_t level, uint8_t zone, uint8_t subZone); -/* "Measurement Request" not supported. No frame defined. */ +/** + * Measurement Request + * + * @param[in] index Zero indicates all measurements supported by node should be sent (as separate + * events). Non-zero indicates a node specific index specifying which measurement to send. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendMeasurementRequest(uint8_t index, uint8_t zone, uint8_t subZone); -/* "Stream Data" not supported. No frame defined. */ +/** + * Stream Data + * + * @param[in] index Sequence number which is increase by one for each stream data event sent. + * @param[in] data Stream data. (optional) (array[7]) + * @param[in] datasize Size in byte. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendStreamData(uint8_t index, uint8_t const * const data, uint8_t dataSize); -/* "Sync" not supported. No frame defined. */ +/** + * Sync + * + * @param[in] index Sensor index for a sensor within a module (see data coding). 255 is all sensors. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendSync(uint8_t index, uint8_t zone, uint8_t subZone); -/* "Zoned Stream Data" not supported. No frame defined. */ +/** + * Zoned Stream Data + * + * @param[in] index Sequence number which is increase by one for each stream data event sent. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * @param[in] data Stream data. (optional) (array[5]) + * @param[in] datasize Size in byte. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendZonedStreamData(uint8_t index, uint8_t zone, uint8_t subZone, uint8_t const * const data, uint8_t dataSize); -/* "Set Pre-set" not supported. No frame defined. */ +/** + * Set Pre-set + * + * @param[in] presetCode Code for pre-set to set. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendSetPreSet(uint8_t presetCode, uint8_t zone, uint8_t subZone); -/* "Toggle state" not supported. No frame defined. */ +/** + * Toggle state + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendToggleState(uint8_t userSpecific, uint8_t zone, uint8_t subZone); -/* "Timed pulse on" not supported. No frame defined. */ +/** + * Timed pulse on + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * @param[in] control Control byte. + * @param[in] time Set time as a long with MSB in the first byte. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendTimedPulseOn(uint8_t userSpecific, uint8_t zone, uint8_t subZone, uint8_t control, uint32_t time); -/* "Timed pulse off" not supported. No frame defined. */ +/** + * Timed pulse off + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * @param[in] control Control byte. + * @param[in] time Set time as a long with MSB in the first byte. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendTimedPulseOff(uint8_t userSpecific, uint8_t zone, uint8_t subZone, uint8_t control, uint32_t time); -/* "Set country/language" not supported. No frame defined. */ +/** + * Set country/language + * + * @param[in] code Country/Language code. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * @param[in] codeSpecific Country/Language code specific (array[4]) + * @param[in] codeSpecificsize Size in byte. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendSetCountryLanguage(uint8_t code, uint8_t zone, uint8_t subZone, uint8_t const * const codeSpecific, uint8_t codeSpecificSize); -/* "Big Change level" not supported. No frame defined. */ +/** + * Big Change level + * + * @param[in] index Index. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * @param[in] level Level as signed Integer. The range can be adjusted by the user by sending the + * needed number of bytes 1-5. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendBigChangeLevel(uint8_t index, uint8_t zone, uint8_t subZone, int32_t level); -/* "Move shutter up" not supported. No frame defined. */ +/** + * Move shutter up + * + * @param[in] index Index. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendMoveShutterUp(uint8_t index, uint8_t zone, uint8_t subZone); -/* "Move shutter down" not supported. No frame defined. */ +/** + * Move shutter down + * + * @param[in] index Index. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendMoveShutterDown(uint8_t index, uint8_t zone, uint8_t subZone); -/* "Move shutter left" not supported. No frame defined. */ +/** + * Move shutter left + * + * @param[in] index Index. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendMoveShutterLeft(uint8_t index, uint8_t zone, uint8_t subZone); -/* "Move shutter right" not supported. No frame defined. */ +/** + * Move shutter right + * + * @param[in] index Index. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendMoveShutterRight(uint8_t index, uint8_t zone, uint8_t subZone); -/* "Move shutter to middle position" not supported. No frame defined. */ +/** + * Move shutter to middle position + * + * @param[in] index Index. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendMoveShutterToMiddlePosition(uint8_t index, uint8_t zone, uint8_t subZone); -/* "Move shutter to preset position" not supported. No frame defined. */ +/** + * Move shutter to preset position + * + * @param[in] index Index. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendMoveShutterToPresetPosition(uint8_t index, uint8_t zone, uint8_t subZone); -/* "(All) Lamp(s) on" not supported. No frame defined. */ +/** + * (All) Lamp(s) on + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendAllLampSOn(uint8_t userSpecific, uint8_t zone, uint8_t subZone); -/* "(All) Lamp(s) off" not supported. No frame defined. */ +/** + * (All) Lamp(s) off + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendAllLampSOff(uint8_t userSpecific, uint8_t zone, uint8_t subZone); -/* "Lock" not supported. No frame defined. */ +/** + * Lock + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendLock(uint8_t userSpecific, uint8_t zone, uint8_t subZone); -/* "Unlock" not supported. No frame defined. */ +/** + * Unlock + * + * @param[in] userSpecific User specific value. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_control_sendUnlock(uint8_t userSpecific, uint8_t zone, uint8_t subZone); /** * PWM set diff --git a/src/framework/events/vscp_evt_display.c b/src/framework/events/vscp_evt_display.c index 0344604..9129e95 100644 --- a/src/framework/events/vscp_evt_display.c +++ b/src/framework/events/vscp_evt_display.c @@ -384,11 +384,12 @@ extern BOOL vscp_evt_display_sendShowText(uint8_t index, uint8_t zone, uint8_t s * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. * @param[in] subZone Sub-zone for which event applies to (0-255). 255 is all sub-zones. * @param[in] state 0 =off, 1=on, 2=blink - * @param[in] blinkPeriod Blink period in milliseconds. + * @param[in] blinkOnPeriod Blink On period in milliseconds. + * @param[in] blinkOffPeriod Blink Off period in milliseconds. * * @return If event is sent, it will return TRUE otherwise FALSE. */ -extern BOOL vscp_evt_display_sendSetLed(uint8_t index, uint8_t zone, uint8_t subZone, uint8_t state, uint32_t blinkPeriod) +extern BOOL vscp_evt_display_sendSetLed(uint8_t index, uint8_t zone, uint8_t subZone, uint8_t state, uint16_t blinkOnPeriod, uint16_t blinkOffPeriod) { vscp_TxMessage txMsg; uint8_t size = 0; @@ -407,11 +408,13 @@ extern BOOL vscp_evt_display_sendSetLed(uint8_t index, uint8_t zone, uint8_t sub txMsg.data[3] = state; size += 1; - txMsg.data[4] = (uint8_t)((blinkPeriod >> 24) & 0xff); - txMsg.data[5] = (uint8_t)((blinkPeriod >> 18) & 0xff); - txMsg.data[6] = (uint8_t)((blinkPeriod >> 8) & 0xff); - txMsg.data[7] = (uint8_t)((blinkPeriod >> 0) & 0xff); - size += 4; + txMsg.data[4] = (uint8_t)((blinkOnPeriod >> 8) & 0xff); + txMsg.data[5] = (uint8_t)((blinkOnPeriod >> 0) & 0xff); + size += 2; + + txMsg.data[6] = (uint8_t)((blinkOffPeriod >> 8) & 0xff); + txMsg.data[7] = (uint8_t)((blinkOffPeriod >> 0) & 0xff); + size += 2; txMsg.dataNum = size; diff --git a/src/framework/events/vscp_evt_display.h b/src/framework/events/vscp_evt_display.h index 9224bfa..a3af2ac 100644 --- a/src/framework/events/vscp_evt_display.h +++ b/src/framework/events/vscp_evt_display.h @@ -172,11 +172,12 @@ extern BOOL vscp_evt_display_sendShowText(uint8_t index, uint8_t zone, uint8_t s * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. * @param[in] subZone Sub-zone for which event applies to (0-255). 255 is all sub-zones. * @param[in] state 0 =off, 1=on, 2=blink - * @param[in] blinkPeriod Blink period in milliseconds. + * @param[in] blinkOnPeriod Blink On period in milliseconds. + * @param[in] blinkOffPeriod Blink Off period in milliseconds. * * @return If event is sent, it will return TRUE otherwise FALSE. */ -extern BOOL vscp_evt_display_sendSetLed(uint8_t index, uint8_t zone, uint8_t subZone, uint8_t state, uint32_t blinkPeriod); +extern BOOL vscp_evt_display_sendSetLed(uint8_t index, uint8_t zone, uint8_t subZone, uint8_t state, uint16_t blinkOnPeriod, uint16_t blinkOffPeriod); /** * Set RGB Color diff --git a/src/framework/events/vscp_evt_gnss.c b/src/framework/events/vscp_evt_gnss.c index 8f923df..dc29f45 100644 --- a/src/framework/events/vscp_evt_gnss.c +++ b/src/framework/events/vscp_evt_gnss.c @@ -102,16 +102,16 @@ extern BOOL vscp_evt_gnss_sendPosition(float_t latitude, float_t longitude) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_GNSS, VSCP_TYPE_GNSS_POSITION, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&latitude)[3]; - txMsg.data[5] = ((uint8_t*)&latitude)[2]; - txMsg.data[6] = ((uint8_t*)&latitude)[1]; - txMsg.data[7] = ((uint8_t*)&latitude)[0]; + txMsg.data[0] = ((uint8_t*)&latitude)[3]; + txMsg.data[1] = ((uint8_t*)&latitude)[2]; + txMsg.data[2] = ((uint8_t*)&latitude)[1]; + txMsg.data[3] = ((uint8_t*)&latitude)[0]; size += 4; - txMsg.data[8] = ((uint8_t*)&longitude)[3]; - txMsg.data[9] = ((uint8_t*)&longitude)[2]; - txMsg.data[10] = ((uint8_t*)&longitude)[1]; - txMsg.data[11] = ((uint8_t*)&longitude)[0]; + txMsg.data[4] = ((uint8_t*)&longitude)[3]; + txMsg.data[5] = ((uint8_t*)&longitude)[2]; + txMsg.data[6] = ((uint8_t*)&longitude)[1]; + txMsg.data[7] = ((uint8_t*)&longitude)[0]; size += 4; txMsg.dataNum = size; diff --git a/src/framework/events/vscp_evt_gnss.h b/src/framework/events/vscp_evt_gnss.h index d64e607..3da877b 100644 --- a/src/framework/events/vscp_evt_gnss.h +++ b/src/framework/events/vscp_evt_gnss.h @@ -47,7 +47,7 @@ This file is automatically generated. Don't change it manually. INCLUDES *******************************************************************************/ #include -#include "..\user\vscp_platform.h" +#include "vscp_platform.h" #include /******************************************************************************* diff --git a/src/framework/events/vscp_evt_information.c b/src/framework/events/vscp_evt_information.c index b2fc243..f572fd6 100644 --- a/src/framework/events/vscp_evt_information.c +++ b/src/framework/events/vscp_evt_information.c @@ -357,13 +357,16 @@ extern BOOL vscp_evt_information_sendClosed(uint8_t userSpecific, uint8_t zone, * @param[in] userSpecific User specific value. * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * @param[in] userData Optional user provided data. (optional) (array[5]) + * @param[in] userDatasize Size in byte. * * @return If event is sent, it will return TRUE otherwise FALSE. */ -extern BOOL vscp_evt_information_sendNodeHeartbeat(uint8_t userSpecific, uint8_t zone, uint8_t subZone) +extern BOOL vscp_evt_information_sendNodeHeartbeat(uint8_t userSpecific, uint8_t zone, uint8_t subZone, uint8_t const * const userData, uint8_t userDataSize) { vscp_TxMessage txMsg; uint8_t size = 0; + uint8_t byteIndex = 0; vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_INFORMATION, VSCP_TYPE_INFORMATION_NODE_HEARTBEAT, VSCP_PRIORITY_3_NORMAL); @@ -376,6 +379,20 @@ extern BOOL vscp_evt_information_sendNodeHeartbeat(uint8_t userSpecific, uint8_t txMsg.data[2] = subZone; size += 1; + if (NULL != userData) + { + for(byteIndex = 0; byteIndex < userDataSize; ++byteIndex) + { + txMsg.data[3 + byteIndex] = userData[byteIndex]; + size += 1; + + if (VSCP_L1_DATA_SIZE <= size) + { + break; + } + } + } + txMsg.dataNum = size; return vscp_core_sendEvent(&txMsg); @@ -2761,3 +2778,63 @@ extern BOOL vscp_evt_information_sendReconnect(uint8_t index, uint8_t zone, uint return vscp_core_sendEvent(&txMsg); } +/** + * Enter + * + * @param[in] index Index for device. Set to zero if not used. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_information_sendEnter(uint8_t index, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_INFORMATION, VSCP_TYPE_INFORMATION_ENTER, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = index; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Exit + * + * @param[in] index Index for device. Set to zero if not used. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_information_sendExit(uint8_t index, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + uint8_t size = 0; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_INFORMATION, VSCP_TYPE_INFORMATION_EXIT, VSCP_PRIORITY_3_NORMAL); + + txMsg.data[0] = index; + size += 1; + + txMsg.data[1] = zone; + size += 1; + + txMsg.data[2] = subZone; + size += 1; + + txMsg.dataNum = size; + + return vscp_core_sendEvent(&txMsg); +} + diff --git a/src/framework/events/vscp_evt_information.h b/src/framework/events/vscp_evt_information.h index 700b215..bf13e5e 100644 --- a/src/framework/events/vscp_evt_information.h +++ b/src/framework/events/vscp_evt_information.h @@ -180,10 +180,12 @@ extern BOOL vscp_evt_information_sendClosed(uint8_t userSpecific, uint8_t zone, * @param[in] userSpecific User specific value. * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * @param[in] userData Optional user provided data. (optional) (array[5]) + * @param[in] userDatasize Size in byte. * * @return If event is sent, it will return TRUE otherwise FALSE. */ -extern BOOL vscp_evt_information_sendNodeHeartbeat(uint8_t userSpecific, uint8_t zone, uint8_t subZone); +extern BOOL vscp_evt_information_sendNodeHeartbeat(uint8_t userSpecific, uint8_t zone, uint8_t subZone, uint8_t const * const userData, uint8_t userDataSize); /** * Below limit @@ -1029,4 +1031,26 @@ extern BOOL vscp_evt_information_sendDisconnect(uint8_t index, uint8_t zone, uin */ extern BOOL vscp_evt_information_sendReconnect(uint8_t index, uint8_t zone, uint8_t subZone); +/** + * Enter + * + * @param[in] index Index for device. Set to zero if not used. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_information_sendEnter(uint8_t index, uint8_t zone, uint8_t subZone); + +/** + * Exit + * + * @param[in] index Index for device. Set to zero if not used. + * @param[in] zone Zone for which event applies to (0-255). 255 is all zones. + * @param[in] subZone Sub-Zone for which event applies to (0-255). 255 is all sub-zones. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_information_sendExit(uint8_t index, uint8_t zone, uint8_t subZone); + #endif /* __VSCP_EVT_INFORMATION_H__ */ diff --git a/src/framework/events/vscp_evt_ir.c b/src/framework/events/vscp_evt_ir.c index 2d5a7cb..23321c8 100644 --- a/src/framework/events/vscp_evt_ir.c +++ b/src/framework/events/vscp_evt_ir.c @@ -260,7 +260,7 @@ extern BOOL vscp_evt_ir_sendMapitoRemoteFormat(uint8_t repeat, uint8_t zone, uin size += 1; txMsg.data[3] = (uint8_t)((address >> 24) & 0xff); - txMsg.data[4] = (uint8_t)((address >> 18) & 0xff); + txMsg.data[4] = (uint8_t)((address >> 16) & 0xff); txMsg.data[5] = (uint8_t)((address >> 8) & 0xff); txMsg.data[6] = (uint8_t)((address >> 0) & 0xff); size += 4; diff --git a/src/framework/events/vscp_evt_measurement32.c b/src/framework/events/vscp_evt_measurement32.c index ca6c462..f0f00a9 100644 --- a/src/framework/events/vscp_evt_measurement32.c +++ b/src/framework/events/vscp_evt_measurement32.c @@ -101,10 +101,10 @@ extern BOOL vscp_evt_measurement32_sendCount(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_COUNT, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -126,10 +126,10 @@ extern BOOL vscp_evt_measurement32_sendLengthDistance(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_LENGTH, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -151,10 +151,10 @@ extern BOOL vscp_evt_measurement32_sendMass(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_MASS, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -176,10 +176,10 @@ extern BOOL vscp_evt_measurement32_sendTime(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_TIME, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -201,10 +201,10 @@ extern BOOL vscp_evt_measurement32_sendElectricCurrent(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_ELECTRIC_CURRENT, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -226,10 +226,10 @@ extern BOOL vscp_evt_measurement32_sendTemperature(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_TEMPERATURE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -251,10 +251,10 @@ extern BOOL vscp_evt_measurement32_sendAmountOfSubstance(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_AMOUNT_OF_SUBSTANCE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -276,10 +276,10 @@ extern BOOL vscp_evt_measurement32_sendLuminousIntensityIntensityOfLight(float_t vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_INTENSITY_OF_LIGHT, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -301,10 +301,10 @@ extern BOOL vscp_evt_measurement32_sendFrequency(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_FREQUENCY, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -326,10 +326,10 @@ extern BOOL vscp_evt_measurement32_sendRadioactivityAndOtherRandomEvents(float_t vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_RADIOACTIVITY, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -351,10 +351,10 @@ extern BOOL vscp_evt_measurement32_sendForce(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_FORCE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -376,10 +376,10 @@ extern BOOL vscp_evt_measurement32_sendPressure(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_PRESSURE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -401,10 +401,10 @@ extern BOOL vscp_evt_measurement32_sendEnergy(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_ENERGY, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -426,10 +426,10 @@ extern BOOL vscp_evt_measurement32_sendPower(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_POWER, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -451,10 +451,10 @@ extern BOOL vscp_evt_measurement32_sendElectricalCharge(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_ELECTRICAL_CHARGE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -476,10 +476,10 @@ extern BOOL vscp_evt_measurement32_sendElectricalPotentialVoltage(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_ELECTRICAL_POTENTIAL, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -501,10 +501,10 @@ extern BOOL vscp_evt_measurement32_sendElectricalCapacitance(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_ELECTRICAL_CAPACITANCE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -526,10 +526,10 @@ extern BOOL vscp_evt_measurement32_sendElectricalResistance(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_ELECTRICAL_RESISTANCE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -551,10 +551,10 @@ extern BOOL vscp_evt_measurement32_sendElectricalConductance(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_ELECTRICAL_CONDUCTANCE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -576,10 +576,10 @@ extern BOOL vscp_evt_measurement32_sendMagneticFieldStrength(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_MAGNETIC_FIELD_STRENGTH, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -601,10 +601,10 @@ extern BOOL vscp_evt_measurement32_sendMagneticFlux(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_MAGNETIC_FLUX, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -626,10 +626,10 @@ extern BOOL vscp_evt_measurement32_sendMagneticFluxDensity(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_MAGNETIC_FLUX_DENSITY, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -651,10 +651,10 @@ extern BOOL vscp_evt_measurement32_sendInductance(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_INDUCTANCE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -676,10 +676,10 @@ extern BOOL vscp_evt_measurement32_sendLuminousFlux(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_FLUX_OF_LIGHT, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -701,10 +701,10 @@ extern BOOL vscp_evt_measurement32_sendIlluminance(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_ILLUMINANCE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -726,10 +726,10 @@ extern BOOL vscp_evt_measurement32_sendRadiationDose(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_RADIATION_DOSE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -751,10 +751,10 @@ extern BOOL vscp_evt_measurement32_sendCatalyticActivity(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_CATALYTIC_ACITIVITY, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -776,10 +776,10 @@ extern BOOL vscp_evt_measurement32_sendVolume(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_VOLUME, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -801,10 +801,10 @@ extern BOOL vscp_evt_measurement32_sendSoundIntensity(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_SOUND_INTENSITY, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -826,10 +826,10 @@ extern BOOL vscp_evt_measurement32_sendAngle(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_ANGLE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -851,10 +851,10 @@ extern BOOL vscp_evt_measurement32_sendPositionWgs84(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_POSITION, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -876,10 +876,10 @@ extern BOOL vscp_evt_measurement32_sendSpeed(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_SPEED, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -901,10 +901,10 @@ extern BOOL vscp_evt_measurement32_sendAcceleration(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_ACCELERATION, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -926,10 +926,10 @@ extern BOOL vscp_evt_measurement32_sendTension(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_TENSION, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -951,10 +951,10 @@ extern BOOL vscp_evt_measurement32_sendDampMoistHygrometerReading(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_HUMIDITY, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -976,10 +976,10 @@ extern BOOL vscp_evt_measurement32_sendFlow(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_FLOW, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -1001,10 +1001,10 @@ extern BOOL vscp_evt_measurement32_sendThermalResistance(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_THERMAL_RESISTANCE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -1026,10 +1026,10 @@ extern BOOL vscp_evt_measurement32_sendRefractiveOpticalPower(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_REFRACTIVE_POWER, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -1051,10 +1051,10 @@ extern BOOL vscp_evt_measurement32_sendDynamicViscosity(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_DYNAMIC_VISCOSITY, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -1076,10 +1076,10 @@ extern BOOL vscp_evt_measurement32_sendSoundImpedance(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_SOUND_IMPEDANCE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -1101,10 +1101,10 @@ extern BOOL vscp_evt_measurement32_sendSoundResistance(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_SOUND_RESISTANCE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -1126,10 +1126,10 @@ extern BOOL vscp_evt_measurement32_sendElectricElastance(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_ELECTRIC_ELASTANCE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -1151,10 +1151,10 @@ extern BOOL vscp_evt_measurement32_sendLuminousEnergy(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_LUMINOUS_ENERGY, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -1176,10 +1176,10 @@ extern BOOL vscp_evt_measurement32_sendLuminance(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_LUMINANCE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -1201,10 +1201,10 @@ extern BOOL vscp_evt_measurement32_sendChemicalConcentration(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_CHEMICAL_CONCENTRATION, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -1228,10 +1228,10 @@ extern BOOL vscp_evt_measurement32_sendDoseEquivalent(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_DOSE_EQVIVALENT, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -1255,10 +1255,10 @@ extern BOOL vscp_evt_measurement32_sendDewPoint(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_DEWPOINT, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -1280,10 +1280,10 @@ extern BOOL vscp_evt_measurement32_sendRelativeLevel(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_RELATIVE_LEVEL, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -1305,10 +1305,10 @@ extern BOOL vscp_evt_measurement32_sendAltitude(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_ALTITUDE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -1330,10 +1330,10 @@ extern BOOL vscp_evt_measurement32_sendArea(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_AREA, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -1355,10 +1355,10 @@ extern BOOL vscp_evt_measurement32_sendRadiantIntensity(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_RADIANT_INTENSITY, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -1380,10 +1380,10 @@ extern BOOL vscp_evt_measurement32_sendRadiance(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_RADIANCE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -1405,10 +1405,10 @@ extern BOOL vscp_evt_measurement32_sendIrradianceExitanceRadiosity(float_t value vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_IRRADIANCE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -1430,10 +1430,10 @@ extern BOOL vscp_evt_measurement32_sendSpectralRadiance(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_SPECTRAL_RADIANCE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -1455,10 +1455,10 @@ extern BOOL vscp_evt_measurement32_sendSpectralIrradiance(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_SPECTRAL_IRRADIANCE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -1480,10 +1480,10 @@ extern BOOL vscp_evt_measurement32_sendSoundPressureAcousticPressure(float_t val vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_SOUND_PRESSURE, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -1505,10 +1505,10 @@ extern BOOL vscp_evt_measurement32_sendSoundEnergyDensity(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_SOUND_DENSITY, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; @@ -1530,10 +1530,10 @@ extern BOOL vscp_evt_measurement32_sendSoundLevel(float_t value) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_MEASUREMENT32, VSCP_TYPE_MEASUREMENT32_SOUND_LEVEL, VSCP_PRIORITY_3_NORMAL); - txMsg.data[4] = ((uint8_t*)&value)[3]; - txMsg.data[5] = ((uint8_t*)&value)[2]; - txMsg.data[6] = ((uint8_t*)&value)[1]; - txMsg.data[7] = ((uint8_t*)&value)[0]; + txMsg.data[0] = ((uint8_t*)&value)[3]; + txMsg.data[1] = ((uint8_t*)&value)[2]; + txMsg.data[2] = ((uint8_t*)&value)[1]; + txMsg.data[3] = ((uint8_t*)&value)[0]; size += 4; txMsg.dataNum = size; diff --git a/src/framework/events/vscp_evt_protocol.c b/src/framework/events/vscp_evt_protocol.c index 6ad08a6..08a6efc 100644 --- a/src/framework/events/vscp_evt_protocol.c +++ b/src/framework/events/vscp_evt_protocol.c @@ -108,7 +108,7 @@ extern BOOL vscp_evt_protocol_sendSegmentControllerHeartbeat(uint8_t crc, uint32 if (NULL != time) { txMsg.data[1] = (uint8_t)((*time >> 24) & 0xff); - txMsg.data[2] = (uint8_t)((*time >> 18) & 0xff); + txMsg.data[2] = (uint8_t)((*time >> 16) & 0xff); txMsg.data[3] = (uint8_t)((*time >> 8) & 0xff); txMsg.data[4] = (uint8_t)((*time >> 0) & 0xff); size += 4; @@ -388,13 +388,13 @@ extern BOOL vscp_evt_protocol_sendAckBootLoaderMode(uint32_t flashBlockSize, uin vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_PROTOCOL, VSCP_TYPE_PROTOCOL_ACK_BOOT_LOADER, VSCP_PRIORITY_3_NORMAL); txMsg.data[0] = (uint8_t)((flashBlockSize >> 24) & 0xff); - txMsg.data[1] = (uint8_t)((flashBlockSize >> 18) & 0xff); + txMsg.data[1] = (uint8_t)((flashBlockSize >> 16) & 0xff); txMsg.data[2] = (uint8_t)((flashBlockSize >> 8) & 0xff); txMsg.data[3] = (uint8_t)((flashBlockSize >> 0) & 0xff); size += 4; txMsg.data[4] = (uint8_t)((numberOfBlocks >> 24) & 0xff); - txMsg.data[5] = (uint8_t)((numberOfBlocks >> 18) & 0xff); + txMsg.data[5] = (uint8_t)((numberOfBlocks >> 16) & 0xff); txMsg.data[6] = (uint8_t)((numberOfBlocks >> 8) & 0xff); txMsg.data[7] = (uint8_t)((numberOfBlocks >> 0) & 0xff); size += 4; @@ -421,7 +421,7 @@ extern BOOL vscp_evt_protocol_sendNackBootLoaderMode(uint32_t const * const erro if (NULL != errorCode) { txMsg.data[0] = (uint8_t)((*errorCode >> 24) & 0xff); - txMsg.data[1] = (uint8_t)((*errorCode >> 18) & 0xff); + txMsg.data[1] = (uint8_t)((*errorCode >> 16) & 0xff); txMsg.data[2] = (uint8_t)((*errorCode >> 8) & 0xff); txMsg.data[3] = (uint8_t)((*errorCode >> 0) & 0xff); size += 4; @@ -448,7 +448,7 @@ extern BOOL vscp_evt_protocol_sendStartBlockDataTransfer(uint32_t blockNumber, u vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_PROTOCOL, VSCP_TYPE_PROTOCOL_START_BLOCK, VSCP_PRIORITY_3_NORMAL); txMsg.data[0] = (uint8_t)((blockNumber >> 24) & 0xff); - txMsg.data[1] = (uint8_t)((blockNumber >> 18) & 0xff); + txMsg.data[1] = (uint8_t)((blockNumber >> 16) & 0xff); txMsg.data[2] = (uint8_t)((blockNumber >> 8) & 0xff); txMsg.data[3] = (uint8_t)((blockNumber >> 0) & 0xff); size += 4; @@ -521,7 +521,7 @@ extern BOOL vscp_evt_protocol_sendAckDataBlock(uint16_t blockCrc, uint32_t write size += 2; txMsg.data[2] = (uint8_t)((writePointer >> 24) & 0xff); - txMsg.data[3] = (uint8_t)((writePointer >> 18) & 0xff); + txMsg.data[3] = (uint8_t)((writePointer >> 16) & 0xff); txMsg.data[4] = (uint8_t)((writePointer >> 8) & 0xff); txMsg.data[5] = (uint8_t)((writePointer >> 0) & 0xff); size += 4; @@ -550,7 +550,7 @@ extern BOOL vscp_evt_protocol_sendNackDataBlock(uint8_t errorCode, uint32_t writ size += 1; txMsg.data[1] = (uint8_t)((writePointer >> 24) & 0xff); - txMsg.data[2] = (uint8_t)((writePointer >> 18) & 0xff); + txMsg.data[2] = (uint8_t)((writePointer >> 16) & 0xff); txMsg.data[3] = (uint8_t)((writePointer >> 8) & 0xff); txMsg.data[4] = (uint8_t)((writePointer >> 0) & 0xff); size += 4; @@ -575,7 +575,7 @@ extern BOOL vscp_evt_protocol_sendProgramDataBlock(uint32_t blockNumber) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_PROTOCOL, VSCP_TYPE_PROTOCOL_PROGRAM_BLOCK_DATA, VSCP_PRIORITY_3_NORMAL); txMsg.data[0] = (uint8_t)((blockNumber >> 24) & 0xff); - txMsg.data[1] = (uint8_t)((blockNumber >> 18) & 0xff); + txMsg.data[1] = (uint8_t)((blockNumber >> 16) & 0xff); txMsg.data[2] = (uint8_t)((blockNumber >> 8) & 0xff); txMsg.data[3] = (uint8_t)((blockNumber >> 0) & 0xff); size += 4; @@ -600,7 +600,7 @@ extern BOOL vscp_evt_protocol_sendAckProgramDataBlock(uint32_t blockNumber) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_PROTOCOL, VSCP_TYPE_PROTOCOL_PROGRAM_BLOCK_DATA_ACK, VSCP_PRIORITY_3_NORMAL); txMsg.data[0] = (uint8_t)((blockNumber >> 24) & 0xff); - txMsg.data[1] = (uint8_t)((blockNumber >> 18) & 0xff); + txMsg.data[1] = (uint8_t)((blockNumber >> 16) & 0xff); txMsg.data[2] = (uint8_t)((blockNumber >> 8) & 0xff); txMsg.data[3] = (uint8_t)((blockNumber >> 0) & 0xff); size += 4; @@ -629,7 +629,7 @@ extern BOOL vscp_evt_protocol_sendNackProgramDataBlock(uint8_t errorCode, uint32 size += 1; txMsg.data[1] = (uint8_t)((blockNumber >> 24) & 0xff); - txMsg.data[2] = (uint8_t)((blockNumber >> 18) & 0xff); + txMsg.data[2] = (uint8_t)((blockNumber >> 16) & 0xff); txMsg.data[3] = (uint8_t)((blockNumber >> 8) & 0xff); txMsg.data[4] = (uint8_t)((blockNumber >> 0) & 0xff); size += 4; diff --git a/src/framework/events/vscp_evt_wireless.c b/src/framework/events/vscp_evt_wireless.c index ca54ca5..4abdb1a 100644 --- a/src/framework/events/vscp_evt_wireless.c +++ b/src/framework/events/vscp_evt_wireless.c @@ -102,7 +102,7 @@ extern BOOL vscp_evt_wireless_sendGsmCell(uint32_t count) vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_WIRELESS, VSCP_TYPE_WIRELESS_GSM_CELL, VSCP_PRIORITY_3_NORMAL); txMsg.data[0] = (uint8_t)((count >> 24) & 0xff); - txMsg.data[1] = (uint8_t)((count >> 18) & 0xff); + txMsg.data[1] = (uint8_t)((count >> 16) & 0xff); txMsg.data[2] = (uint8_t)((count >> 8) & 0xff); txMsg.data[3] = (uint8_t)((count >> 0) & 0xff); size += 4;