VitroIO SDK
Software development kit for Vitro Shard.
|
vitro-shard-sdk
is a library based on mbed-os designed for developers of vitroio
nodes firmware.
The library provides common nodes functionality and handles standard communication protocol with gateway i.e. initialization of communication and firmware upgrade.
For detailed guideline for firmware developers and examples please see firmware developers guide.
For detailed API documentation please see doc.
Simple communication over bus
The library provides classes for bus frames and CAN bus with interfaces complied with defined communication protocol. The user has not to care about formatting the frame identifier. Provided type for bus frames allows to set particular element of the frame and the abstraction layer for CAN bus allows for directly sending/receiving of such frames.
Handling predefined communication protocol
The NodeController
class hides predefined communication protocol from user. The user is not responsible for handling predefined bus frames e.g. initialization of communication with gateway, reporting firmware version etc. The NodeController
class provides appropriate methods for such operations e.g. initCommunication
, which cares about the whole process.
Firmware upgrades support
The upgrade of the firmware also belongs to predefined communication protocol. Therefore, all of the user has to do is to create NodeController
object and initialize the communication with gateway to provide support for firmware upgrades. When the new firmware is available in the flash memory, the application will be reset automatically.
Easy implementation of measurement system
The sdk
provides classes for easy construction of measurement system based on sensors chosen by the user. Developer has to implement AbstractSensorDriver
and AbstractSensorInterface
virtual classes to provide support of its sensors. Then, all to do is to create MeasurementApi
object and configure it i.e. register implemented sensors interfaces, set polling time and set handler for measurement values. The MeasurementApi
reads measurement parameters from all of registered sensors in set intervals and calls registered handler when the new values are read.
The library requires mbedOS
version 6.16.0
To the project sources should be included root directory of vitro-shard-sdk
repository.
All of library sources are placed in vitroio-sdk
directory. Therefore headers should be included in user application with vitroio-sdk
prefix. For example:
vitroio::sdk
namespace.impl
directories of modules folders should not be used in user application. Additionaly these components are also placed in impl
namespace.The sdk
is divided into functional modules. It allows to disable compilation of particular modules using .mbedignore
file. However, some modules can require another ones for internal usage. For more information see detailed documentation.
All of modules which do some real time stuff, operate on an event queue. The user can choose if an object is to use external or internal event queue. However, on both cases the internal event queue is created but it is chained into external queue or handled by internal thread respectively. Priority of internal thread and size of internal queue determines the user. For more information about event queues of mbed please see About the mbed OS event loop.
All of events that the particular object can generate are handled by callbacks registered by the user.
Typical cooperation of objects is presented in below scheme:
Since 1.2.1 version it is possible to build closed-source Vitro Shard SDK as static library.
Make sure to run git submodule update --init --recursive
before building Build using ./docker_build_lib.sh
script. Output library and header files will be available in Vitro-SDK-Lib
directory.
If you've made manual changes to the sdk code and compiled it, but aren't seeing your changes, try to copy the compiled product like this:
libvitro-shard-sdkx.y.z.a
and shard-sdk.h
to your desired location.Vitro-SDK-Lib/vitroio-sdk
folder, copy the vitroio-sdk
folder directly from the vitro-shard-sdk
repo.Copy static library and header files from Vitro-SDK-Lib
to directory with source code of your project.
NOTE: There is a few differences in SDK older than 2.0.0. Change branch to
see old guides
mbed.h
has to be included before shard-sdk.h
.User application should contain object of type BufferedSerial
named pc
and console override handler defined simmiliar to this:
This serial port is used for application console.
To release the SDK from private repo to the public - take the following steps:
Warning!! Make sure no sensitive information is provided in the release notes or changelog. These changes will be copied over to public CHANGELOG.md repo.
4. Merge to master (private repository)Remeber to update SDK verison here
Pushing the tag will trigger the CI/CD pipeline.
The pipeline will compile the library, generate docs and push the changes to public repository on cicd-from-private
branch.
cicd-from-private
branch.