DeterministicESPAsyncWebServer v6.27.1
Zero-allocation, bounded-execution async HTTP server for ESP32
Loading...
Searching...
No Matches
devicenet.h File Reference

DeviceNet link-adaptation codec (DETWS_ENABLE_DEVICENET) - the CAN-specific layer of "CIP over CAN". More...

#include "ServerConfig.h"

Go to the source code of this file.

Detailed Description

DeviceNet link-adaptation codec (DETWS_ENABLE_DEVICENET) - the CAN-specific layer of "CIP over CAN".

DeviceNet (ODVA) carries CIP over classic CAN. The CIP application layer (services, EPATH, data) is the same one the EtherNet/IP codec uses, so build the message body with the existing cip_* functions (DETWS_ENABLE_CIP); this module supplies the DeviceNet-specific link adaptation that is NOT part of CIP:

  • The 11-bit CAN identifier as a Message Group (1..4) + Message ID + MAC ID, per the DeviceNet identifier allocation:
    Group 1: 0 MsgID(4) SourceMAC(6) ids 0x000-0x3FF
    Group 2: 10 MAC(6) MsgID(3) ids 0x400-0x5FF
    Group 3: 11 MsgID(3) SourceMAC(6) ids 0x600-0x7BF
    Group 4: 11111 MsgID(6) ids 0x7C0-0x7EF
  • The explicit-message header octet (FRAG | XID | MAC ID).
  • The fragmentation protocol (type + modulo-64 count) and a reassembler for explicit messages longer than one 8-octet frame.

Pure and host-tested. Drive it from the ESP32 TWAI peripheral or an MCP2515 over SPI to bridge a DeviceNet segment onto Wi-Fi.

Author
Douglas Quigg (dstroy0)
Date
2026

Definition in file devicenet.h.