OSAP SPEC

Packet Structure (as in OSAP)

         
PTR:1 PHTTL:2 MSEGSIZE:2 ROUTE:N PAYLOAD:N
  • PTR: pointer to the packet’s current instruction, so the pattern is pck[pck[0]] ==INSTRUCTION_KEY
  • PHTTL: how many ms the packet can hang in each device before being deleted. Due to scheduling algo, this is effectively a priority as well.
  • MSEGSIZE: the maximum segment size possible to transmit along this route.
  • ROUTE: see below
  • PAYLOAD: any # of bytes

Routes

Routes are encoded as a series of instructions in the packet. Instructions behind the PTR encode the path back to the packet’s source, and instructions in front of the PTR encode the path forwards.

KEY NUM INSTRCT
TKEY_LINKF 12 FWD Packet on ARG1 Port
TKEY_BUSF 14 FWD Packet on ARG1 Link, to ARG2 Address
TKEY_PORTPACK 33 Packet is destined for port at ARG2, originated at port ARG1

System Messages

Runtime Info Collection

Runtime Info Request
B0B1B2B3B4B5
MSG_KEYMSG_IDSweep Session ID
101uint8_tuint32_t
Runtime Info Response
B0B1B2B3B4 B5B6B7B8B9 B10B11B12B13B14 B15B16B17B18B19B20
MSG_KEYMSG_ID Prev. Sweep Session IDRT_TYPEVERSION Entry Route Port Count Gateway Count Bus Count
102uint8_t uint32_tKEYMajorMidMinor Disambiguation of Entry...? uint16_t uint16_t uint16_t

Port Info Collection

We need to collect information on system ports, in this case we are getting a type key for each.

Port Info Request
B0B1B2B3B4B5
MSG_KEYMSG_IDQuery Start IndexQuery End Index
103uint8_tuint16_tuint16_t

Ports can be null’d out, i.e. we can have holes in our list…

Port Info Request
B0B1B2...BN
MSG_KEYMSG_IDPTYPEKEY @ Start Index...PTYPEKEY @ End Index
104uint8_tKEY...KEY

… overall, I think the redux should simplify this kind of thing; let’s just grep one port per message: name and type, or a “null” … then we can do link-layer stuffing of multiple packets per frame - it should save some flash. It also makes the spec easier to describe, which is a valid metric.

Gateway Info Collection

Link Info Request
B0B1B2B3B4B5
MSG_KEYMSG_IDQuery Start IndexQuery End Index
105uint8_tuint16_tuint16_t
Bus Info Request
B0B1B2B3...BN-1BN
MSG_KEYMSG_IDLTYPEKEY @ Start IndexState...LTYPEKEY @ End IndexState
106uint8_tKEY1/0 Open / Closed...KEY1/0 Open / Closed