Skip to main content

Module lorawan_mac

Module lorawan_mac 

Source
Expand description

The C ABI for the commands a LoRaWAN network and device configure each other with.

A frame carries these either in its options field, at most PAMOJA_LORAWAN_FOPTS_MAX bytes of them, or as a whole payload on port zero. A caller that has either in hand walks it here.

Every command crosses as one PamojaLorawanMacCommand, a flat record whose cid says which command it is and whose remaining fields carry whatever that command holds. The rest read as zero. A command means a different thing in each direction, so the direction goes in and there is no default.

A command does not carry its own length, so a reader cannot step over one it does not know. pamoja_lorawan_mac_count reports how many were read before that happened, and the bytes after it are simply not readable.

Structs§

PamojaLorawanMacCommand
One command, with the fields of whichever command it is.

Constants§

PAMOJA_LORAWAN_FOPTS_MAX
How many bytes of commands a frame can carry beside a payload.
PAMOJA_LORAWAN_MAC_MAX
The longest single command, in bytes.

Functions§

pamoja_lorawan_mac_at⚠
Reads one of the commands packed into a field.
pamoja_lorawan_mac_count⚠
Counts the commands packed into a field.
pamoja_lorawan_mac_encode⚠
Writes one command out.