Skip to main content

Module gateway

Module gateway 

Source
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§

PamojaGatewayPacket
An opaque handle to one datagram of the protocol.
PamojaGatewayRxpk
A packet the gateway heard, without its payload, which crosses beside it.
PamojaGatewayStat
A gateway’s own status report.
PamojaGatewayTxpk
A packet the server asks the gateway to transmit, without its payload.
PamojaGatewayUplink
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.