diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6d72688..f59eb88 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,9 +6,9 @@ name: CI on: # Triggers the workflow on push or pull request events but only for the master branch push: - branches: [ master ] + branches: [ main, develop ] pull_request: - branches: [ master ] + branches: [ main, develop ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -23,7 +23,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 # Dependencies - name: Build CUnit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a5fee8b..5596af8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,58 +1,58 @@ -name: Relase Script - -# Controls when the action will run. -on: - release: - # A release, pre-release, or draft of a release is published. - types: [published] - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # The introduction just shows some useful informations. - intro: - # The type of runner that the job will run on. - runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job. - steps: - - run: echo "The job was automatically triggered by a ${{ github.event_name }} event." - - run: echo "The name of the branch is ${{ github.ref }} and the repository is ${{ github.repository }}." - - publish: - # The type of runner that the job will run on. - runs-on: ubuntu-latest - # Intro must run first - needs: intro - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Cache pip - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Cache PlatformIO - uses: actions/cache@v4 - with: - path: ~/.platformio - key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.9" - - - name: Install PlatformIO - run: | - python -m pip install --upgrade pip - pip install --upgrade platformio - - - name: Deploy Package to Registry - env: - PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }} - run: | - platformio package publish --non-interactive +name: Relase Script + +# Controls when the action will run. +on: + release: + # A release, pre-release, or draft of a release is published. + types: [published] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # The introduction just shows some useful informations. + intro: + # The type of runner that the job will run on. + runs-on: ubuntu-latest + # Steps represent a sequence of tasks that will be executed as part of the job. + steps: + - run: echo "The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "The name of the branch is ${{ github.ref }} and the repository is ${{ github.repository }}." + + publish: + # The type of runner that the job will run on. + runs-on: ubuntu-latest + # Intro must run first + needs: intro + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Cache pip + uses: actions/cache@v5 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Cache PlatformIO + uses: actions/cache@v5 + with: + path: ~/.platformio + key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} + + - name: Set up Python + uses: actions/setup-python@v6 + with: + python-version: "3.12" + + - name: Install PlatformIO + run: | + python -m pip install --upgrade pip + pip install --upgrade platformio + + - name: Deploy Package to Registry + env: + PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }} + run: | + platformio package publish --non-interactive diff --git a/README.md b/README.md index 378f6a3..917ab54 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# VSCP L1 Framework +# VSCP L1 Framework [![License](https://img.shields.io/badge/license-MIT-blue.svg)](http://choosealicense.com/licenses/mit/) [![Repo Status](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) @@ -8,13 +8,12 @@ The VSCP software framework for level 1 devices provides several layers according to the [VSCP specification](https://docs.vscp.org/spec/latest). -- [VSCP L1 Framework](#vscp-l1-framework) - [VSCP](#vscp) - [Framework](#framework) - [Core](#core) - [Event Abstraction](#event-abstraction) - - [Configuration Parameters](#configuration-parameters) - - [Common](#common) +- [Configuration Parameters](#configuration-parameters) + - [Common](#common) - [Device Data](#device-data) - [VSCP L1 Bootloader](#vscp-l1-bootloader) - [VSCP CLI Tools](#vscp-cli-tools) @@ -37,29 +36,30 @@ The VSCP software framework for level 1 devices provides several layers accordin - [License](#license) - [Contribution](#contribution) -# VSCP +## VSCP Logo The Very Simple Control Protocol (VSCP), an open and free protocol for IoT/m2m automation tasks. -More information can be found on the main site http://www.vscp.org +More information can be found on the main site [http://www.vscp.org](http://www.vscp.org). -# Framework +## Framework -## Core -![core-diagram](http://www.plantuml.com/plantuml/proxy?cache=no&src=https://raw.githubusercontent.com/BlueAndi/vscp-framework/master/doc/doxfiles/vscp_modules.plantuml) +### Core -* The core functionality which has a built-in state machine to handle different use cases of the protocol and etc. (vscp\_core.[ch]). Right now it supports every mandatory event and some minor optional ones. -* The decision matrix is handled separately (vscp\_dm.[ch]). It contains the standard decision matrix, as described in the VSCP specification and contains an additional extension. -* The decision matrix next generation is supported too (vscp\_dm\_ng.[ch]). It eliminates the limitations of the standard decision matrix, incl. its extension. -* VSCP needs some mandatory persistent data, which can be modified during run time. This kind of data is in the persistent storage handled (vscp\_ps.[ch]). -* The device specific data is handled separatly (vscp\_dev\_data.[ch]). You can decide whether this data shall be constant and configured during compile time or its loaded from persistent storage and could be modified during run time. -* The transport layer has the possibility to loop events back (vscp_transport.[ch]). +![core-diagram](http://www.plantuml.com/plantuml/proxy?cache=no&src=https://raw.githubusercontent.com/BlueAndi/vscp-framework/main/doc/doxfiles/vscp_modules.plantuml) + +- The core functionality which has a built-in state machine to handle different use cases of the protocol and etc. (vscp\_core.[ch]). Right now it supports every mandatory event and some minor optional ones. +- The decision matrix is handled separately (vscp\_dm.[ch]). It contains the standard decision matrix, as described in the VSCP specification and contains an additional extension. +- The decision matrix next generation is supported too (vscp\_dm\_ng.[ch]). It eliminates the limitations of the standard decision matrix, incl. its extension. +- VSCP needs some mandatory persistent data, which can be modified during run time. This kind of data is in the persistent storage handled (vscp\_ps.[ch]). +- The device specific data is handled separatly (vscp\_dev\_data.[ch]). You can decide whether this data shall be constant and configured during compile time or its loaded from persistent storage and could be modified during run time. +- The transport layer has the possibility to loop events back (vscp_transport.[ch]). This can be configured for each data (vscp\_dev\_data_config.[ch]), except the firmware version. -* Functionality can be configured for your needs (vscp_config.[ch]). -* Some utility functions are separated (vscp\_util.[ch]) and used by different core modules or are maybe interested for the application too. -* Log functionaly is provided for debugging purposes (vscp\_logger.[ch]). +- Functionality can be configured for your needs (vscp_config.[ch]). +- Some utility functions are separated (vscp\_util.[ch]) and used by different core modules or are maybe interested for the application too. +- Log functionaly is provided for debugging purposes (vscp\_logger.[ch]). The framework is independent of the hardware and the used operating system. To achieve independence all of the following layers have to be adapted to the system. This is supported by templates, which contains all necessary functions with nearly empty @@ -67,17 +67,19 @@ bodys. The following modules have to be adapted for your needs, because it depends on the hardware, the operating system or how VSCP is integrated into your software: -* Transport adapter (vscp\_tp\_adapter.c) -* Timer driver (vscp\_timer.c) -* Persistent memory access driver (vscp\_ps\_access.c) -* Action module, used by the decision matrix (standard, extension and next generation) (vscp\_action.c) -* Application register access (vscp\_app\_reg.c) -* Callout functions, lamp handling and etc. (vscp\_portable.c) + +- Transport adapter (vscp\_tp\_adapter.c) +- Timer driver (vscp\_timer.c) +- Persistent memory access driver (vscp\_ps\_access.c) +- Action module, used by the decision matrix (standard, extension and next generation) (vscp\_action.c) +- Application register access (vscp\_app\_reg.c) +- Callout functions, lamp handling and etc. (vscp\_portable.c) Templates exists for all of them, which makes it much easier to adapt it and less time. See in the templates folder. -## Event Abstraction -![core-diagram](http://www.plantuml.com/plantuml/proxy?cache=no&src=https://raw.githubusercontent.com/BlueAndi/vscp-framework/master/doc/doxfiles/vscp_event_modules.plantuml) +### Event Abstraction + +![core-diagram](http://www.plantuml.com/plantuml/proxy?cache=no&src=https://raw.githubusercontent.com/BlueAndi/vscp-framework/main/doc/doxfiles/vscp_event_modules.plantuml) Using only the core, you have to assemble the VSCP events by yourself. If you want to deal only with parameter, which are VSCP independent, use the next upper layer, the event abstraction modules. @@ -87,88 +89,90 @@ VSCP independent, use the next upper layer, the event abstraction modules. ### Common The following configuration parameters can be enable/disable/set in the -``` + +```bash vscp_config_overwrite.h ``` -| Feature switch | Default | Description | -| :------------: | :-----: | :---------: | -| VSCP\_CONFIG\_ENABLE\_LOGGER | disabled | Enable log functionality (CLASS1.Log). Use the macros in vscp\_logger.h to send log messages. | -| VSCP\_CONFIG\_SILENT\_NODE | disabled | Silent node configuration, which is used for e. g. RS-485 connections. This type of nodes only listen to traffic before they get initialized by a host. In this case the nickname discovery process is not started for a node when it is powered up for the first time. This type on node instead starts to listen for the CLASS1.PROTOCOL, Type=23 (GUID drop nickname-ID / reset device.) event. When this series of events is received and the GUID is the same as for the module the module starts the nickname discovery procedure as of above. | -| VSCP\_CONFIG\_HARD\_CODED\_NODE | disabled | Hard-coded node (fixed nickname id) | -| VSCP\_CONFIG\_HEARTBEAT\_SUPPORT\_SEGMENT | disabled | Enable segment controller heartbeat support for nodes. | -| VSCP\_CONFIG\_HEARTBEAT\_NODE | enabled | Enable sending node heartbeat (mandatory since 2015-09-10). | -| VSCP\_CONFIG\_IDLE\_CALLOUT | disabled | Enable idle callout. If VSCP stops working and enters idle state, the application will be notified. | -| VSCP\_CONFIG\_ERROR\_CALLOUT | disabled | Enable error callout. If VSCP stops working and enters error state, the application will be notified. | -| VSCP\_CONFIG\_BOOT\_LOADER\_SUPPORTED | disabled | Enable boot loader support. | -| VSCP\_CONFIG\_ENABLE\_DM | enabled | Enable decision matrix (standard). | -| VSCP\_CONFIG\_DM\_PAGED\_FEATURE | disabled | Enable decision matrix special paged feature. | -| VSCP\_CONFIG\_ENABLE\_DM\_EXTENSION | disabled | Enable the decision matrix extension to be able to compare to a configureable zone/sub-zone and event parameters. | -| VSCP\_CONFIG\_ENABLE\_DM\_NEXT\_GENERATION | disabled | Enable the decision matrix next generation. | -| VSCP\_CONFIG\_ENABLE\_LOOPBACK | disabled | Enable a loopback for all sent VSCP events. This feature is interesting to invoke decision matrix actions by own sent VSCP events. | -| VSCP\_CONFIG\_ENABLE\_SEGMENT\_TIME\_CALLOUT | disabled | Enable a time update callout for every received segment master heartbeat, in case the event contains a new time since epoch. | -| VSCP\_CONFIG\_PROTOCOL\_EVENT\_NOTIFICATION | disabled | Usually the core handles all protocol class events and they are not forwarded to the application. Enable this to forward the events as well. If application handles the event, the core won't handle it. Attention: Handling events which the core is waiting for can cause bad behaviour. | -| VSCP\_CONFIG\_ENABLE\_CUSTOM\_HEARTBEAT | disabled | By default a heartbeat is sent, with 0 as user data and without extended data. If you need a custom heartbeat and able to define user and extended data by yourself, enable this. | - -| Parameter | Default | Description | -| :-------: |:------: | :---------: | -| VSCP\_CONFIG\_NODE\_SEGMENT\_INIT\_TIMEOUT | 5000 | Timeout in ms for the node segment initialization. | -| VSCP\_CONFIG\_PROBE\_ACK\_TIMEOUT | 2000 | Timeout in ms for the probe acknowledge. | -| VSCP\_CONFIG\_MULTI\_MSG\_TIMEOUT | 1000 | Timeout in ms to observe multi-message handling. | -| VSCP\_CONFIG\_HEARTBEAT\_NODE\_PERIOD | 30000 | Node heartbeat period in ms (recommended 30s - 60s). | -| VSCP\_CONFIG\_DM\_PAGE |1 | Decision matrix location: First page of the decision matrix. | -| VSCP\_CONFIG\_DM\_OFFSET | 0 | Decision matrix location: Offset in the first page of the decision matrix. | -| VSCP\_CONFIG\_DM\_ROWS | 10 | Number of decision matrix rows. | -| VSCP\_CONFIG\_DM\_NG\_PAGE | 2 | Decision matrix next generation: Location in the application register space. Note that the dm ng always starts at the begin of the page! This design decision was just for simplification, nothing else. | -| VSCP\_CONFIG\_DM\_NG\_RULE\_SET\_SIZE | 80 | Decision matrix next generation: Maximum size in bytes of a rule set. | -| VSCP\_CONFIG\_LOOPBACK\_STORAGE\_NUM | 4 | Number of messages in the loopback cyclic buffer. Note, that if you want to store up to 3 events, you have to configure 4, because of the technical implementation of the cyclic buffer. | -| VSCP\_CONFIG\_START\_NODE\_PROBE\_NICKNAME | 1 | Number to start probing nickname from. | - -### Device Data +| Feature switch | Default | Description | +| ------------------------------------------------------ | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| VSCP\_CONFIG\_ENABLE\_LOGGER | disabled | Enable log functionality (CLASS1.Log). Use the macros in vscp\_logger.h to send log messages. | +| VSCP\_CONFIG\_SILENT\_NODE | disabled | Silent node configuration, which is used for e. g. RS-485 connections. This type of nodes only listen to traffic before they get initialized by a host. In this case the nickname discovery process is not started for a node when it is powered up for the first time. This type on node instead starts to listen for the CLASS1.PROTOCOL, Type=23 (GUID drop nickname-ID / reset device.) event. When this series of events is received and the GUID is the same as for the module the module starts the nickname discovery procedure as of above. | +| VSCP\_CONFIG\_HARD\_CODED\_NODE | disabled | Hard-coded node (fixed nickname id) | +| VSCP\_CONFIG\_HEARTBEAT\_SUPPORT\_SEGMENT | disabled | Enable segment controller heartbeat support for nodes. | +| VSCP\_CONFIG\_HEARTBEAT\_NODE | enabled | Enable sending node heartbeat (mandatory since 2015-09-10). | +| VSCP\_CONFIG\_IDLE\_CALLOUT | disabled | Enable idle callout. If VSCP stops working and enters idle state, the application will be notified. | +| VSCP\_CONFIG\_ERROR\_CALLOUT | disabled | Enable error callout. If VSCP stops working and enters error state, the application will be notified. | +| VSCP\_CONFIG\_BOOT\_LOADER\_SUPPORTED | disabled | Enable boot loader support. | +| VSCP\_CONFIG\_ENABLE\_DM | enabled | Enable decision matrix (standard). | +| VSCP\_CONFIG\_DM\_PAGED\_FEATURE | disabled | Enable decision matrix special paged feature. | +| VSCP\_CONFIG\_ENABLE\_DM\_EXTENSION | disabled | Enable the decision matrix extension to be able to compare to a configureable zone/sub-zone and event parameters. | +| VSCP\_CONFIG\_ENABLE\_DM\_NEXT\_GENERATION | disabled | Enable the decision matrix next generation. | +| VSCP\_CONFIG\_ENABLE\_LOOPBACK | disabled | Enable a loopback for all sent VSCP events. This feature is interesting to invoke decision matrix actions by own sent VSCP events. | +| VSCP\_CONFIG\_ENABLE\_SEGMENT\_TIME\_CALLOUT | disabled | Enable a time update callout for every received segment master heartbeat, in case the event contains a new time since epoch. | +| VSCP\_CONFIG\_PROTOCOL\_EVENT\_NOTIFICATION | disabled | Usually the core handles all protocol class events and they are not forwarded to the application. Enable this to forward the events as well. If application handles the event, the core won't handle it. Attention: Handling events which the core is waiting for can cause bad behaviour. | +| VSCP\_CONFIG\_ENABLE\_CUSTOM\_HEARTBEAT | disabled | By default a heartbeat is sent, with 0 as user data and without extended data. If you need a custom heartbeat and able to define user and extended data by yourself, enable this. | + +| Parameter | Default | Description | +| ---------------------------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| VSCP\_CONFIG\_NODE\_SEGMENT\_INIT\_TIMEOUT | 5000 | Timeout in ms for the node segment initialization. | +| VSCP\_CONFIG\_PROBE\_ACK\_TIMEOUT | 2000 | Timeout in ms for the probe acknowledge. | +| VSCP\_CONFIG\_MULTI\_MSG\_TIMEOUT | 1000 | Timeout in ms to observe multi-message handling. | +| VSCP\_CONFIG\_HEARTBEAT\_NODE\_PERIOD | 30000 | Node heartbeat period in ms (recommended 30s - 60s). | +| VSCP\_CONFIG\_DM\_PAGE | 1 | Decision matrix location: First page of the decision matrix. | +| VSCP\_CONFIG\_DM\_OFFSET | 0 | Decision matrix location: Offset in the first page of the decision matrix. | +| VSCP\_CONFIG\_DM\_ROWS | 10 | Number of decision matrix rows. | +| VSCP\_CONFIG\_DM\_NG\_PAGE | 2 | Decision matrix next generation: Location in the application register space. Note that the dm ng always starts at the begin of the page! This design decision was just for simplification, nothing else. | +| VSCP\_CONFIG\_DM\_NG\_RULE\_SET\_SIZE | 80 | Decision matrix next generation: Maximum size in bytes of a rule set. | +| VSCP\_CONFIG\_LOOPBACK\_STORAGE\_NUM | 4 | Number of messages in the loopback cyclic buffer. Note, that if you want to store up to 3 events, you have to configure 4, because of the technical implementation of the cyclic buffer. | +| VSCP\_CONFIG\_START\_NODE\_PROBE\_NICKNAME | 1 | Number to start probing nickname from. | + +#### Device Data The following device data can be enable/disable/set in the -``` + +```bash vscp_dev_data_config_overwrite.h ``` -| Feature switch | Default | Description | -| :------------: | :-----: | :---------: | -| VSCP\_DEV\_DATA\_CONFIG\_ENABLE\_FAMILY\_CODE | enabled | Enable the support of the family code. | -| VSCP\_DEV\_DATA\_CONFIG\_ENABLE\_GUID\_STORAGE\_PS | disabled | Enable this define to load the GUID from persistent storage. | -| VSCP\_DEV\_DATA\_CONFIG\_ENABLE\_GUID\_STORAGE\_EXT | disabled | Enable this define to load the GUID from external storage, e.g. from MCU GUID. | -| VSCP\_DEV\_DATA\_CONFIG\_ENABLE\_NODE\_ZONE\_STORAGE\_PS | disabled | Enable this define to load the node zone from persistent storage. | -| VSCP\_DEV\_DATA\_CONFIG\_ENABLE\_NODE\_SUB\_ZONE\_STORAGE\_PS | disabled | Enable this define to load the node sub-zone from persistent storage. | -| VSCP\_DEV\_DATA\_CONFIG\_ENABLE\_MANUFACTURER\_DEV\_ID\_STORAGE\_PS | disabled | Enable this define to load the manufacturer device id from persistent storage. | -| VSCP\_DEV\_DATA\_CONFIG\_ENABLE\_MANUFACTURER\_SUB\_DEV\_ID\_STORAGE\_PS | disabled | Enable this define to load the manufacturer sub device id from persistent storage. | -| VSCP\_DEV\_DATA\_CONFIG\_ENABLE\_MDF\_URL\_STORAGE\_PS | disabled | Enable this define to load the MDF URL from persistent storage. | -| VSCP\_DEV\_DATA\_CONFIG\_ENABLE\_STD\_DEV\_FAMILY\_CODE\_STORAGE\_PS | disabled | Enable this define to load the standard device family code from persistent storage. Note, that the feature family code has to be enabled, otherwise this define won't be considered. | -| VSCP\_DEV\_DATA\_CONFIG\_ENABLE\_STD\_DEV\_TYPE\_STORAGE\_PS | disabled | Enable this define to load the standard device type from persistent storage. Note, that the feature family code has to be enabled, otherwise this define won't be considered. | - -| Parameter | Default | Description | -| :-------: |:------: | :---------: | -| VSCP\_DEV\_DATA\_CONFIG\_NODE\_GUID | 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 | Node GUID | -| VSCP\_DEV\_DATA\_CONFIG\_NODE\_ZONE | 0xff | Node zone. Note, 0xff means all zones. | -| VSCP\_DEV\_DATA\_CONFIG\_NODE\_SUB\_ZONE | 0xff | Node sub-zone. Note, 0xff means all sub zones. | -| VSCP\_DEV\_DATA\_CONFIG\_MANUFACTURER\_ID | 0x0000 | Manufacturer id (0x0000 means unknown) | -| VSCP\_DEV\_DATA\_CONFIG\_MANUFACTURER\_DEVICE\_ID | 0x00000000 | Manufacturer device id | -| VSCP\_DEV\_DATA\_CONFIG\_MANUFACTURER\_SUB\_DEVICE\_ID | 0x00000000 | Manufacturer sub device id | -| VSCP\_DEV\_DATA\_CONFIG\_MDF\_URL | empty | MDF URL (only 32 characters are allowed!), without "http://" which is implied Note, the encoding is UTF-8! | -| VSCP\_DEV\_DATA\_CONFIG\_VERSION\_MAJOR | 0 | Major firmware version (format: major.minor.sub-minor) | -| VSCP\_DEV\_DATA\_CONFIG\_VERSION\_MINOR | 1 | Minor firmware version (format: major.minor.sub-minor) | -| VSCP\_DEV\_DATA\_CONFIG\_VERSION\_SUB\_MINOR | 0 | Sub-minor firmware version (format: major.minor.sub-minor) | -| VSCP\_DEV\_DATA\_CONFIG\_STANDARD\_DEVICE\_FAMILY\_CODE | 0x00000000 | Standard device family code. | -| VSCP\_DEV\_DATA\_CONFIG\_STANDARD\_DEVICE\_TYPE | 0x00000000 | Standard device type. | -| VSCP\_DEV\_DATA\_CONFIG\_FIRMWARE\_DEVICE\_CODE | 0x0000 | Firmware device code. | - -# VSCP L1 Bootloader - -A generic VSCP L1 bootloader: https://github.com/BlueAndi/vscp-bootloader - -# VSCP CLI Tools - -Some tools to maintain VSCP via command line interface: https://github.com/BlueAndi/vscp-cli-tools - -# Structure +| Feature switch | Default | Description | +| ---------------------------------------------------------------------------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| VSCP\_DEV\_DATA\_CONFIG\_ENABLE\_FAMILY\_CODE | enabled | Enable the support of the family code. | +| VSCP\_DEV\_DATA\_CONFIG\_ENABLE\_GUID\_STORAGE\_PS | disabled | Enable this define to load the GUID from persistent storage. | +| VSCP\_DEV\_DATA\_CONFIG\_ENABLE\_GUID\_STORAGE\_EXT | disabled | Enable this define to load the GUID from external storage, e.g. from MCU GUID. | +| VSCP\_DEV\_DATA\_CONFIG\_ENABLE\_NODE\_ZONE\_STORAGE\_PS | disabled | Enable this define to load the node zone from persistent storage. | +| VSCP\_DEV\_DATA\_CONFIG\_ENABLE\_NODE\_SUB\_ZONE\_STORAGE\_PS | disabled | Enable this define to load the node sub-zone from persistent storage. | +| VSCP\_DEV\_DATA\_CONFIG\_ENABLE\_MANUFACTURER\_DEV\_ID\_STORAGE\_PS | disabled | Enable this define to load the manufacturer device id from persistent storage. | +| VSCP\_DEV\_DATA\_CONFIG\_ENABLE\_MANUFACTURER\_SUB\_DEV\_ID\_STORAGE\_PS | disabled | Enable this define to load the manufacturer sub device id from persistent storage. | +| VSCP\_DEV\_DATA\_CONFIG\_ENABLE\_MDF\_URL\_STORAGE\_PS | disabled | Enable this define to load the MDF URL from persistent storage. | +| VSCP\_DEV\_DATA\_CONFIG\_ENABLE\_STD\_DEV\_FAMILY\_CODE\_STORAGE\_PS | disabled | Enable this define to load the standard device family code from persistent storage. Note, that the feature family code has to be enabled, otherwise this define won't be considered. | +| VSCP\_DEV\_DATA\_CONFIG\_ENABLE\_STD\_DEV\_TYPE\_STORAGE\_PS | disabled | Enable this define to load the standard device type from persistent storage. Note, that the feature family code has to be enabled, otherwise this define won't be considered. | + +| Parameter | Default | Description | +| ----------------------------------------------------------------- | --------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| VSCP\_DEV\_DATA\_CONFIG\_NODE\_GUID | 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 | Node GUID | +| VSCP\_DEV\_DATA\_CONFIG\_NODE\_ZONE | 0xff | Node zone. Note, 0xff means all zones. | +| VSCP\_DEV\_DATA\_CONFIG\_NODE\_SUB\_ZONE | 0xff | Node sub-zone. Note, 0xff means all sub zones. | +| VSCP\_DEV\_DATA\_CONFIG\_MANUFACTURER\_ID | 0x0000 | Manufacturer id (0x0000 means unknown) | +| VSCP\_DEV\_DATA\_CONFIG\_MANUFACTURER\_DEVICE\_ID | 0x00000000 | Manufacturer device id | +| VSCP\_DEV\_DATA\_CONFIG\_MANUFACTURER\_SUB\_DEVICE\_ID | 0x00000000 | Manufacturer sub device id | +| VSCP\_DEV\_DATA\_CONFIG\_MDF\_URL | empty | MDF URL (only 32 characters are allowed!), without "http://" which is implied Note, the encoding is UTF-8! | +| VSCP\_DEV\_DATA\_CONFIG\_VERSION\_MAJOR | 0 | Major firmware version (format: major.minor.sub-minor) | +| VSCP\_DEV\_DATA\_CONFIG\_VERSION\_MINOR | 1 | Minor firmware version (format: major.minor.sub-minor) | +| VSCP\_DEV\_DATA\_CONFIG\_VERSION\_SUB\_MINOR | 0 | Sub-minor firmware version (format: major.minor.sub-minor) | +| VSCP\_DEV\_DATA\_CONFIG\_STANDARD\_DEVICE\_FAMILY\_CODE | 0x00000000 | Standard device family code. | +| VSCP\_DEV\_DATA\_CONFIG\_STANDARD\_DEVICE\_TYPE | 0x00000000 | Standard device type. | +| VSCP\_DEV\_DATA\_CONFIG\_FIRMWARE\_DEVICE\_CODE | 0x0000 | Firmware device code. | + +## VSCP L1 Bootloader + +A generic VSCP L1 bootloader: [https://github.com/BlueAndi/vscp-bootloader](https://github.com/BlueAndi/vscp-bootloader) + +## VSCP CLI Tools + +Some tools to maintain VSCP via command line interface: [https://github.com/BlueAndi/vscp-cli-tools](https://github.com/BlueAndi/vscp-cli-tools) + +## Structure
 +---doc                 (Documentation)
