Mercury Modem
Mercury ARQ/Broadcast modem
Loading...
Searching...
No Matches
arq_tnc.h
Go to the documentation of this file.
1/* HERMES Modem — ARQ→TNC notification seam
2 *
3 * Copyright (C) 2026 Rhizomatica
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 *
6 * Decouples the ARQ datalink from the TCP TNC layer above it. The TNC
7 * layer registers a table of notification callbacks via
8 * arq_set_tnc_callbacks(); the ARQ layer emits notifications through the
9 * arq_tnc_send_*() invokers, which are NULL-safe before registration.
10 */
11#ifndef ARQ_TNC_H
12#define ARQ_TNC_H
13
14#include <stdint.h>
15
16typedef struct
17{
18 void (*send_pending)(void);
19 void (*send_cancelpending)(void);
20 void (*send_connected)(void);
21 void (*send_cqframe)(const char *source_call, int bw_hz);
22 void (*send_disconnected)(void);
23 void (*send_buffer)(uint32_t bytes);
24 void (*send_registered)(const char *callsign);
26
27/* Register the TNC notification callbacks (call once, after arq_init()).
28 * Passing NULL clears the registration. The pointed-to struct must outlive
29 * all subsequent arq_tnc_send_* calls (register a static/const table). */
31
32/* NULL-safe notification invokers. No-op if no table is registered or the
33 * specific callback is NULL. */
34void arq_tnc_send_pending(void);
36void arq_tnc_send_connected(void);
37void arq_tnc_send_cqframe(const char *source_call, int bw_hz);
39void arq_tnc_send_buffer(uint32_t bytes);
40void arq_tnc_send_registered(const char *callsign);
41
42#endif /* ARQ_TNC_H */
void arq_tnc_send_disconnected(void)
Definition arq_tnc.c:40
void arq_tnc_send_cqframe(const char *source_call, int bw_hz)
Definition arq_tnc.c:35
void arq_tnc_send_pending(void)
Definition arq_tnc.c:20
void arq_tnc_send_cancelpending(void)
Definition arq_tnc.c:25
void arq_tnc_send_connected(void)
Definition arq_tnc.c:30
void arq_tnc_send_registered(const char *callsign)
Definition arq_tnc.c:50
void arq_tnc_send_buffer(uint32_t bytes)
Definition arq_tnc.c:45
void arq_set_tnc_callbacks(const arq_tnc_callbacks_t *cbs)
Definition arq_tnc.c:15
int bw_hz
Definition carousel.c:2369
Definition arq_tnc.h:17