diff --git a/CHANGELOG.md b/CHANGELOG.md index 858f53d..1a7cb0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.3.0 + +- Update to VSCP framework v2.3.0, please see the [changelog](https://github.com/BlueAndi/vscp-framework/releases/tag/v2.3.0) there. + ## 2.2.0 - Update to VSCP framework v2.2.0, please see the [changelog](https://github.com/BlueAndi/vscp-framework/releases/tag/v2.2.0) there. diff --git a/library.json b/library.json index 147c25e..c033a38 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "vscp-arduino", - "version": "2.2.0", + "version": "2.3.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 a36bb0d..5ad9476 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=VSCP -version=2.2.0 +version=2.3.0 author=Andreas Merkle maintainer=Andreas Merkle sentence=Very Simple Control Protocol L1 framework for all Arduino boards. diff --git a/src/framework/core/vscp_core.c b/src/framework/core/vscp_core.c index 4d00ae9..adda58b 100644 --- a/src/framework/core/vscp_core.c +++ b/src/framework/core/vscp_core.c @@ -1563,6 +1563,18 @@ static inline void vscp_core_handleProtocolClassType(void) /* Boot loader specific event. Not supported. */ break; + case VSCP_TYPE_PROTOCOL_BOOT_LOADER_ABORT: + /* Boot loader specific event. Not supported. */ + break; + + case VSCP_TYPE_PROTOCOL_BOOT_LOADER_ABORT_ACK: + /* Boot loader specific event. Not supported. */ + break; + + case VSCP_TYPE_PROTOCOL_BOOT_LOADER_ABORT_NACK: + /* Boot loader specific event. Not supported. */ + break; + /* Not handled type */ default: break; diff --git a/src/framework/core/vscp_core.h b/src/framework/core/vscp_core.h index 5974c9c..2cbf551 100644 --- a/src/framework/core/vscp_core.h +++ b/src/framework/core/vscp_core.h @@ -96,13 +96,13 @@ extern "C" #define VSCP_CORE_VERSION_MINOR (15) /** VSCP specification sub-minor version number, the framework is compliant to. */ -#define VSCP_CORE_VERSION_SUB_MINOR (9) +#define VSCP_CORE_VERSION_SUB_MINOR (10) /** VSCP specification version string, the framework is compliant to. */ -#define VSCP_CORE_VERSION_STR "v1.15.9" +#define VSCP_CORE_VERSION_STR "v1.15.10" /** VSCP framework version string */ -#define VSCP_CORE_FRAMEWORK_VERSION "v2.2.0" +#define VSCP_CORE_FRAMEWORK_VERSION "v2.3.0" /******************************************************************************* MACROS diff --git a/src/framework/core/vscp_type_protocol.h b/src/framework/core/vscp_type_protocol.h index 7c29735..2f124b9 100644 --- a/src/framework/core/vscp_type_protocol.h +++ b/src/framework/core/vscp_type_protocol.h @@ -490,6 +490,40 @@ extern "C" */ #define VSCP_TYPE_PROTOCOL_BOOT_LOADER_CHECK 54 +/** + * Not mandatory. Only needed if a VSCP boot-loader algorithm is used. + * Part of the VSCP boot-loader functionality. This event provide a way to leave the bootloader in a + * secure fashion if there is problems loading firmware to a device. It is only available if the + * device has a bootloader that supports this functionality. Typically this is a device that has + * several firmware slots and can switch between them, and by that switch back to the last known + * working firmware. + * The event can be sent in all states of the bootloading procedure. + * CLASS1.PROTOCOL, Type=56 (Bootloader abort ACK), should be sent as a positive response to a + * bootloader exit or rollback. + * CLASS1.PROTOCOL, Type=57 (Bootloader abort NACK), should be sent as a negative response to a + * bootloader exit or rollback. + */ +#define VSCP_TYPE_PROTOCOL_BOOT_LOADER_ABORT 55 + +/** + * Not mandatory. Only needed if a VSCP boot-loader algorithm is used. + * Part of the VSCP boot-loader functionality. This event is a positive response to a bootloader abort + * or rollback CLASS1.PROTOCOL, Type=55 (Bootloader abort). + * Event is sent before execution of the new firmware starts. It is used to tell the controlling + * device that the device is ready to leave the bootloader mode and start the new firmware. + */ +#define VSCP_TYPE_PROTOCOL_BOOT_LOADER_ABORT_ACK 56 + +/** + * Not mandatory. Only needed if a VSCP boot-loader algorithm is used. + * Part of the VSCP boot-loader functionality. This event is a negative response to a bootloader abort + * or rollback CLASS1.PROTOCOL, Type=55 (Bootloader abort). + * On a single slot firmware device where a firmware update has failed and there is no working + * firmware to switch back to this event should be sent to tell the controlling device that we can't + * leave the bootloader mode until a new full firmware has been loaded. + */ +#define VSCP_TYPE_PROTOCOL_BOOT_LOADER_ABORT_NACK 57 + /******************************************************************************* MACROS *******************************************************************************/ diff --git a/src/framework/events/vscp_evt_protocol.c b/src/framework/events/vscp_evt_protocol.c index 76875fe..65d423f 100644 --- a/src/framework/events/vscp_evt_protocol.c +++ b/src/framework/events/vscp_evt_protocol.c @@ -1359,3 +1359,51 @@ extern BOOL vscp_evt_protocol_sendBootloaderCheck(void) return vscp_core_sendEvent(&txMsg); } +/** + * Bootloader Abort. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_protocol_sendBootloaderAbort(void) +{ + vscp_TxMessage txMsg; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_PROTOCOL, VSCP_TYPE_PROTOCOL_BOOT_LOADER_ABORT, VSCP_PRIORITY_3_NORMAL); + + txMsg.dataSize = 0; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Bootloader Abort ACK. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_protocol_sendBootloaderAbortAck(void) +{ + vscp_TxMessage txMsg; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_PROTOCOL, VSCP_TYPE_PROTOCOL_BOOT_LOADER_ABORT_ACK, VSCP_PRIORITY_3_NORMAL); + + txMsg.dataSize = 0; + + return vscp_core_sendEvent(&txMsg); +} + +/** + * Bootloader Abort NACK. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_protocol_sendBootloaderAbortNack(void) +{ + vscp_TxMessage txMsg; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_PROTOCOL, VSCP_TYPE_PROTOCOL_BOOT_LOADER_ABORT_NACK, VSCP_PRIORITY_3_NORMAL); + + txMsg.dataSize = 0; + + return vscp_core_sendEvent(&txMsg); +} + diff --git a/src/framework/events/vscp_evt_protocol.h b/src/framework/events/vscp_evt_protocol.h index ceae688..d4e9062 100644 --- a/src/framework/events/vscp_evt_protocol.h +++ b/src/framework/events/vscp_evt_protocol.h @@ -529,6 +529,27 @@ extern BOOL vscp_evt_protocol_sendBlockDataChunkNack(void); */ extern BOOL vscp_evt_protocol_sendBootloaderCheck(void); +/** + * Bootloader Abort. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_protocol_sendBootloaderAbort(void); + +/** + * Bootloader Abort ACK. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_protocol_sendBootloaderAbortAck(void); + +/** + * Bootloader Abort NACK. + * + * @return If event is sent, it will return TRUE otherwise FALSE. + */ +extern BOOL vscp_evt_protocol_sendBootloaderAbortNack(void); + #ifdef __cplusplus } #endif