Skip to main content

Module gateway_station

Module gateway_station 

Source
Expand description

The C ABI for the LoRa Basics Station protocol.

These functions wrap pamoja_gateway::station for callers that reach the SDK through the flat C boundary. A station and its network server exchange JSON messages over a websocket the caller owns, so nothing here opens a socket: a message crosses as an opaque handle, built from a frame the radio heard, read from text that arrived, or built from its fields, and written back out as the text to send.

A handle is used rather than one flat struct because the messages differ too much to share one shape: a configuration carries a table of data rates and a schedule carries a list of frames, while a join request carries eight fixed fields. PamojaGatewayStationFields holds every fixed field of every kind, and the calls below add and read the text, the bytes and the lists a kind carries besides.

To build a message, fill the fields of its kind, call pamoja_gateway_station_message_new, then add its text, bytes and entries. To read one, take its fields with pamoja_gateway_station_message_fields, then read whichever text, bytes and entries the counts there say it carries.

Structs§

PamojaGatewayStationBroadcast
One frame of a schedule, apart from its bytes.
PamojaGatewayStationDataRate
One number of a configuration’s data-rate table.
PamojaGatewayStationFields
Every fixed field a message carries, for any kind.
PamojaGatewayStationJoinRange
A range of join identifiers whose join requests a station forwards, both ends included.
PamojaGatewayStationLevels
How a station heard a packet, as it reports it.
PamojaGatewayStationMessage
A message either side of a session sends.
PamojaGatewayStationRouterIds
The identities a discovery answer names.
PamojaGatewayStationWindow
A receive window, or the ping slot of a class B downlink: a data rate and a frequency.
PamojaGatewayStationXtime
A station clock value taken apart.

Constants§

PAMOJA_GATEWAY_STATION_DOWNLINK
A frame the server asks the station to transmit.
PAMOJA_GATEWAY_STATION_JOIN_REQUEST
A join request the station heard.
PAMOJA_GATEWAY_STATION_OTHER
A kind this build does not model, readable only as its text.
PAMOJA_GATEWAY_STATION_PROPRIETARY
A frame of a kind this protocol does not describe, carried whole.
PAMOJA_GATEWAY_STATION_PROTOCOL_VERSION
The protocol version a station reports.
PAMOJA_GATEWAY_STATION_ROUTER_CONFIG
How the server tells the station to configure its radios.
PAMOJA_GATEWAY_STATION_SCHEDULE
Frames the server asks the station to transmit to a group.
PAMOJA_GATEWAY_STATION_TEXT_FEATURES
What a version says the station can do, such as gps.
PAMOJA_GATEWAY_STATION_TEXT_FIRMWARE
The firmware a version reports.
PAMOJA_GATEWAY_STATION_TEXT_HWSPEC
The concentrator a configuration is written for, such as sx1301/1.
PAMOJA_GATEWAY_STATION_TEXT_MODEL
The hardware model a version reports.
PAMOJA_GATEWAY_STATION_TEXT_MSGTYPE
The word a message calls itself on the wire, which is what names a kind this build does not model.
PAMOJA_GATEWAY_STATION_TEXT_PACKAGE
The package a version reports.
PAMOJA_GATEWAY_STATION_TEXT_REGION
The region a configuration names, such as EU868.
PAMOJA_GATEWAY_STATION_TEXT_STATION
The station software a version reports.
PAMOJA_GATEWAY_STATION_TIME_SYNC
The clock the two keep between them.
PAMOJA_GATEWAY_STATION_TRANSMITTED
What became of a frame the station was asked to transmit.
PAMOJA_GATEWAY_STATION_UPLINK
A data frame the station heard.
PAMOJA_GATEWAY_STATION_VERSION
What the station reports about itself when a session opens.

Functions§

pamoja_gateway_station_discovery⚠
Writes the request a station sends to find its network server.
pamoja_gateway_station_discovery_parse⚠
Reads the request a station sent to find its network server, as the server does.
pamoja_gateway_station_eui_of⚠
Reads an identifier written in any form the protocol accepts.
pamoja_gateway_station_heard⚠
Reads a frame the radio heard into the message that reports it.
pamoja_gateway_station_id6⚠
Writes an identifier in the ID6 form the protocol prefers.
pamoja_gateway_station_message_add_broadcast⚠
Adds a frame to a schedule.
pamoja_gateway_station_message_add_data_rate⚠
Adds the next number of a configuration’s data-rate table.
pamoja_gateway_station_message_add_join_range⚠
Adds a range of join identifiers whose join requests a configuration forwards.
pamoja_gateway_station_message_add_net_id⚠
Adds a network whose data frames a configuration forwards.
pamoja_gateway_station_message_broadcast⚠
Reads one frame of a schedule.
pamoja_gateway_station_message_data_rate⚠
Reads one number of a configuration’s data-rate table.
pamoja_gateway_station_message_fields⚠
Reads the fixed fields a message carries, and how many entries each of its lists holds.
pamoja_gateway_station_message_free⚠
Releases a message.
pamoja_gateway_station_message_join_range⚠
Reads one join identifier range a configuration names.
pamoja_gateway_station_message_json⚠
Writes a message as the websocket carries it.
pamoja_gateway_station_message_kind⚠
Returns which kind a message is.
pamoja_gateway_station_message_net_id⚠
Reads one network a configuration names.
pamoja_gateway_station_message_new⚠
Builds a message of any kind from its fixed fields.
pamoja_gateway_station_message_options⚠
Returns the frame options a data frame carries.
pamoja_gateway_station_message_parse⚠
Reads a message that arrived over the websocket.
pamoja_gateway_station_message_payload⚠
Returns the bytes a message carries: the payload of a frame, or the frame to transmit.
pamoja_gateway_station_message_set_options⚠
Sets the frame options a data frame carries.
pamoja_gateway_station_message_set_payload⚠
Sets the bytes a message carries: the payload of a data frame or a proprietary frame, or the frame a downlink transmits.
pamoja_gateway_station_message_set_text⚠
Sets a piece of text a message carries.
pamoja_gateway_station_message_text⚠
Returns a piece of text a message carries.
pamoja_gateway_station_router_accepted⚠
Writes the answer that sends a station to the websocket its session runs on.
pamoja_gateway_station_router_identities⚠
Reads the identities a discovery answer names: the station, and the server endpoint that carries its session.
pamoja_gateway_station_router_parse⚠
Reads the answer a discovery endpoint gives.
pamoja_gateway_station_router_refused⚠
Writes the answer that refuses a station, saying why.
pamoja_gateway_station_xtime⚠
Builds a station clock value from the radio it was read on, the run of the station, and the microseconds that run had counted.
pamoja_gateway_station_xtime_parts⚠
Takes a station clock value apart into its radio unit, run, and microseconds.