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/crdop/crdop.c | |
#2
Diffstat (limited to 'plugins/crdop/crdop.c')
| -rw-r--r-- | plugins/crdop/crdop.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/plugins/crdop/crdop.c b/plugins/crdop/crdop.c new file mode 100644 index 0000000..d2c6f3d --- /dev/null +++ b/plugins/crdop/crdop.c @@ -0,0 +1,51 @@ +/* + * crdop — CB Radio Digital Open Protocol host-client (external ARDOPC/ardopcf). + * INI: [transport.crdop] or [transport.crdopN]. No embedded modem in HyBBX. + */ +#include "hybbx/plugin.h" +#include "hybbx/service.h" +#include "hybbx/ardop.h" +#include "hybbx/crdop.h" + +#include "../ardop/ardop_link.h" + +static const ardop_link_plugin_t g_crdop_link = { + .name = "crdop", + .kind = HYBBX_TRANSPORT_CRDOP, + .default_link_id = "crdop-link", + .modem_hint = "CRDOPC (ARDOP-compatible host TCP)", + .parse_config = (ardop_link_config_fn)hybbx_crdop_config_parse, + .config_free = (void (*)(void *))hybbx_ardop_config_free, + .config_size = sizeof(hybbx_ardop_config_t), +}; + +static hybbx_result_t crdop_init(hybbx_service_t *service) +{ + return ardop_link_init(service, &g_crdop_link); +} + +static void crdop_shutdown(void) +{ + ardop_link_shutdown(&g_crdop_link); +} + +static hybbx_result_t crdop_start(const char *config) +{ + return ardop_link_start(&g_crdop_link, config); +} + +static hybbx_result_t crdop_stop(void) +{ + return ardop_link_stop(&g_crdop_link); +} + +const hybbx_transport_plugin_t hybbx_plugin_crdop = { + .name = "crdop", + .kind = HYBBX_TRANSPORT_CRDOP, + .version = 1, + .init = crdop_init, + .shutdown = crdop_shutdown, + .start = crdop_start, + .stop = crdop_stop, + .write = NULL, +}; |
