Expand description
The C ABI for a LoRaWAN relay, TS011-1.0.1: the wake-on-radio frames an end device and a relay exchange, the uplinks a relay forwards, and the timing that keeps a wake-on-radio preamble short.
Everything here is a pure function of its arguments. Keys cross as a
PamojaLorawanWorKeys of two sixteen-byte arrays, carriers and states as small structs,
and frames as fixed-length arrays written in place, except a forwarded uplink, whose
length follows the end device’s frame and crosses as a buffer.
Structs§
- Pamoja
Lorawan Carrier - Where a frame goes and how fast.
- Pamoja
Lorawan State Sync - What a relay tells an end device about itself in a WOR ACK, as TS011-1.0.1 table 14 codes each field.
- Pamoja
Lorawan Synchronization - What an end device knows of a relay’s scans once a WOR ACK has arrived.
- Pamoja
Lorawan Uplink Metadata - What a relay heard of an uplink it forwards.
- Pamoja
Lorawan Wor - A wake-on-radio frame, as a relay reads it.
- Pamoja
Lorawan WorKeys - The integrity and encryption keys of one end device’s wake-on-radio frames.
- Pamoja
Lorawan WorSlot - When a synchronized end device’s next WOR frame goes out.
Constants§
- PAMOJA_
LORAWAN_ FORWARD_ OVERHEAD - The bytes a forwarded uplink adds in front of the end device’s frame.
- PAMOJA_
LORAWAN_ LA_ FPORT_ RELAY - The port every message between a relay and its network uses.
- PAMOJA_
LORAWAN_ MIN_ WOR_ PREAMBLE_ SYMBOLS - The shortest WOR preamble, in symbols.
- PAMOJA_
LORAWAN_ RELAY_ FWD_ DELAY_ US - The gap between a relay hearing an uplink and forwarding it.
- PAMOJA_
LORAWAN_ RXR_ DELAY_ US - How long after an uplink an end device’s RXR window opens at the latest.
- PAMOJA_
LORAWAN_ TRUSTED_ ED_ NUMBER - How many end devices a relay verifies wake-on-radio frames for.
- PAMOJA_
LORAWAN_ WOR_ ACK_ DELAY_ US - The gap between a WOR frame and its acknowledgment.
- PAMOJA_
LORAWAN_ WOR_ ACK_ LEN - The length of a WOR ACK.
- PAMOJA_
LORAWAN_ WOR_ ATTEMPTS_ WO_ ACK - How many WOR frames go without an acknowledgment before the uplink goes anyway.
- PAMOJA_
LORAWAN_ WOR_ DATA_ DELAY_ US - The gap between a WOR frame, or its acknowledgment, and the LoRaWAN frame after it.
- PAMOJA_
LORAWAN_ WOR_ JOIN_ REQUEST - A WOR frame ahead of a join request.
- PAMOJA_
LORAWAN_ WOR_ JOIN_ REQUEST_ LEN - The length of a WOR frame ahead of a join request.
- PAMOJA_
LORAWAN_ WOR_ UPLINK - A WOR frame ahead of a Class A uplink.
- PAMOJA_
LORAWAN_ WOR_ UPLINK_ LEN - The length of a WOR frame ahead of a Class A uplink.
Functions§
- pamoja_
lorawan_ ⚠relay_ forward_ encode - Writes an uplink a relay forwards, TS011-1.0.1 section 9.1.
- pamoja_
lorawan_ ⚠relay_ forward_ parse - Reads an uplink a relay forwarded, TS011-1.0.1 section 9.1.
- pamoja_
lorawan_ ⚠relay_ next_ wor - Picks the relay scan a synchronized end device aims its next WOR frame at, TS011-1.0.1 appendix 1.
- pamoja_
lorawan_ ⚠relay_ root_ wor_ s_ key - Derives an end device’s root relay session key from its network session key, TS011-1.0.1 section 4.4.
- pamoja_
lorawan_ ⚠relay_ second_ channel - Reads the second channel a relay or end device configuration describes.
- pamoja_
lorawan_ ⚠relay_ synchronization - Works out when a relay scanned from the WOR ACK that answered a frame.
- pamoja_
lorawan_ ⚠relay_ t_ offset_ ms - Works out the offset a relay reports in a WOR ACK, TS011-1.0.1 appendix 1.
- pamoja_
lorawan_ ⚠relay_ unsynchronized_ preamble - Works out the WOR preamble of an end device that does not know when the relay scans, TS011-1.0.1 section 5.2.
- pamoja_
lorawan_ ⚠relay_ wor_ ack - Builds a relay’s WOR ACK, TS011-1.0.1 section 6.2.
- pamoja_
lorawan_ ⚠relay_ wor_ ack_ open - Checks and reads a WOR ACK, TS011-1.0.1 section 6.2.
- pamoja_
lorawan_ ⚠relay_ wor_ join_ request - Builds the WOR frame ahead of a join request, TS011-1.0.1 section 5.3.1.
- pamoja_
lorawan_ ⚠relay_ wor_ keys - Derives an end device’s wake-on-radio keys from its root relay session key, TS011-1.0.1 section 4.5.
- pamoja_
lorawan_ ⚠relay_ wor_ open - Checks a WOR frame ahead of a Class A uplink and reads where the uplink follows.
- pamoja_
lorawan_ ⚠relay_ wor_ parse - Reads a WOR frame.
- pamoja_
lorawan_ ⚠relay_ wor_ uplink - Builds the WOR frame ahead of a Class A uplink, TS011-1.0.1 section 5.3.2.
- pamoja_
lorawan_ ⚠session_ root_ wor_ s_ key - Returns the root relay session key of a session’s device.
- pamoja_
lorawan_ ⚠session_ wor_ keys - Returns the wake-on-radio keys of a session’s device.