Application APIs
- group Satellite Network Function APIs
Hubble Sat Network Function APIs.
Warning
The satellite functionality is currently in pre-production and is not yet ready for production deployments. APIs and behavior may change in future releases.
Enums
-
enum hubble_sat_transmission_mode
Satellite transmission mode.
It tells what is the desired reliability when transmitting a packet. Higher reliability consumes higher power and takes longer because it increases the number of retries.
Values:
-
enumerator HUBBLE_SAT_RELIABILITY_NONE
No retries. The packet is transmitted one time.
-
enumerator HUBBLE_SAT_RELIABILITY_NORMAL
Good balance between reliability and power consumption
-
enumerator HUBBLE_SAT_RELIABILITY_HIGH
High reliability and higher power consumption
-
enumerator HUBBLE_SAT_RELIABILITY_NONE
Functions
-
int hubble_sat_packet_send(const struct hubble_sat_packet *packet, enum hubble_sat_transmission_mode mode)
Transmit a packet using the Hubble satellite communication system.
This function sends a packet over the satellite communication channel. The packet must be properly formatted and adhere to the Hubble protocol.
Warning
This function checks if the packet is NULL but does not perform any validation on the packet structure. It is the caller’s responsibility to ensure the packet is correctly formatted.
- Parameters:
packet – A pointer to the hubble_sat_packet structure containing the data to be transmitted.
mode – Desired reliability for the transmission.
- Returns:
0 on successful transmission, or a negative error code on failure.
-
enum hubble_sat_transmission_mode
- group Satellite Network packet APIs
Hubble Sat Network Packet APIs.
Defines
-
HUBBLE_PACKET_MAX_SIZE
-
HUBBLE_SAT_PAYLOAD_MAX
-
HUBBLE_PACKET_FRAME_PAYLOAD_MAX_SIZE
-
HUBBLE_PACKET_FRAME_MAX_SIZE
Functions
-
int hubble_sat_packet_get(struct hubble_sat_packet *packet, const void *payload, size_t length)
Build a Hubble satellite packet from a payload.
This function constructs a Hubble satellite packet by encoding the provided payload data into the packet structure.
- Parameters:
packet – Pointer to the packet structure to be populated.
payload – Pointer to the payload data to be included in the packet.
length – Length of the payload data in bytes.
- Return values:
0 – On success.
-EINVAL – If any of the input parameters are invalid.
-ENOMEM – If the payload length exceeds the maximum allowed size.
-
int hubble_sat_packet_frames_get(const struct hubble_sat_packet *packet, struct hubble_sat_packet_frames *frames)
Split a Hubble satellite packet into transmission frames.
This function divides the encoded data of a Hubble packet into one or more frames suitable for transmission. Each frame carries a portion of the packet payload along with its associated channel.
- Parameters:
packet – Pointer to the source packet to split.
frames – Pointer to the frames structure to be populated.
- Return values:
0 – On success.
-EINVAL – If any of the input parameters are invalid.
-
struct hubble_sat_packet
- #include <packet.h>
Structure representing a Hubble packet.
This structure is used to represent a Hubble packet, the data is a set symbols that represents the frequency in a specific channel.
Since the preamble is a fixed pattern that is formed by the reference frequency and the complete absence of transmission for a certain period, it is NOT included in this structure.
Note
The preamble is NOT included in this struct.
-
struct hubble_sat_packet_frames
- #include <packet.h>
Structure representing a set of Hubble packet frames.
A single Hubble packet may be split into multiple frames for transmission. Each frame carries a chunk of the encoded packet payload along with the channel on which it should be transmitted.
Note
The preamble is included in this struct.
-
HUBBLE_PACKET_MAX_SIZE
Port APIs
- group Hubble Network Satellite Radio Port APIs
Hubble Network Satellite Radio Port APIs.
Platform-specific functions that need to be implemented for satellite communication.
Defines
-
HUBBLE_WAIT_SYMBOL_US
Duration to wait for a symbol transmission in microseconds.
-
HUBBLE_WAIT_SYMBOL_OFF_US
Duration to wait for a symbol off period in microseconds.
-
HUBBLE_SAT_SYMBOLS_FRAME_MAX
The max number of symbols to transmit in single frame.
-
HUBBLE_SAT_NUM_CHANNELS
Number of available channels for transmissions.
-
HUBBLE_SAT_PREAMBLE_SEQUENCE
Preamble sequence pattern for satellite communication.
This array defines the frequency step pattern used for the preamble. Values represent frequency steps relative to the reference frequency:
0: reference frequency
-1: no transmission
31: center channel frequency
Functions
-
int hubble_sat_port_init(void)
Initialize the satellite radio port.
This function performs platform-specific initialization of the satellite radio hardware. It is called before any other satellite radio operations are performed.
- Returns:
0 on success, negative error code on failure.
-
int hubble_sat_port_packet_send(const struct hubble_sat_packet *packet, uint8_t retries, uint8_t interval_s)
Transmit a packet over the satellite radio.
This function transmits a packet using the satellite radio hardware. The packet is sent on the specified channel (frequency) using the platform-specific radio implementation. It handles re-transmissions internally.
Note
This function blocks the caller during the whole transmission.
Note
This API is thread safe.
- Parameters:
packet – Pointer to the packet structure containing the data to transmit.
retries – The number of times this packet must be transmit.
interval_s – The time interval between transmissions.
- Returns:
0 on successful transmission, negative error code on failure.
-
HUBBLE_WAIT_SYMBOL_US