Skip to content

drv/frame: add mari-compatible header for bare-radio apps#21

Merged
geonnave merged 3 commits into
DotBots:developfrom
geonnave:bare-apps-frame
May 28, 2026
Merged

drv/frame: add mari-compatible header for bare-radio apps#21
geonnave merged 3 commits into
DotBots:developfrom
geonnave:bare-apps-frame

Conversation

@geonnave

Copy link
Copy Markdown
Contributor

Adds drv/frame.h — a 21-byte wire-header struct that's a byte-for-byte
mirror of Mari's mr_packet_header_t, plus the constants bare-radio DotBot
apps need to populate it: version = 3, type = DATA, next_proto = DOTBOT_APP, network_id = 0xD0B0, BLE access address 0xDB12DB12.

The intent: once bare-radio apps adopt this header, a bare-radio gateway
can wrap received frames as MARI_EDGE_DATA UART events and PyDotBot's
MarilibEdge adapter (which now dispatches by next_proto) handles them
with no special case. One frame vocabulary on the host whether the bytes
came from Mari TSCH or from a bare-radio app. Coexistence on air is
handled by the distinct access address — Mari's 0x12345678 vs bare's
0xDB12DB12 — so the two stacks ignore each other at the radio peripheral
filter, not in software.

Worth a second look:

  • Numeric values are pinned against Mari's enum: type = 16
    MARI_PACKET_DATA, next_proto = 0x11MARI_NEXT_PROTO_DOTBOT_APP,
    version = 3MARI_PROTOCOL_VERSION. A _Static_assert(sizeof == 21) catches layout drift loudly.
  • type and next_proto are stored as uint8_t, not the Mari enum
    types, so the layout doesn't depend on -fshort-enums ABI choices.
  • network_id = 0xD0B0 needs to be reserved on the Crystalfree Mari
    network-ID registry before any real deployment uses it.

No consumer in this repo yet — DotBot-firmware bare-radio apps will
migrate from drv/tdma_client to this header in a follow-up PR. Build is
unchanged on every existing target; clang-format clean.

@geonnave geonnave merged commit 04791f3 into DotBots:develop May 28, 2026
16 checks passed
@geonnave geonnave deleted the bare-apps-frame branch May 28, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant