How 107-systems/107-arduino-cyphal works
107-Arduino-Cyphal is an embedded C++ implementation of Cyphal v1 over CAN, built on libcanard. An application constructs a Node with a clock and CAN transmit callback, creates publishers, subscriptions, or service endpoints, supplies received CAN frames, and calls spinSome() to process protocol work. The library serializes generated DSDL types, exchanges transfers, and invokes application callbacks; it also provides node information, port-list publication, and persistent register storage. Connections among unsampled implementation details are omitted unless supported by the README or source index.
Main entry points: Node.cpp Cyphal Node · types Generated DSDL types · register_storage.hpp Register persistence · Publisher.hpp Publisher
Components 17
Application API
- Publisher
src/Publisher.hpp - Subscription
src/Subscription.hpp - Service client
src/ServiceClient.hpp - Service server
src/ServiceServer.hpp
Node and transport
- Cyphal Node
src/Node.cpp - CAN protocol engine
src/libcanard/canard.c - Real-time heap
src/libo1heap/o1heap.c - CAN receive queue
src/CanRxQueueItem.hpp
Node services
- Node information
src/util/nodeinfo/NodeInfo.hpp - Port-list publisher
src/util/port/PortListPublisher.hpp - Register registry
src/util/registry/registry_impl.hpp - Key-value storage
src/util/storage/KeyValueStorage.hpp - Register persistence
src/util/storage/register_storage.hpp
Protocol data
- Generated DSDL types
src/types - Serialization support
src/nunavut/support/serialization.hpp
Other components
- Application
- CAN interface
Connections 26
- Application → Cyphal Node: configures
README.md - Application → Publisher: creates
README.md - Application → Subscription: creates
README.md - Application → Service client: creates
README.md - Application → Service server: creates
README.md - Application → Cyphal Node: spins
README.md - Cyphal Node → CAN protocol engine: processes transfers
- Cyphal Node → Real-time heap: allocates through
- CAN interface → Cyphal Node: supplies frames
README.md - Cyphal Node → CAN interface: transmits frames
README.md - Cyphal Node → Publisher: creates
README.md - Cyphal Node → Subscription: creates
- Cyphal Node → Service client: creates
- Cyphal Node → Service server: creates
- Publisher → Generated DSDL types: publishes type
README.md - Subscription → Generated DSDL types: receives type
README.md - Service client → Generated DSDL types: requests type
README.md - Service server → Generated DSDL types: handles type
README.md - Cyphal Node → Node information: creates
src/Node.cpp - Cyphal Node → Register registry: creates
src/Node.cpp - Cyphal Node → Port-list publisher: processes
src/Node.cpp - Port-list publisher → Cyphal Node: creates publisher
src/util/port/PortListPublisher.hpp - Register persistence → Register registry: loads and saves
src/util/storage/register_storage.hpp - Register persistence → Key-value storage: reads and writes
src/util/storage/register_storage.hpp - Register persistence → Generated DSDL types: serializes values
src/util/storage/register_storage.hpp - Serialization support → Generated DSDL types: encodes types