HERMES Modem
Hermes ARQ/Broadcast modem
Loading...
Searching...
No Matches
Functions
arq_modem.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include "arq.h"
#include "arq_fsm.h"
Include dependency graph for arq_modem.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int arq_modem_queue_init (size_t capacity)
 Initialise the action queue.
 
void arq_modem_queue_shutdown (void)
 Flush and destroy the action queue.
 
int arq_modem_enqueue (const arq_action_t *action)
 Enqueue a modem action (called from FSM action callbacks).
 
bool arq_modem_dequeue (arq_action_t *action, int timeout_ms)
 Dequeue the next modem action (called from modem TX worker).
 
void arq_modem_set_event_fn (void(*fn)(int mode, bool ptt_on))
 Register the PTT event injection function (called from arq.c init).
 
void arq_modem_ptt_on (int mode, size_t frame_size)
 Notify ARQ that PTT has gone ON.
 
void arq_modem_ptt_off (void)
 Notify ARQ that PTT has gone OFF.
 
int arq_modem_preferred_rx_mode (const arq_session_t *sess)
 Return the preferred RX FreeDV mode for the current session state.
 
int arq_modem_preferred_tx_mode (const arq_session_t *sess)
 Return the preferred TX FreeDV mode for the current session state.
 

Function Documentation

◆ arq_modem_dequeue()

bool arq_modem_dequeue ( arq_action_t action,
int  timeout_ms 
)

Dequeue the next modem action (called from modem TX worker).

Blocks up to timeout_ms milliseconds waiting for an action.

Parameters
actionOutput action.
timeout_msWait timeout in milliseconds.
Returns
true if an action was dequeued, false on timeout.

◆ arq_modem_enqueue()

int arq_modem_enqueue ( const arq_action_t action)

Enqueue a modem action (called from FSM action callbacks).

Returns
0 on success, -1 if queue full.

◆ arq_modem_preferred_rx_mode()

int arq_modem_preferred_rx_mode ( const arq_session_t sess)

Return the preferred RX FreeDV mode for the current session state.

Parameters
sessCurrent session (read-only).
Returns
FREEDV_MODE_* constant.

◆ arq_modem_preferred_tx_mode()

int arq_modem_preferred_tx_mode ( const arq_session_t sess)

Return the preferred TX FreeDV mode for the current session state.

Parameters
sessCurrent session (read-only).
Returns
FREEDV_MODE_* constant.

◆ arq_modem_ptt_off()

void arq_modem_ptt_off ( void  )

Notify ARQ that PTT has gone OFF.

◆ arq_modem_ptt_on()

void arq_modem_ptt_on ( int  mode,
size_t  frame_size 
)

Notify ARQ that PTT has gone ON.

Parameters
modeFreeDV mode of the frame now on air.
frame_sizeFrame size in bytes.

◆ arq_modem_queue_init()

int arq_modem_queue_init ( size_t  capacity)

Initialise the action queue.

Parameters
capacityMaximum number of pending actions.
Returns
0 on success, -1 on allocation failure.

◆ arq_modem_queue_shutdown()

void arq_modem_queue_shutdown ( void  )

Flush and destroy the action queue.

◆ arq_modem_set_event_fn()

void arq_modem_set_event_fn ( void(*)(int mode, bool ptt_on)  fn)

Register the PTT event injection function (called from arq.c init).

Parameters
fnCallback: mode >= 0 and ptt_on=true → TX_STARTED; ptt_on=false → TX_COMPLETE.