Skip to main content

Module gateway_network

Module gateway_network 

Source
Expand description

The C ABI for the network side of one site.

These functions wrap pamoja_gateway::network for callers that reach the SDK through the flat C boundary. A network holds the devices it admits, the sessions it has granted, and the counters it has seen, so it crosses as an opaque handle: open one on a channel plan, register the devices it should admit, hand it each packet a gateway forwarded, and release it with pamoja_gateway_network_free.

A forwarded packet turns out to be one of three things, so the answer crosses as a flat event with an outcome byte that says which: a device joined and its accept is ready to transmit, a session frame arrived and was decrypted into the caller buffer, or the frame belongs to a network this site never granted, which a gateway hears all the time and is not an error.

Where and when to answer comes back with the event, so a downlink is built for the same window the uplink opened without the caller working out any of it.

Structs§

PamojaGatewayNetwork
The network side of one site, released with pamoja_gateway_network_free.
PamojaGatewayNetworkEvent
What a forwarded packet turned out to be.
PamojaGatewayNetworkNotice
A device a relay heard and could not verify, TS011-1.0.1 section 10.7.
PamojaGatewayNetworkSlot
Where and when a downlink answers an uplink, in the concentrator’s own terms.
PamojaGatewayNetworkWindows
When and where a network answers, and at what rate.

Constants§

PAMOJA_GATEWAY_NETWORK_DATA
A session frame arrived, decrypted into the caller buffer.
PAMOJA_GATEWAY_NETWORK_FOREIGN
The frame belongs to a device this site never granted.
PAMOJA_GATEWAY_NETWORK_JOINED
A device joined, and its accept is in the event.
PAMOJA_GATEWAY_NETWORK_JOIN_DELAY_US
The delay before the window a join accept is sent in, in microseconds.
PAMOJA_GATEWAY_NETWORK_RECEIVE_DELAY_US
The delay before the first receive window, in microseconds.
PAMOJA_GATEWAY_NETWORK_RX1_DOWNSTREAM
The first receive window answers on a run of downlink channels, chosen by the uplink channel number modulo how many the run holds.
PAMOJA_GATEWAY_NETWORK_RX1_PLAN
The first receive window answers where the network’s channel plan says: on the uplink frequency in a dynamic plan, and on the downlink channel a fixed plan numbers for the uplink channel.
PAMOJA_GATEWAY_NETWORK_RX1_SAME
The first receive window answers on the frequency the uplink arrived on.

Functions§

pamoja_gateway_network_answer⚠
Builds a downlink for a device, encrypted with its session.
pamoja_gateway_network_command⚠
Builds a downlink carrying MAC commands, which is how a network configures a relay.
pamoja_gateway_network_free⚠
Releases a network.
pamoja_gateway_network_notices⚠
Takes the devices relays have reported hearing and could not verify.
pamoja_gateway_network_open⚠
Opens the network side of a site on a channel plan.
pamoja_gateway_network_register⚠
Admits a device, so a join request signed with its key is accepted.
pamoja_gateway_network_trust_command⚠
Builds the command that tells a relay to trust a device, with the key that lets it verify the device’s wake-on-radio frames, TS011-1.0.1 section 10.4.
pamoja_gateway_network_uplink⚠
Reads a packet the gateway forwarded.
pamoja_gateway_network_windows_default
Returns the windows a network answers in by default.