diff options
| author | info@mode42.com <info@mode42.com> | 2026-08-08 03:54:55 +0000 |
|---|---|---|
| committer | info@mode42.com <info@mode42.com> | 2026-08-08 03:54:55 +0000 |
| commit | 20cb29c2f8c5c87bc590896854a20b1473ceb358 (patch) | |
| tree | 2857f41513a56ad41af97b57362639298aa7f033 /plugins/ardop/ardop_host.h | |
#2
Diffstat (limited to 'plugins/ardop/ardop_host.h')
| -rw-r--r-- | plugins/ardop/ardop_host.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/plugins/ardop/ardop_host.h b/plugins/ardop/ardop_host.h new file mode 100644 index 0000000..4aee53d --- /dev/null +++ b/plugins/ardop/ardop_host.h @@ -0,0 +1,47 @@ +#ifndef ARDOP_HOST_H +#define ARDOP_HOST_H + +/** + * Minimal ARDOP TNC Host Interface client (TCP control + data ports). + * Implements the subset HyBBX needs — see docs/MANUAL.md § ARDOP. + */ + +#include "hybbx/types.h" +#include "hybbx/ardop.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ardop_host ardop_host_t; + +typedef void (*ardop_host_data_fn)(const uint8_t *data, size_t len, void *ctx); +typedef void (*ardop_host_event_fn)(const char *event, const char *detail, + void *ctx); + +ardop_host_t *ardop_host_create(const hybbx_ardop_config_t *cfg, + ardop_host_data_fn on_data, + ardop_host_event_fn on_event, + void *userdata, + const char *log_tag); +void ardop_host_destroy(ardop_host_t *host); + +hybbx_result_t ardop_host_connect(ardop_host_t *host); +void ardop_host_disconnect(ardop_host_t *host); + +/** Drive I/O and state machine; call periodically from plugin poll thread. */ +void ardop_host_poll(ardop_host_t *host); + +int ardop_host_link_up(const ardop_host_t *host); + +/** Control TCP session to external ARDOPC is open. */ +int ardop_host_modem_connected(const ardop_host_t *host); + +hybbx_result_t ardop_host_send_data(ardop_host_t *host, + const uint8_t *data, size_t len); + +#ifdef __cplusplus +} +#endif + +#endif /* ARDOP_HOST_H */ |
