Skip to content

Commit

Permalink
Updated to VSCP framework v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueAndi committed Jun 3, 2020
1 parent 2dc6eff commit 6bc15fe
Show file tree
Hide file tree
Showing 22 changed files with 2,099 additions and 387 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
51 changes: 25 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=VSCP
version=1.0.0
version=1.1.0
author=Andreas Merkle
maintainer=Andreas Merkle <vscp@blue-andi.de>
sentence=Very Simple Control Protocol L1 framework for all Arduino boards.
Expand Down
2 changes: 1 addition & 1 deletion src/VSCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
16 changes: 13 additions & 3 deletions src/framework/core/vscp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 )

Expand Down Expand Up @@ -531,7 +541,7 @@ extern void vscp_core_process(void)
/* Invalidate received message */
vscp_core_rxMessageValid = FALSE;

return;
return isEventHandled;
}

/**
Expand Down Expand Up @@ -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 */
Expand Down
11 changes: 9 additions & 2 deletions src/framework/core/vscp_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
12 changes: 6 additions & 6 deletions src/framework/core/vscp_dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand All @@ -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 )
Expand Down
10 changes: 10 additions & 0 deletions src/framework/core/vscp_type_information.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*******************************************************************************/
Expand Down
6 changes: 6 additions & 0 deletions src/framework/core/vscp_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Loading

0 comments on commit 6bc15fe

Please sign in to comment.