Skip to main content

Module lorawan

Module lorawan 

Source
Expand description

The C ABI for LoRaWAN 1.0.x MAC framing.

These functions wrap [pamoja_lorawan] for callers that reach the SDK through the flat C boundary: the secured frame a long-range node puts on the air, and the over-the-air activation that hands it its session keys.

A session and a device hold key material, so they cross as opaque handles and the keys never leave the library once set. An encoded frame comes back as a PamojaBuffer, and a decoded one as a handle carrying its recovered payload. The header flags a sender chooses are only scalars, so they cross by value as PamojaLorawanFlags.

Structs§

PamojaLorawanDevice
An opaque handle to the root credentials of a device.
PamojaLorawanFlags
The header flags a sender sets on a data frame.
PamojaLorawanGrant
What a network grants a device that joined.
PamojaLorawanHeader
What a frame says about itself before any key is involved.
PamojaLorawanJoinAccept
An opaque handle to an accepted join.
PamojaLorawanJoinRequest
An opaque handle to a verified join-request.
PamojaLorawanRx
An opaque handle to a decoded data frame.
PamojaLorawanSession
An opaque handle to an activated LoRaWAN session.

Enums§

PamojaLorawanDirection
The direction a frame traveled, which its MIC and encryption both fold in.
PamojaLorawanMessageType
What kind of message a frame is, read from its header.

Constants§

PAMOJA_LORAWAN_EUI_LEN
The length of a LoRaWAN EUI, in bytes.
PAMOJA_LORAWAN_FRAME_MAX
The largest LoRaWAN frame, in bytes, this build accepts.
PAMOJA_LORAWAN_KEY_LEN
The length of a LoRaWAN key, in bytes.
PAMOJA_LORAWAN_PAYLOAD_MAX
The largest application payload, in bytes, a single frame can carry.

Functions§

pamoja_lorawan_device_accept_join⚠
Turns the join accept a network sent into the settings it grants.
pamoja_lorawan_device_dev_eui⚠
Copies the device EUI a device was created with.
pamoja_lorawan_device_free⚠
Releases a device handle.
pamoja_lorawan_device_join_request⚠
Builds the join request a device broadcasts to activate.
pamoja_lorawan_device_new⚠
Creates a device from the root credentials over-the-air activation uses.
pamoja_lorawan_grant_accept⚠
Builds the signed join-accept a network sends to admit a device.
pamoja_lorawan_grant_session⚠
Derives the session a grant activates, the same one the device computes.
pamoja_lorawan_header_parse⚠
Reads a frame far enough to route it, without any key.
pamoja_lorawan_join_accept_cflist⚠
Copies the channel list a join accept carried.
pamoja_lorawan_join_accept_dev_addr⚠
Returns the device address a join grants.
pamoja_lorawan_join_accept_dl_settings⚠
Returns the downlink settings byte a join grants.
pamoja_lorawan_join_accept_free⚠
Releases an accepted join handle.
pamoja_lorawan_join_accept_net_id⚠
Returns the identifier of the network that accepted a join.
pamoja_lorawan_join_accept_receive_delay_us⚠
Returns the delay from the end of an uplink to the first receive window.
pamoja_lorawan_join_accept_rx1_dr_offset⚠
Returns how far below the uplink’s data rate the first receive window listens.
pamoja_lorawan_join_accept_rx2_data_rate⚠
Returns the data rate the second receive window listens at.
pamoja_lorawan_join_accept_rx_delay⚠
Returns the delay before the first receive window, in seconds.
pamoja_lorawan_join_accept_session⚠
Takes the activated session a join grants.
pamoja_lorawan_join_request_app_eui⚠
Copies the application identifier out of a verified join-request.
pamoja_lorawan_join_request_dev_eui⚠
Copies the device identifier out of a verified join-request.
pamoja_lorawan_join_request_dev_nonce⚠
Returns the nonce a verified join-request carried.
pamoja_lorawan_join_request_free⚠
Releases a verified join-request handle.
pamoja_lorawan_join_request_parse⚠
Verifies a join-request and reads the identifiers out of it.
pamoja_lorawan_rx_ack⚠
Reports whether a decoded frame acknowledges the last confirmed one.
pamoja_lorawan_rx_adr⚠
Reports whether a decoded frame takes part in adaptive data rate.
pamoja_lorawan_rx_adr_ack_req⚠
Reports whether a decoded uplink asks the network to answer.
pamoja_lorawan_rx_class_b⚠
Reports whether a decoded uplink came from a device running Class B.
pamoja_lorawan_rx_confirmed⚠
Reports whether a decoded frame asks to be acknowledged.
pamoja_lorawan_rx_dev_addr⚠
Returns the device address a decoded frame carries.
pamoja_lorawan_rx_direction⚠
Returns the direction a decoded frame traveled.
pamoja_lorawan_rx_fcnt⚠
Returns the low 16 bits of the frame counter a decoded frame carries.
pamoja_lorawan_rx_fopts⚠
Returns a pointer to the frame options a decoded frame carries.
pamoja_lorawan_rx_fopts_len⚠
Returns the length in bytes of the frame options a decoded frame carries.
pamoja_lorawan_rx_fpending⚠
Reports whether the network has more downlink data waiting.
pamoja_lorawan_rx_fport⚠
Returns the port a decoded frame was sent on.
pamoja_lorawan_rx_free⚠
Releases a decoded frame handle.
pamoja_lorawan_rx_payload⚠
Returns a pointer to the decrypted payload of a decoded frame.
pamoja_lorawan_rx_payload_len⚠
Returns the length in bytes of the decrypted payload of a decoded frame.
pamoja_lorawan_session_decode⚠
Decodes a received data frame: verifies the MIC, then decrypts the payload.
pamoja_lorawan_session_dev_addr⚠
Returns the device address a session is bound to.
pamoja_lorawan_session_encode_downlink⚠
Encodes a downlink data frame, encrypting the payload and appending the MIC.
pamoja_lorawan_session_encode_uplink⚠
Encodes an uplink data frame, encrypting the payload and appending the MIC.
pamoja_lorawan_session_free⚠
Releases a session handle.
pamoja_lorawan_session_new⚠
Creates a session from a device address and its two session keys.