|
ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
|
CANopen (CiA 301) application-layer message codec (PC_ENABLE_CANOPEN). More...
#include "protocore_config.h"Go to the source code of this file.
CANopen (CiA 301) application-layer message codec (PC_ENABLE_CANOPEN).
A pure, zero-heap builder + parser for the CANopen messaging set carried over classic CAN frames (see shared_primitives/can.h): NMT node control, SYNC, TIME, the heartbeat / boot-up (NMT error control), EMCY, PDO (process data), and expedited SDO (service data object) read / write / abort. The 11-bit CAN identifier is a 4-bit function code plus a 7-bit node id; each builder computes the right COB-ID and each parser classifies a received frame back to its function + node.
Scope: the CANopen object dictionary itself is the application's; this is the wire codec. SDO transfers cover expedited (<= 4 octets) and segmented (CiA 301 ยง7.2.4.3, larger objects via a toggling run of 7-octet segments); block SDO is not covered.
Bridging: pair with the ESP32's TWAI peripheral (or an MCP2515 over SPI) to bridge a CANopen field bus onto Wi-Fi - expose node state / PDOs over HTTP, MQTT, or a WebSocket.
Definition in file canopen.h.