Architecture

The main idea of Cocotte is to separate the business logic of the application and underlying platform. One of the goal of this design to allow to test the logic outside the embedded system.

When the embedded drivers are stable there is no need to use them to test the application code. Of course developing those drivers necessitates the hardware platform.

Cocotte also helps the user to expose the state and configuration of the application in a unified way. Be it by USB, Bluetooth, MQTT or BACnet, modbus, KNX, Cocotte provides the way to expose the data in a way that fits the transport. It does not try to shoehorn all those transport in a clunky serial port-like protocol.

Modeling configuration and state

As a general principle, Cocotte wants to avoid to be able to represent an illegal state. It leverages the Rust type system to enforce this. This might feel a bit restrictive at first but we believe it saves a lot of debugging session in the long run.

Exposing configuration and state

Updating configuration

Cocotte aims to provide an atomic way to update a configuration. Transactions are important when changing multiple values of the state at the same time.

Bluetooth Low Engergy (BLE)

USB HID

MQTT