tosca-controller
The tosca-controller library crate offers a set of APIs to manage,
orchestrate, and interact with all tosca-compliant devices within a network.
A device is compliant with the tosca architecture if its firmware is built
using the tosca APIs designed for the relative microcontroller.
The core functionalities of this crate include:
- Discovering all devices within the network that are compliant with the
toscaarchitecture - Constructing and sending REST requests to
toscadevices to trigger one or more of their operations - Defining security and privacy policies to allow or block requests
- Intercepting device events by subscribing to the brokers where they are published
To optimize system resource usage, tosca-controller leverages tokio as an
asynchronous executor. This improves performance by allowing concurrent
execution of independent tasks. If the underlying machine is multi-threaded,
the performance boost is further amplified, as tasks are distributed across
multiple threads too.
Build Process
To compile this crate with the debug profile, run:
cargo build
To compile this crate with the release profile, which applies all optimizations for faster performance and reduced memory usage, run:
cargo build --release
Build Examples
The examples directory includes some examples to interact with
the tosca devices within a network. Each example is independent from another
and can be moved to a separate repository.
To build an example:
cd examples/[example directory name]
cargo build [--release]