@@ -185,7 +189,7 @@ Some tools to maintain VSCP via command line interface: https://github.com/BlueA
     \---xslt            (XML transformation processor)
 
-# Getting Started +## Getting Started This part shows you how to get the VSCP framework working in a "minimal" way: @@ -199,43 +203,47 @@ This part shows you how to get the VSCP framework working in a "minimal" way: 8. [Persistent memory](https://github.com/BlueAndi/vscp-framework/blob/master/README.md#persistent-memory) 9. [Ready to run](https://github.com/BlueAndi/vscp-framework/blob/master/README.md#ready-to-run) -## 1 Get The VSCP Framework To Your Project +### 1 Get The VSCP Framework To Your Project There are 3 possible integrations listed, there may be more of course. -### 1.1 Possibility 1: Copy it +#### 1.1 Possibility 1: Copy it 1. Copy or link the VSCP framework (./src and ./src/events) to your project. 2. Copy (!!do not link!!) all necessary template files (./templates) to your project. Recommended is a sub-directory "vscp_user". 3. Update your makefile or your project configuration. -### 1.2 Possibility 2: git submodule +#### 1.2 Possibility 2: git submodule Initial add it. -``` + +```bash git submodule add https://github.com/BlueAndi/vscp-framework ``` + Later update it. -``` + +```bash git submodule update --remote ``` -### 1.3 Possibility 3: PlatformIO +#### 1.3 Possibility 3: PlatformIO Add ```vscp-framework``` with the required version to the platformio.ini configuration. Find more informations in the [PlatformIO documentation](https://docs.platformio.org/en/latest/projectconf/section_env_library.html#lib-deps). Example: -``` + +```plain lib_deps = vscp-framework @ 2.0.0 ``` -## 2 Initialization Of The VSCP Framework +### 2 Initialization Of The VSCP Framework The VSCP framework has to be initialized, before any function is used. This is simply done by calling the function vscp\_core\_init() during start-up. -## 3 Processing Of The VSCP Framework +### 3 Processing Of The VSCP Framework The VSCP framework has to be called periodically to be able to react on incoming events. Call the process routine vscp\_core\_process() in a constant cyclic period. The period should be @@ -244,7 +252,7 @@ communication bus, the event load on the bus and etc. The process routine handle all received VSCP events. -## 4 VSCP Framework Timer +### 4 VSCP Framework Timer VSCP specifies several timing behaviour in different use cases. Therefore the framework needs some timers to achieve it. @@ -263,46 +271,48 @@ Call the timer processing routine equal or lower than 1 s. Note, that never call vscp\_process() with a lower period, than vscp\_timer\_process(). Because vscp\_process() reacts on timer timeouts and vscp\_timer\_process() decrease only the timers, but doesn't do more. -## 5 VSCP Transport Adaption +### 5 VSCP Transport Adaption Now its time to connect the VSCP framework to the communication bus. This can be done by implementing the transport adapter in the vscp\_tp\_adapter.c template file. -## 6 Control The VSCP Lamp +### 6 Control The VSCP Lamp To see that something is happen on your embedded device, next step is to control the VSCP lamp (in most cases a LED). Update the function vscp\_portable\_setLampState() in the vscp\_portable.c module. -## 7 Connect The Initialization Button +### 7 Connect The Initialization Button According to the VSCP specification, every embedded device should have a button to start the segment initialization. Hopefully you have one right now :-) and if it is pressed, call the function vscp\_core\_startNodeSegmentInit() in the vscp\_core.c module. -## 8 Persistent Memory +### 8 Persistent Memory It is important that the VSCP framework can store data in a persistent memory, e.g. an EEPROM. Implement in the vscp\_ps\_access.c module the low level access to the persistent memory. Its quite easy, because only byte access functions are used, so you have one read and one write function to adapt. -## 9 Ready To Run +### 9 Ready To Run Now the minimal sub set is done and your node hopefully starts up with a nickname discovery. Have fun! -# Typical Infrastructure +## Typical Infrastructure -![typical-infrastructure](http://www.plantuml.com/plantuml/proxy?cache=no&src=https://raw.githubusercontent.com/BlueAndi/vscp-framework/master/doc/doxfiles/vscp_typical_infrastructure.plantuml) +![typical-infrastructure](http://www.plantuml.com/plantuml/proxy?cache=no&src=https://raw.githubusercontent.com/BlueAndi/vscp-framework/main/doc/doxfiles/vscp_typical_infrastructure.plantuml) -# Issues, Ideas And Bugs +## Issues, Ideas And Bugs If you have further ideas or you found some bugs, great! Create a [issue](https://github.com/BlueAndi/vscp-framework/issues) or if you are able and willing to fix it by yourself, clone the repository and create a pull request. -# License +## License + The whole source code is published under the [MIT license](http://choosealicense.com/licenses/mit/). -# Contribution +## Contribution + Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as above, without any additional terms or conditions.