HERMES Modem
Hermes ARQ/Broadcast modem
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
arq_channels.h File Reference
#include <stddef.h>
#include "chan.h"
#include "arq_events.h"
Include dependency graph for arq_channels.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  arq_channel_bus_t
 ARQ message-bus channels connecting TCP, modem, and ARQ workers. More...
 

Macros

#define ARQ_CH_CAP_TCP_CMD   64
 
#define ARQ_CH_CAP_TCP_PAYLOAD   128
 
#define ARQ_CH_CAP_MODEM_FRAME   128
 
#define ARQ_CH_CAP_MODEM_METRICS   128
 
#define ARQ_CH_CAP_MODEM_TX   128
 
#define ARQ_CH_CAP_TCP_STATUS   128
 
#define ARQ_CH_CAP_SHUTDOWN   1
 

Functions

int arq_channel_bus_init (arq_channel_bus_t *bus)
 Initialize ARQ channel bus.
 
void arq_channel_bus_close (arq_channel_bus_t *bus)
 Close all ARQ channel endpoints to stop producers/consumers.
 
void arq_channel_bus_dispose (arq_channel_bus_t *bus)
 Dispose ARQ channel resources.
 
int arq_channel_bus_try_send_cmd (arq_channel_bus_t *bus, const arq_cmd_msg_t *msg)
 Try to enqueue a TCP control command into ARQ bus.
 
int arq_channel_bus_try_send_payload (arq_channel_bus_t *bus, const uint8_t *data, size_t len)
 Try to enqueue TCP payload bytes into ARQ bus.
 
int arq_channel_bus_recv_cmd (arq_channel_bus_t *bus, arq_cmd_msg_t *msg)
 Receive next TCP command from ARQ bus.
 
int arq_channel_bus_recv_payload (arq_channel_bus_t *bus, arq_bytes_msg_t *msg)
 Receive next TCP payload message from ARQ bus.
 

Macro Definition Documentation

◆ ARQ_CH_CAP_MODEM_FRAME

#define ARQ_CH_CAP_MODEM_FRAME   128

◆ ARQ_CH_CAP_MODEM_METRICS

#define ARQ_CH_CAP_MODEM_METRICS   128

◆ ARQ_CH_CAP_MODEM_TX

#define ARQ_CH_CAP_MODEM_TX   128

◆ ARQ_CH_CAP_SHUTDOWN

#define ARQ_CH_CAP_SHUTDOWN   1

◆ ARQ_CH_CAP_TCP_CMD

#define ARQ_CH_CAP_TCP_CMD   64

◆ ARQ_CH_CAP_TCP_PAYLOAD

#define ARQ_CH_CAP_TCP_PAYLOAD   128

◆ ARQ_CH_CAP_TCP_STATUS

#define ARQ_CH_CAP_TCP_STATUS   128

Function Documentation

◆ arq_channel_bus_close()

void arq_channel_bus_close ( arq_channel_bus_t bus)

Close all ARQ channel endpoints to stop producers/consumers.

Parameters
busBus to close.

◆ arq_channel_bus_dispose()

void arq_channel_bus_dispose ( arq_channel_bus_t bus)

Dispose ARQ channel resources.

Parameters
busBus to dispose.

◆ arq_channel_bus_init()

int arq_channel_bus_init ( arq_channel_bus_t bus)

Initialize ARQ channel bus.

Parameters
busBus structure to initialize.
Returns
0 on success, negative on failure.

◆ arq_channel_bus_recv_cmd()

int arq_channel_bus_recv_cmd ( arq_channel_bus_t bus,
arq_cmd_msg_t msg 
)

Receive next TCP command from ARQ bus.

Parameters
busBus instance.
msgOutput command message.
Returns
0 on success, negative on closed/error.

◆ arq_channel_bus_recv_payload()

int arq_channel_bus_recv_payload ( arq_channel_bus_t bus,
arq_bytes_msg_t msg 
)

Receive next TCP payload message from ARQ bus.

Parameters
busBus instance.
msgOutput payload message.
Returns
0 on success, negative on closed/error.

◆ arq_channel_bus_try_send_cmd()

int arq_channel_bus_try_send_cmd ( arq_channel_bus_t bus,
const arq_cmd_msg_t msg 
)

Try to enqueue a TCP control command into ARQ bus.

Parameters
busBus instance.
msgCommand message.
Returns
0 on success, negative if full/error.

◆ arq_channel_bus_try_send_payload()

int arq_channel_bus_try_send_payload ( arq_channel_bus_t bus,
const uint8_t *  data,
size_t  len 
)

Try to enqueue TCP payload bytes into ARQ bus.

Parameters
busBus instance.
dataPayload bytes.
lenPayload length in bytes.
Returns
0 on success, negative if full/error.