|
HERMES Modem
Hermes ARQ/Broadcast modem
|
#include <stdbool.h>#include <stddef.h>#include <stdint.h>#include "fsm.h"#include "arq_events.h"

Go to the source code of this file.
Data Structures | |
| struct | arq_info |
| Runtime ARQ connection and mode state shared across modules. More... | |
| struct | arq_action_t |
| Single modem action item popped by modem TX worker. More... | |
| struct | arq_runtime_snapshot_t |
| Snapshot of current ARQ runtime state for telemetry/decision making. More... | |
Macros | |
| #define | CALLSIGN_MAX_SIZE 16 |
| #define | RX 0 |
| #define | TX 1 |
| #define | HEADER_SIZE 1 |
| #define | PACKET_ARQ_CONTROL 0x00 |
| #define | PACKET_ARQ_DATA 0x01 |
| #define | PACKET_ARQ_CALL 0x02 |
| #define | PACKET_BROADCAST_CONTROL 0x03 |
| #define | PACKET_BROADCAST_PAYLOAD 0x04 |
Enumerations | |
| enum | arq_action_type_t { ARQ_ACTION_NONE = 0 , ARQ_ACTION_TX_CONTROL = 1 , ARQ_ACTION_TX_PAYLOAD = 2 , ARQ_ACTION_MODE_SWITCH = 3 } |
| Action types emitted by ARQ for modem worker execution. More... | |
Functions | |
| int | arq_init (size_t frame_size, int mode) |
| Initialize ARQ subsystem. | |
| void | arq_shutdown () |
| Shut down ARQ workers and release ARQ resources. | |
| void | arq_tick_1hz (void) |
| Execute 1 Hz ARQ maintenance tick. | |
| void | arq_post_event (int event) |
| Post an FSM event to ARQ. | |
| bool | arq_is_link_connected (void) |
| Check whether ARQ link is connected. | |
| int | arq_queue_data (const uint8_t *data, size_t len) |
| Queue outbound payload bytes for ARQ transmission. | |
| int | arq_get_tx_backlog_bytes (void) |
| Get pending outbound payload backlog. | |
| int | arq_get_speed_level (void) |
| Get current ARQ speed level (gear). | |
| int | arq_get_payload_mode (void) |
| Get active ARQ payload mode. | |
| int | arq_get_control_mode (void) |
| Get active ARQ control mode. | |
| int | arq_get_preferred_rx_mode (void) |
| Get ARQ-preferred receive mode for modem. | |
| int | arq_get_preferred_tx_mode (void) |
| Get ARQ-preferred transmit mode for modem. | |
| void | arq_set_active_modem_mode (int mode, size_t frame_size) |
| Inform ARQ of modem mode/frame size actually active in modem. | |
| bool | arq_handle_incoming_connect_frame (uint8_t *data, size_t frame_size) |
| Handle incoming compressed CALL/ACCEPT frame. | |
| void | arq_handle_incoming_frame (uint8_t *data, size_t frame_size, float rx_snr) |
| Handle incoming regular ARQ control/data frame. | |
| void | arq_update_link_metrics (int sync, float snr, int rx_status, bool frame_decoded) |
| Feed decoder/link metrics into ARQ adaptation. | |
| bool | arq_try_dequeue_action (arq_action_t *action) |
| Try to dequeue next modem action without blocking. | |
| bool | arq_wait_dequeue_action (arq_action_t *action, int timeout_ms) |
| Wait for next modem action. | |
| bool | arq_get_runtime_snapshot (arq_runtime_snapshot_t *snapshot) |
| Copy ARQ runtime snapshot. | |
| int | arq_submit_tcp_cmd (const arq_cmd_msg_t *cmd) |
| Submit parsed control command from TCP bridge to ARQ. | |
| int | arq_submit_tcp_payload (const uint8_t *data, size_t len) |
| Submit payload bytes from TCP bridge to ARQ. | |
| void | clear_connection_data () |
| Clear legacy ARQ connection state and buffers. | |
| void | reset_arq_info (arq_info *arq_conn) |
| Reset external arq_info structure. | |
| void | call_remote () |
| Trigger outgoing call attempt using current ARQ addresses. | |
| void | callee_accept_connection () |
| Trigger callee-side accept flow in compatibility path. | |
Variables | |
| arq_info | arq_conn |
| fsm_handle | arq_fsm |
| #define CALLSIGN_MAX_SIZE 16 |
| #define HEADER_SIZE 1 |
| #define PACKET_ARQ_CALL 0x02 |
| #define PACKET_ARQ_CONTROL 0x00 |
| #define PACKET_ARQ_DATA 0x01 |
| #define PACKET_BROADCAST_CONTROL 0x03 |
| #define PACKET_BROADCAST_PAYLOAD 0x04 |
| #define RX 0 |
| #define TX 1 |
| enum arq_action_type_t |
| int arq_get_control_mode | ( | void | ) |
Get active ARQ control mode.
| int arq_get_payload_mode | ( | void | ) |
Get active ARQ payload mode.
| int arq_get_preferred_rx_mode | ( | void | ) |
Get ARQ-preferred receive mode for modem.
| int arq_get_preferred_tx_mode | ( | void | ) |
Get ARQ-preferred transmit mode for modem.
| bool arq_get_runtime_snapshot | ( | arq_runtime_snapshot_t * | snapshot | ) |
Copy ARQ runtime snapshot.
| snapshot | Output snapshot pointer. |
| int arq_get_speed_level | ( | void | ) |
Get current ARQ speed level (gear).
| int arq_get_tx_backlog_bytes | ( | void | ) |
Get pending outbound payload backlog.
| bool arq_handle_incoming_connect_frame | ( | uint8_t * | data, |
| size_t | frame_size | ||
| ) |
Handle incoming compressed CALL/ACCEPT frame.
| data | Frame bytes. |
| frame_size | Frame length in bytes. |
| void arq_handle_incoming_frame | ( | uint8_t * | data, |
| size_t | frame_size, | ||
| float | rx_snr | ||
| ) |
Handle incoming regular ARQ control/data frame.
| data | Frame bytes. |
| frame_size | Frame length in bytes. |
| rx_snr | Local receive SNR at decode time (dB); 0.0 = unknown. |
| int arq_init | ( | size_t | frame_size, |
| int | mode | ||
| ) |
Initialize ARQ subsystem.
| frame_size | Active modem frame size in bytes. |
| mode | Initial modem mode. |
| bool arq_is_link_connected | ( | void | ) |
Check whether ARQ link is connected.
| void arq_post_event | ( | int | event | ) |
Post an FSM event to ARQ.
| event | Event identifier from fsm.h. |
| int arq_queue_data | ( | const uint8_t * | data, |
| size_t | len | ||
| ) |
Queue outbound payload bytes for ARQ transmission.
| data | Pointer to payload bytes. |
| len | Number of bytes to queue. |
| void arq_set_active_modem_mode | ( | int | mode, |
| size_t | frame_size | ||
| ) |
Inform ARQ of modem mode/frame size actually active in modem.
| mode | Active FreeDV mode. |
| frame_size | Active frame size in bytes. |
| void arq_shutdown | ( | ) |
Shut down ARQ workers and release ARQ resources.
| int arq_submit_tcp_cmd | ( | const arq_cmd_msg_t * | cmd | ) |
Submit parsed control command from TCP bridge to ARQ.
| cmd | Command message. |
| int arq_submit_tcp_payload | ( | const uint8_t * | data, |
| size_t | len | ||
| ) |
Submit payload bytes from TCP bridge to ARQ.
| data | Payload bytes. |
| len | Payload length in bytes. |
| void arq_tick_1hz | ( | void | ) |
Execute 1 Hz ARQ maintenance tick.
| bool arq_try_dequeue_action | ( | arq_action_t * | action | ) |
Try to dequeue next modem action without blocking.
| action | Output action item. |
| void arq_update_link_metrics | ( | int | sync, |
| float | snr, | ||
| int | rx_status, | ||
| bool | frame_decoded | ||
| ) |
Feed decoder/link metrics into ARQ adaptation.
| sync | Decoder sync flag. |
| snr | Estimated SNR. |
| rx_status | Decoder RX status flags. |
| frame_decoded | True when a frame decoded this cycle. |
| bool arq_wait_dequeue_action | ( | arq_action_t * | action, |
| int | timeout_ms | ||
| ) |
Wait for next modem action.
| action | Output action item. |
| timeout_ms | Wait timeout in milliseconds. |
| void call_remote | ( | ) |
Trigger outgoing call attempt using current ARQ addresses.
| void callee_accept_connection | ( | ) |
Trigger callee-side accept flow in compatibility path.
| void clear_connection_data | ( | ) |
Clear legacy ARQ connection state and buffers.
| void reset_arq_info | ( | arq_info * | arq_conn | ) |
Reset external arq_info structure.
| arq_conn | Pointer to structure to reset. |
|
extern |
|
extern |