Skip to content

Commit 6bc15fe

Browse files
committed
Updated to VSCP framework v1.1.0
1 parent 2dc6eff commit 6bc15fe

22 files changed

+2099
-387
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.1.0
2+
3+
- Update to VSCP framework v1.1.0, please see the ![changelog](https://github.com/BlueAndi/vscp-framework/releases/tag/v1.1.0) there.
4+
15
## 1.0.0
26

37
- Update to VSCP framework v1.0.0, please see the ![changelog](https://github.com/BlueAndi/vscp-framework/releases/tag/v1.0.0) there.

README.md

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -147,36 +147,35 @@ Please take a look to the provided examples because they guide you through all n
147147

148148
You will find the class defines here:
149149
```
150-
src/framework/vscp_class_l1.h
151-
src/framework/vscp_class_l1_l2.h
150+
src/framework/core/vscp_class_l1.h
151+
src/framework/core/vscp_class_l1_l2.h
152152
```
153153

154154
You will find the type defines here:
155155
```
156-
src/framework/vscp_type_alarm.h
157-
src/framework/vscp_type_aol.h
158-
src/framework/vscp_type_control.h
159-
src/framework/vscp_type_data.h
160-
src/framework/vscp_type_diagnostic.h
161-
src/framework/vscp_type_display.h
162-
src/framework/vscp_type_error.h
163-
src/framework/vscp_type_gnss.h
164-
src/framework/vscp_type_information.h
165-
src/framework/vscp_type_ir.h
166-
src/framework/vscp_type_log.h
167-
src/framework/vscp_type_measurement.h
168-
src/framework/vscp_type_measurement32.h
169-
src/framework/vscp_type_measurement64.h
170-
src/framework/vscp_type_measurezone.h
171-
src/framework/vscp_type_multimedia.h
172-
src/framework/vscp_type_phone.h
173-
src/framework/vscp_type_protocol.h
174-
src/framework/vscp_type_remote.h
175-
src/framework/vscp_type_security.h
176-
src/framework/vscp_type_setvaluezone.h
177-
src/framework/vscp_type_weather.h
178-
src/framework/vscp_type_weather_forecast.h
179-
src/framework/vscp_type_wireless.h
156+
src/framework/events/vscp_evt_alarm.h
157+
src/framework/events/vscp_evt_aol.h
158+
src/framework/events/vscp_evt_control.h
159+
src/framework/events/vscp_evt_data.h
160+
src/framework/events/vscp_evt_diagnostic.h
161+
src/framework/events/vscp_evt_display.h
162+
src/framework/events/vscp_evt_error.h
163+
src/framework/events/vscp_evt_gnss.h
164+
src/framework/events/vscp_evt_information.h
165+
src/framework/events/vscp_evt_ir.h
166+
src/framework/events/vscp_evt_log.h
167+
src/framework/events/vscp_evt_measurement.h
168+
src/framework/events/vscp_evt_measurement32.h
169+
src/framework/events/vscp_evt_measurement64.h
170+
src/framework/events/vscp_evt_measurezone.h
171+
src/framework/events/vscp_evt_multimedia.h
172+
src/framework/events/vscp_evt_phone.h
173+
src/framework/events/vscp_evt_protocol.h
174+
src/framework/events/vscp_evt_security.h
175+
src/framework/events/vscp_evt_setvaluezone.h
176+
src/framework/events/vscp_evt_weather.h
177+
src/framework/events/vscp_evt_weather_forecast.h
178+
src/framework/events/vscp_evt_wireless.h
180179
```
181180

182181
### Does the library only support the CAN-bus as transport protocotol?

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vscp-arduino",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"keywords": "vscp, arduino-library, vscp-arduino, automation, home automation",
55
"description": "Very Simple Control Procotol (VSCP) Level 1 Library for the arduino IDE.",
66
"repository": {

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=VSCP
2-
version=1.0.0
2+
version=1.1.0
33
author=Andreas Merkle
44
maintainer=Andreas Merkle <vscp@blue-andi.de>
55
sentence=Very Simple Control Protocol L1 framework for all Arduino boards.

src/VSCP.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ void VSCP::process(void)
164164
if (true == mIsInitialized)
165165
{
166166
/* Process the whole framework */
167-
vscp_core_process();
167+
(void)vscp_core_process();
168168

169169
/* Process all member timers */
170170
mStatusLampTimer.process();

src/framework/core/vscp_core.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,14 +456,24 @@ extern void vscp_core_restoreFactoryDefaultSettings(void)
456456
/**
457457
* This function process the whole VSCP core stack. Call it in a user defined
458458
* cyclic period.
459+
*
460+
* Note, for a fast handling of received events, this function returns TRUE in
461+
* case a event was handled, otherwise FALSE. Call it e.g. in a loop until no
462+
* event is handled anymore. If its not necessary in your application, just
463+
* skip the return value.
464+
*
465+
* @return If a received event was handled, it will return TRUE otherwise FALSE.
459466
*/
460-
extern void vscp_core_process(void)
467+
extern BOOL vscp_core_process(void)
461468
{
469+
BOOL isEventHandled = FALSE;
470+
462471
/* Get any received message.
463472
* Note, only in the active state all received messages are processed.
464473
* In the other ones it depends on their sub state.
465474
*/
466475
vscp_core_rxMessageValid = vscp_transport_readMessage(&vscp_core_rxMessage);
476+
isEventHandled = vscp_core_rxMessageValid;
467477

468478
#if VSCP_CONFIG_BASE_IS_ENABLED( VSCP_CONFIG_ENABLE_LOGGER )
469479

@@ -531,7 +541,7 @@ extern void vscp_core_process(void)
531541
/* Invalidate received message */
532542
vscp_core_rxMessageValid = FALSE;
533543

534-
return;
544+
return isEventHandled;
535545
}
536546

537547
/**
@@ -1153,7 +1163,7 @@ static inline void vscp_core_stateActive(void)
11531163
#if VSCP_CONFIG_BASE_IS_ENABLED( VSCP_CONFIG_ENABLE_CUSTOM_HEARTBEAT )
11541164
(void)vscp_portable_sendNodeHeartbeatEvent();
11551165
#else
1156-
(void)vscp_evt_information_sendNodeHeartbeat(0, vscp_dev_data_getNodeZone(), vscp_dev_data_getNodeSubZone());
1166+
(void)vscp_evt_information_sendNodeHeartbeat(0, vscp_dev_data_getNodeZone(), vscp_dev_data_getNodeSubZone(), NULL, 0);
11571167
#endif
11581168

11591169
/* Restart timer */

src/framework/core/vscp_core.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ extern "C"
102102
#define VSCP_CORE_VERSION_STR "v1.11.00"
103103

104104
/** VSCP framework version string */
105-
#define VSCP_CORE_FRAMEWORK_VERSION "v1.0.0"
105+
#define VSCP_CORE_FRAMEWORK_VERSION "v1.1.0"
106106

107107
/*******************************************************************************
108108
MACROS
@@ -147,8 +147,15 @@ extern void vscp_core_restoreFactoryDefaultSettings(void);
147147
/**
148148
* This function process the whole VSCP core stack. Call it in a user defined
149149
* cyclic period.
150+
*
151+
* Note, for a fast handling of received events, this function returns TRUE in
152+
* case a event was handled, otherwise FALSE. Call it e.g. in a loop until no
153+
* event is handled anymore. If its not necessary in your application, just
154+
* skip the return value.
155+
*
156+
* @return If a received event was handled, it will return TRUE otherwise FALSE.
150157
*/
151-
extern void vscp_core_process(void);
158+
extern BOOL vscp_core_process(void);
152159

153160
/**
154161
* This function reads the nickname id of the node.

src/framework/core/vscp_dm.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,12 @@ extern void vscp_dm_executeActions(vscp_RxMessage const * const msg)
405405
(VSCP_L1_DATA_SIZE > zoneIndex))
406406
{
407407
uint8_t subZoneIndex = zoneIndex + 1;
408+
uint8_t zone = msg->data[zoneIndex];
409+
uint8_t subZone = msg->data[subZoneIndex];
408410

409-
/* Zone match? */
410-
if (0 != (row.flags & VSCP_DM_FLAG_MATCH_ZONE))
411+
/* Zone match and event shall not apply to all zones? */
412+
if ((0 != (row.flags & VSCP_DM_FLAG_MATCH_ZONE)) && (VSCP_ZONE_BROADCAST != zone))
411413
{
412-
uint8_t zone = msg->data[zoneIndex];
413414
uint8_t dmZone = vscp_dev_data_getNodeZone();
414415

415416
#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)
431432
}
432433
}
433434

434-
/* Sub zone match? */
435-
if (0 != (row.flags & VSCP_DM_FLAG_MATCH_SUB_ZONE))
435+
/* Sub zone match and event shall not apply to all sub-zones? */
436+
if ((0 != (row.flags & VSCP_DM_FLAG_MATCH_SUB_ZONE)) && (VSCP_SUBZONE_BROADCAST != subZone))
436437
{
437-
uint8_t subZone = msg->data[subZoneIndex];
438438
uint8_t dmSubZone = vscp_dev_data_getNodeSubZone();
439439

440440
#if VSCP_CONFIG_BASE_IS_ENABLED( VSCP_CONFIG_ENABLE_DM_EXTENSION )

src/framework/core/vscp_type_information.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,16 @@ extern "C"
590590
*/
591591
#define VSCP_TYPE_INFORMATION_RECONNECT 83
592592

593+
/**
594+
* Enter, something has been entered.
595+
*/
596+
#define VSCP_TYPE_INFORMATION_ENTER 84
597+
598+
/**
599+
* Exit, something has been exited.
600+
*/
601+
#define VSCP_TYPE_INFORMATION_EXIT 85
602+
593603
/*******************************************************************************
594604
MACROS
595605
*******************************************************************************/

src/framework/core/vscp_types.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ extern "C"
9595
/** GUID size */
9696
#define VSCP_GUID_SIZE (16)
9797

98+
/** Zone value which means that this event shall apply for all zones. */
99+
#define VSCP_ZONE_BROADCAST (0xFF)
100+
101+
/** Sub-zone value which means that this event shall apply for all sub-zones. */
102+
#define VSCP_SUBZONE_BROADCAST (0xFF)
103+
98104
/** Application register start address (page 0) */
99105
#define VSCP_REGISTER_APP_START_ADDR (0x00)
100106

0 commit comments

Comments
 (0)