ctrlX Data Layer Provider¶
The app demonstrates how a ctrlX Data Layer connection is established and a string and flatbuffers node are provided.
The app connects to the ctrlX Data Layer and provides a string and flatbuffers node .
If the ctrlX Data Layer connection breaks the app will exit. After 10s it will be automatically restarted by snapd.
This sample uses a flatbuffers node defined in sampleSchema.fbs and metadata information defined in metadata.csv.
For easy of use the project contains the according compiled files:
- sampleSchema.fbs: ./bfbs/sampleSchema.bfbs, ./schema/InertialValue.py
- metadata.csv: ./mddb/metadata.mddb
With these compilation files the project can instantly debugged or snaps can be build.
If changes have been made to the definition files, the compiles must be regenerated. This is done by the script make-bfbs-mddb.sh.
The script can be called from the console:
It can also be called from Visual Studio Code:
Main menu -> Terminal --> Run Task... --> make bfbs mddb
- sampleSchema.fbs: Defines a flatbuffers value (structed value). If changed compile it - see above.
- metadata.csv: Defines metadata for the provided ctrlX Data Layer nodes. If changed compile it - see above.
- metadata.mddb: Compiled information of metadata.csv.
- The module main.py manages the ctrlX Data Layer connection and the creation of the ctrlX Data Layer nodes.
- The module helper/ctrlx_datalayer_helper.py Provides methods to easily establish a ctrlX Data Layer connection.
- The module app/my_provider_node.py contains the class MyProviderNode with the callback function needed by the ctrlX Data Layer.
- The module sample/schema/InertialValue.py is generated by flatc from sampleSchema.fbs. It is used to manage the flatbuffers data struct.
SPDX-FileCopyrightText: Bosch Rexroth AG SPDX-License-Identifier: MIT