HERMES Modem
Hermes ARQ/Broadcast modem
Loading...
Searching...
No Matches
arq_channels.h
Go to the documentation of this file.
1/* Mercury Modem — ARQ message-bus channel interface
2 *
3 * Copyright (C) 2025-2026 Rhizomatica
4 * Author: Rafael Diniz <rafael@riseup.net>
5 *
6 * SPDX-License-Identifier: GPL-3.0-or-later
7 */
8
9#ifndef ARQ_CHANNELS_H_
10#define ARQ_CHANNELS_H_
11
12#include <stddef.h>
13
14#include "chan.h"
15#include "arq_events.h"
16
17#define ARQ_CH_CAP_TCP_CMD 64
18#define ARQ_CH_CAP_TCP_PAYLOAD 128
19#define ARQ_CH_CAP_MODEM_FRAME 128
20#define ARQ_CH_CAP_MODEM_METRICS 128
21#define ARQ_CH_CAP_MODEM_TX 128
22#define ARQ_CH_CAP_TCP_STATUS 128
23#define ARQ_CH_CAP_SHUTDOWN 1
24
26typedef struct
27{
28 chan_t *tcp_cmd;
29 chan_t *tcp_payload;
30 chan_t *modem_frame;
32 chan_t *modem_tx;
33 chan_t *tcp_status;
34 chan_t *shutdown;
36
43
49
55
63
71int arq_channel_bus_try_send_payload(arq_channel_bus_t *bus, const uint8_t *data, size_t len);
72
80
88
89#endif /* ARQ_CHANNELS_H_ */
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.
Definition arq_channels.c:140
int arq_channel_bus_recv_payload(arq_channel_bus_t *bus, arq_bytes_msg_t *msg)
Receive next TCP payload message from ARQ bus.
Definition arq_channels.c:196
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.
Definition arq_channels.c:109
int arq_channel_bus_init(arq_channel_bus_t *bus)
Initialize ARQ channel bus.
Definition arq_channels.c:51
int arq_channel_bus_recv_cmd(arq_channel_bus_t *bus, arq_cmd_msg_t *msg)
Receive next TCP command from ARQ bus.
Definition arq_channels.c:172
void arq_channel_bus_close(arq_channel_bus_t *bus)
Close all ARQ channel endpoints to stop producers/consumers.
Definition arq_channels.c:79
void arq_channel_bus_dispose(arq_channel_bus_t *bus)
Dispose ARQ channel resources.
Definition arq_channels.c:94
Definition arq_events.h:69
ARQ message-bus channels connecting TCP, modem, and ARQ workers.
Definition arq_channels.h:27
chan_t * modem_tx
Definition arq_channels.h:32
chan_t * shutdown
Definition arq_channels.h:34
chan_t * tcp_status
Definition arq_channels.h:33
chan_t * modem_metrics
Definition arq_channels.h:31
chan_t * tcp_cmd
Definition arq_channels.h:28
chan_t * modem_frame
Definition arq_channels.h:30
chan_t * tcp_payload
Definition arq_channels.h:29
Definition arq_events.h:60