diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a7fe869..a191e3c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,15 @@ -## 0.8.1 (not released yet) +## 0.9.0 - VSCP framework - Bugfixes: - Fix of misspellings/typos, thanks to TomasRoj. - VSCP measurement events fixed, because internal the parameters unit and index in the vscp_data_coding_getFormatByte() call were reversed. Thanks to troky! + - Features: + - CLASS1.ALARM, Type=12, "Watchdog" added. + - CLASS1.INFORMATION, Type=80, "Updated" added. + - CLASS1.WEATHER/CLASS1.WEATHER_FORECAST Type=52, "UV Index" added. + ## 0.8.0 - Examples diff --git a/VERSION.md b/VERSION.md index 07af7e62..adedad13 100644 --- a/VERSION.md +++ b/VERSION.md @@ -3,12 +3,11 @@ How to release a software version? 1. Update the vscp_core.h accordingly. 2. Update the version in vscp/doc/Doxyfile. -3. Generate a new framework documentation. -4. Update CHANGELOG.md. -5. Commit and push all changes. -6. Create a github tag and mark the version with "pre" for pre-release, e.g. "V1.0.0pre". -7. Execute coverity tasks and update the source code accordingly. -8. If all bugfixes done, create a github tag for the release, e.g. "V1.0.0". +3. Update CHANGELOG.md. +4. Commit and push all changes. +5. Create a github tag and mark the version with "pre" for pre-release, e.g. "V1.0.0pre". +6. Execute coverity tasks and update the source code accordingly. +7. If all bugfixes done, create a github tag for the release, e.g. "V1.0.0". Software version format: V.. - Increase the major number in case of incompatible interface changes or incompatible behavior. That means that the user of the framework has to adapt its implementation too. diff --git a/vscp/doc/Doxyfile b/vscp/doc/Doxyfile index 886bcdad..e12eb7e4 100644 --- a/vscp/doc/Doxyfile +++ b/vscp/doc/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "VSCP framework" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = v0.8.0 +PROJECT_NUMBER = v0.9.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/vscp/events/vscp_alarm.c b/vscp/events/vscp_alarm.c index b314c7ad..a20715c2 100644 --- a/vscp/events/vscp_alarm.c +++ b/vscp/events/vscp_alarm.c @@ -376,6 +376,31 @@ extern BOOL vscp_alarm_sendDisarm(uint8_t state, uint8_t zone, uint8_t subZone) return vscp_core_sendEvent(&txMsg); } +/** + * Issued when a watchdog has been triggered. + * + * @param[in] state State (0=off, 1=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 Status + * @retval FALSE Failed to send the event + * @retval TRUE Event successul sent + * + */ +extern BOOL vscp_alarm_sendWatchdogEvent(uint8_t state, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_ALARM, VSCP_TYPE_ALARM_WATCHDOG, VSCP_PRIORITY_3_NORMAL); + + txMsg.dataNum = 3; + txMsg.data[0] = state; + txMsg.data[1] = zone; + txMsg.data[2] = subZone; + + return vscp_core_sendEvent(&txMsg); +} + /******************************************************************************* LOCAL FUNCTIONS *******************************************************************************/ diff --git a/vscp/events/vscp_alarm.h b/vscp/events/vscp_alarm.h index 38e6a20c..de53525e 100644 --- a/vscp/events/vscp_alarm.h +++ b/vscp/events/vscp_alarm.h @@ -234,6 +234,19 @@ extern BOOL vscp_alarm_sendArm(uint8_t state, uint8_t zone, uint8_t subZone); */ extern BOOL vscp_alarm_sendDisarm(uint8_t state, uint8_t zone, uint8_t subZone); +/** + * Issued when a watchdog has been triggered. + * + * @param[in] state State (0=off, 1=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 Status + * @retval FALSE Failed to send the event + * @retval TRUE Event successul sent + * + */ +extern BOOL vscp_alarm_sendWatchdogEvent(uint8_t state, uint8_t zone, uint8_t subZone); + #endif /* __VSCP_ALARM_H__ */ /** @} */ diff --git a/vscp/events/vscp_information.c b/vscp/events/vscp_information.c index 3604de53..57d65c6e 100644 --- a/vscp/events/vscp_information.c +++ b/vscp/events/vscp_information.c @@ -2373,6 +2373,31 @@ extern BOOL vscp_information_sendFallingEvent(uint8_t index, uint8_t zone, uint8 return vscp_core_sendEvent(&txMsg); } +/** + * Something has been updated. + * + * @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 Status + * @retval FALSE Failed to send the event + * @retval TRUE Event successul sent + * + */ +extern BOOL vscp_information_sendUpdatedEvent(uint8_t index, uint8_t zone, uint8_t subZone) +{ + vscp_TxMessage txMsg; + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_INFORMATION, VSCP_TYPE_INFORMATION_UPDATED, VSCP_PRIORITY_3_NORMAL); + + txMsg.dataNum = 3; + txMsg.data[0] = index; + txMsg.data[1] = zone; + txMsg.data[2] = subZone; + + return vscp_core_sendEvent(&txMsg); +} + /******************************************************************************* LOCAL FUNCTIONS *******************************************************************************/ diff --git a/vscp/events/vscp_information.h b/vscp/events/vscp_information.h index e9fd668d..dd63b601 100644 --- a/vscp/events/vscp_information.h +++ b/vscp/events/vscp_information.h @@ -1279,6 +1279,19 @@ extern BOOL vscp_information_sendRisingEvent(uint8_t index, uint8_t zone, uint8_ */ extern BOOL vscp_information_sendFallingEvent(uint8_t index, uint8_t zone, uint8_t subZone); +/** + * Something has been updated. + * + * @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 Status + * @retval FALSE Failed to send the event + * @retval TRUE Event successul sent + * + */ +extern BOOL vscp_information_sendUpdatedEvent(uint8_t index, uint8_t zone, uint8_t subZone); + #endif /* __VSCP_INFORMATION_H__ */ /** @} */ diff --git a/vscp/events/vscp_weather.c b/vscp/events/vscp_weather.c index 79880ce5..7180622c 100644 --- a/vscp/events/vscp_weather.c +++ b/vscp/events/vscp_weather.c @@ -1373,6 +1373,41 @@ extern BOOL vscp_weather_sendArmageddonEvent(uint8_t index, uint8_t zone, uint8_ return vscp_core_sendEvent(&txMsg); } +/** + * UV Index is an international scale for UV intensity which can have the range of 1-15 where 1 is + * very low radiation and a value over 10 is extremely high radiation. + * + * @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] uvIndex UV index (1-15) + * @return Status + * @retval FALSE Failed to send the event + * @retval TRUE Event successul sent + * + */ +extern BOOL vscp_weather_sendUvIndexEvent(uint8_t index, uint8_t zone, uint8_t subZone, uint8_t uvIndex) +{ + vscp_TxMessage txMsg; + + /* Invalid UV index? */ + if ((1 > uvIndex) || + (15 < uvIndex)) + { + return FALSE; + } + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_WEATHER, VSCP_TYPE_WEATHER_UV_INDEX, VSCP_PRIORITY_3_NORMAL); + + txMsg.dataNum = 4; + txMsg.data[0] = index; + txMsg.data[1] = zone; + txMsg.data[2] = subZone; + txMsg.data[3] = uvIndex; + + return vscp_core_sendEvent(&txMsg); +} + /******************************************************************************* LOCAL FUNCTIONS *******************************************************************************/ diff --git a/vscp/events/vscp_weather.h b/vscp/events/vscp_weather.h index ca7a79a2..83b48e18 100644 --- a/vscp/events/vscp_weather.h +++ b/vscp/events/vscp_weather.h @@ -750,6 +750,21 @@ extern BOOL vscp_weather_sendWarningLevel5Event(uint8_t index, uint8_t zone, uin */ extern BOOL vscp_weather_sendArmageddonEvent(uint8_t index, uint8_t zone, uint8_t subZone); +/** + * UV Index is an international scale for UV intensity which can have the range of 1-15 where 1 is + * very low radiation and a value over 10 is extremely high radiation. + * + * @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] uvIndex UV index (1-15) + * @return Status + * @retval FALSE Failed to send the event + * @retval TRUE Event successul sent + * + */ +extern BOOL vscp_weather_sendUvIndexEvent(uint8_t index, uint8_t zone, uint8_t subZone, uint8_t uvIndex); + #endif /* __VSCP_WEATHER_H__ */ /** @} */ diff --git a/vscp/events/vscp_weather_forecast.c b/vscp/events/vscp_weather_forecast.c index 4d151367..101b4e45 100644 --- a/vscp/events/vscp_weather_forecast.c +++ b/vscp/events/vscp_weather_forecast.c @@ -1373,6 +1373,41 @@ extern BOOL vscp_weather_forecast_sendArmageddonEvent(uint8_t index, uint8_t zon return vscp_core_sendEvent(&txMsg); } +/** + * UV Index is an international scale for UV intensity which can have the range of 1-15 where 1 is + * very low radiation and a value over 10 is extremely high radiation. + * + * @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] uvIndex UV index (1-15) + * @return Status + * @retval FALSE Failed to send the event + * @retval TRUE Event successul sent + * + */ +extern BOOL vscp_weather_forecast_sendUvIndexEvent(uint8_t index, uint8_t zone, uint8_t subZone, uint8_t uvIndex) +{ + vscp_TxMessage txMsg; + + /* Invalid UV index? */ + if ((1 > uvIndex) || + (15 < uvIndex)) + { + return FALSE; + } + + vscp_core_prepareTxMessage(&txMsg, VSCP_CLASS_L1_WEATHER_FORECAST, VSCP_TYPE_WEATHER_FORECAST_UV_INDEX, VSCP_PRIORITY_3_NORMAL); + + txMsg.dataNum = 4; + txMsg.data[0] = index; + txMsg.data[1] = zone; + txMsg.data[2] = subZone; + txMsg.data[3] = uvIndex; + + return vscp_core_sendEvent(&txMsg); +} + /******************************************************************************* LOCAL FUNCTIONS *******************************************************************************/ diff --git a/vscp/events/vscp_weather_forecast.h b/vscp/events/vscp_weather_forecast.h index defd3400..43ef28e4 100644 --- a/vscp/events/vscp_weather_forecast.h +++ b/vscp/events/vscp_weather_forecast.h @@ -750,6 +750,21 @@ extern BOOL vscp_weather_forecast_sendWarningLevel5Event(uint8_t index, uint8_t */ extern BOOL vscp_weather_forecast_sendArmageddonEvent(uint8_t index, uint8_t zone, uint8_t subZone); +/** + * UV Index is an international scale for UV intensity which can have the range of 1-15 where 1 is + * very low radiation and a value over 10 is extremely high radiation. + * + * @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] uvIndex UV index (1-15) + * @return Status + * @retval FALSE Failed to send the event + * @retval TRUE Event successul sent + * + */ +extern BOOL vscp_weather_forecast_sendUvIndexEvent(uint8_t index, uint8_t zone, uint8_t subZone, uint8_t uvIndex); + #endif /* __VSCP_WEATHER_FORECAST_H__ */ /** @} */ diff --git a/vscp/vscp_core.h b/vscp/vscp_core.h index 714074a1..f71b2d4c 100644 --- a/vscp/vscp_core.h +++ b/vscp/vscp_core.h @@ -96,13 +96,13 @@ extern "C" #define VSCP_CORE_VERSION_MINOR (10) /** VSCP specification sub-minor version number, the framework is compliant to. */ -#define VSCP_CORE_VERSION_SUB_MINOR (8) +#define VSCP_CORE_VERSION_SUB_MINOR (18) /** VSCP specification version string, the framework is compliant to. */ #define VSCP_CORE_VERSION_STR "v1.10.18" /** VSCP framework version string */ -#define VSCP_CORE_FRAMEWORK_VERSION "v0.8.0" +#define VSCP_CORE_FRAMEWORK_VERSION "v0.9.0" /******************************************************************************* MACROS diff --git a/vscp/vscp_type_alarm.h b/vscp/vscp_type_alarm.h index 3c21630a..7d26d15b 100644 --- a/vscp/vscp_type_alarm.h +++ b/vscp/vscp_type_alarm.h @@ -103,6 +103,9 @@ extern "C" /** VSCP class 1 alarm type: Issued after an alarm system has been disarmed. */ #define VSCP_TYPE_ALARM_EMERGENCY_DISARM 11 +/** VSCP class 1 alarm type: Issued when a watchdog has been triggered. */ +#define VSCP_TYPE_ALARM_WATCHDOG 12 + /******************************************************************************* MACROS *******************************************************************************/ diff --git a/vscp/vscp_type_information.h b/vscp/vscp_type_information.h index b5165cdb..6dfebd08 100644 --- a/vscp/vscp_type_information.h +++ b/vscp/vscp_type_information.h @@ -307,6 +307,9 @@ extern "C" /** VSCP class 1 information type: A falling (edge) is detected. */ #define VSCP_TYPE_INFORMATION_FALLING 79 +/** VSCP class 1 information type: Something has been updated. */ +#define VSCP_TYPE_INFORMATION_UPDATED 80 + /******************************************************************************* MACROS *******************************************************************************/ diff --git a/vscp/vscp_type_weather.h b/vscp/vscp_type_weather.h index 4d68f5fc..1fa1b8b3 100644 --- a/vscp/vscp_type_weather.h +++ b/vscp/vscp_type_weather.h @@ -223,6 +223,9 @@ extern "C" /** VSCP class 1 weather type: Armageddon */ #define VSCP_TYPE_WEATHER_ARMAGEDDON 51 +/** VSCP class 1 weather type: UV index */ +#define VSCP_TYPE_WEATHER_UV_INDEX 52 + /******************************************************************************* MACROS *******************************************************************************/ diff --git a/vscp/vscp_type_weather_forecast.h b/vscp/vscp_type_weather_forecast.h index ed1d8e78..3336de43 100644 --- a/vscp/vscp_type_weather_forecast.h +++ b/vscp/vscp_type_weather_forecast.h @@ -223,6 +223,9 @@ extern "C" /** VSCP class 1 weather forecast type: Armageddon */ #define VSCP_TYPE_WEATHER_FORECAST_ARMAGEDDON 51 +/** VSCP class 1 weather type: UV index */ +#define VSCP_TYPE_WEATHER_FORECAST_UV_INDEX 52 + /******************************************************************************* MACROS *******************************************************************************/