This repository contains skeleton code for a Xentara data uplink with the following features:
Connection based | Batch processing |
---|---|
YES | YES |
This skill template requires the Xentara development environment, as well as a Xentara licence. You can get a Xentara licence in the Xentara Online Shop.
The documentation for Xentara can be found at https://docs.xentara.io/xentara.
This skill template uses the Xentara Utility Library, as well as the Xentara Plugin Framework. The corresponding documentation can be found here:
https://docs.xentara.io/xentara-utils/
https://docs.xentara.io/xentara-plugin/
The repository include a CMakeLists.txt file for use with CMake, which allows you to build the source code out of the box, as long as the Xentara development environment is installed. If you whish to use a different build system, you must generate the necessary build configuration file yourself.
The source code in this repository is documented using Doxygen comments. If you have Doxygen installed, you can generate detailed documentation for all classes, functions etc., including a TODO list. To generate the documentation using CMake, just build the target docs by executing the following command in your build directory:
cmake --build . --target docs
This will generate HTML documentation in the subdirectory docs/html.
(See Skill Elements in the Xentara documentation)
src/TemplateClient.hpp
src/TemplateClient.cpp
The client skill element template provides template code for services that may be connected and disconnected while Xentara is running. For such service, Xentara will periodically try to reestablish communication to the service instance if it is disconnected.
The template code has the following features:
- The connection to the service instance is established during the pre-operational stage, and closed during the post-operational stage.
- The skill element tracks an error code for the communication with the service instance. If communication breaks down, this error code is pushed to the transactions.
- The skill element publishes a Xentara task called reconnect, that checks the connection to the service instance, and attempts to reconnect if the communication has broken down.
- The skill element publishes two Xentara events called connected and disconnected, that are raised when the connection to the service instance is establed or lost.
src/TemplateTransaction.hpp
src/TemplateTransaction.cpp
The transaction skill element template provides template code for transactions that accumulate data over a period of time, and only send it to the service instance at greater intervals.
The template code has the following features:
- The skill element publishes a Xentara task called collect, which collect a set of records and buffers it for future sending.
- The skill element publishes a Xentara task called send, which sends the collected records to the service instance.
- The send task can be executed at greater intervals than the collect task, to collect multiple sets of records and send them to the service instance using a single transaction
- The skill element publishes Xentara events to signal when a transaction was sent, or if a send error occurred.
- If a communication breakdown is detected when sending the records, the client element is notified, and all other transactions are set to the same error state.
- No communication with the service instance is attempted if the connection is not up.