tosca-controller 0.1.0

A library for building a controller that manages all Tosca devices across a network.
Documentation

tosca-controller

LICENSE

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 tosca architecture
  • Constructing and sending REST requests to tosca devices 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]