Expand description
The C ABI for the LoRaWAN gateway protocols.
These functions wrap pamoja_gateway for callers that reach the SDK through the flat C
boundary: the six datagrams a gateway and a network server exchange over UDP, and the
objects they carry.
A datagram carries a payload of variable length, so a packet crosses as an opaque handle:
build one, read it with the pamoja_gateway_packet_* calls, write it with
pamoja_gateway_packet_to_buffer, and release it with pamoja_gateway_packet_free.
The packets a PUSH_DATA forwards are collected in an uplink handle first, since there may
be any number of them.
Times cross as counts rather than as the strings the protocol writes: a reception in microseconds since the Unix epoch and a gateway’s clock in seconds, each with a flag that says whether the datagram carried one at all.
Structs§
- Pamoja
Gateway Packet - An opaque handle to one datagram of the protocol.
- Pamoja
Gateway Rxpk - A packet the gateway heard, without its payload, which crosses beside it.
- Pamoja
Gateway Stat - A gateway’s own status report.
- Pamoja
Gateway Txpk - A packet the server asks the gateway to transmit, without its payload.
- Pamoja
Gateway Uplink - An opaque handle to what a PUSH_DATA carries: the packets heard, and the report.
Constants§
- PAMOJA_
GATEWAY_ CRC_ ABSENT - The packet carried no CRC.
- PAMOJA_
GATEWAY_ CRC_ FAILED - The CRC failed.
- PAMOJA_
GATEWAY_ CRC_ OK - The CRC checked.
- PAMOJA_
GATEWAY_ EUI_ LEN - The length of a gateway’s unique identifier.
- PAMOJA_
GATEWAY_ MODULATION_ FSK - An FSK packet, whose bitrate is in
bitrate_bps. - PAMOJA_
GATEWAY_ MODULATION_ LORA - A LoRa packet, whose settings are in the link.
- PAMOJA_
GATEWAY_ PROTOCOL_ VERSION - The protocol version every datagram starts with.
- PAMOJA_
GATEWAY_ PULL_ ACK - The server acknowledging a PULL_DATA.
- PAMOJA_
GATEWAY_ PULL_ DATA - The gateway holding its route open.
- PAMOJA_
GATEWAY_ PULL_ RESP - The server sending a packet to transmit.
- PAMOJA_
GATEWAY_ PUSH_ ACK - The server acknowledging a PUSH_DATA.
- PAMOJA_
GATEWAY_ PUSH_ DATA - The gateway forwarding what it heard.
- PAMOJA_
GATEWAY_ TX_ ACK - The gateway reporting what became of a PULL_RESP.
- PAMOJA_
GATEWAY_ TX_ COLLISION_ BEACON - A beacon was already scheduled then.
- PAMOJA_
GATEWAY_ TX_ COLLISION_ PACKET - Another packet was already scheduled then.
- PAMOJA_
GATEWAY_ TX_ FREQ - The radio chain cannot reach that frequency.
- PAMOJA_
GATEWAY_ TX_ GPS_ UNLOCKED - A GPS timestamp was asked for while the GPS is unlocked.
- PAMOJA_
GATEWAY_ TX_ NONE - The downlink was scheduled, which the protocol writes as
NONE. - PAMOJA_
GATEWAY_ TX_ POWER - The gateway cannot transmit at that power.
- PAMOJA_
GATEWAY_ TX_ TOO_ EARLY - Its timestamp is too far ahead.
- PAMOJA_
GATEWAY_ TX_ TOO_ LATE - It arrived too late to schedule.
Functions§
- pamoja_
gateway_ ⚠packet_ acknowledgment - Builds the acknowledgment a server owes a datagram.
- pamoja_
gateway_ ⚠packet_ free - Releases a packet.
- pamoja_
gateway_ ⚠packet_ gateway - Writes the gateway’s identifier, for the datagrams that carry one.
- pamoja_
gateway_ ⚠packet_ kind - Returns which kind of datagram a packet is.
- pamoja_
gateway_ ⚠packet_ parse - Reads a datagram.
- pamoja_
gateway_ ⚠packet_ rxpk - Reads one of the packets a PUSH_DATA forwards.
- pamoja_
gateway_ ⚠packet_ rxpk_ count - Returns how many packets a PUSH_DATA forwards.
- pamoja_
gateway_ ⚠packet_ rxpk_ payload - Returns a pointer to one forwarded packet’s payload.
- pamoja_
gateway_ ⚠packet_ rxpk_ payload_ len - Returns the length of one forwarded packet’s payload.
- pamoja_
gateway_ ⚠packet_ stat - Reads the gateway’s status report, when a PUSH_DATA carries one.
- pamoja_
gateway_ ⚠packet_ to_ buffer - Writes a packet as the datagram to send.
- pamoja_
gateway_ ⚠packet_ token - Returns a packet’s token, which pairs it with its answer.
- pamoja_
gateway_ ⚠packet_ tx_ status - Returns what a TX_ACK reports.
- pamoja_
gateway_ ⚠packet_ txpk - Reads what a PULL_RESP asks the gateway to transmit.
- pamoja_
gateway_ ⚠packet_ txpk_ payload - Returns a pointer to the payload a PULL_RESP carries.
- pamoja_
gateway_ ⚠packet_ txpk_ payload_ len - Returns the length of the payload a PULL_RESP carries.
- pamoja_
gateway_ pull_ ack - Builds the PULL_ACK that answers a PULL_DATA.
- pamoja_
gateway_ ⚠pull_ data - Builds the PULL_DATA that holds a route open.
- pamoja_
gateway_ ⚠pull_ resp - Builds the PULL_RESP that asks a gateway to transmit.
- pamoja_
gateway_ push_ ack - Builds the PUSH_ACK that answers a PUSH_DATA.
- pamoja_
gateway_ ⚠push_ data - Builds the PUSH_DATA that forwards an uplink.
- pamoja_
gateway_ ⚠tx_ ack - Builds the TX_ACK that reports what became of a PULL_RESP.
- pamoja_
gateway_ ⚠uplink_ add_ rxpk - Adds a packet the gateway heard.
- pamoja_
gateway_ ⚠uplink_ free - Releases an uplink that will not be sent.
- pamoja_
gateway_ uplink_ new - Creates an empty uplink for a PUSH_DATA to carry.
- pamoja_
gateway_ ⚠uplink_ set_ stat - Sets the gateway’s status report on an uplink.