Appearance
App interfaces
include/navx/app/ holds the interfaces an app uses with the NavX firmware. They're interfaces only: data module layouts and helpers, nothing about how the firmware hooks the unit's software.
| Header | What | State |
|---|---|---|
ui_host.h | the UI host protocol: an app drawing its area inside the NavX shell | version 1, UI SDK |
ibus_ring.h | carbus's I-Bus frame ring: every frame the unit receives, read-only for apps | layout agreed; header moving in from navx-firmware |
owner.h | who has the screen and the knob (launcher, app, car functions) | version 2 coming with the firmware |
navx_app.h | one include for apps, SDK version | coming with the firmware |
Rules every interface follows
- Versioned and append-only. A magic number, a version, and the header's own size come first. A newer version adds fields at the end and never moves one. Readers check magic, version and size before using anything.
- Big-endian, 4-byte aligned, with data module sizes a multiple of 4.
- One writer per field. Rings use a head the writer advances and a tail the reader advances, so there's no locking.
The I-Bus ring
carbus publishes the frames it receives in a data module (ibus_ring):
- 64 slots, each holding a sequence number, ticks, the length and the bytes (
src len dst data… xor). - The writer fills a slot, then its sequence number, then the head.
- The reader keeps one slot clear of the head, and counts the frames it lost when it was lapped.
ibusx (the I-Bus monitor) and the NavX shell's car screens read it. Apps never send on the bus through it.