From 20cb29c2f8c5c87bc590896854a20b1473ceb358 Mon Sep 17 00:00:00 2001 From: "info@mode42.com" Date: Sat, 8 Aug 2026 03:54:55 +0000 Subject: #2 --- plugins/ardop/ardop_crc.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 plugins/ardop/ardop_crc.h (limited to 'plugins/ardop/ardop_crc.h') diff --git a/plugins/ardop/ardop_crc.h b/plugins/ardop/ardop_crc.h new file mode 100644 index 0000000..69c2f07 --- /dev/null +++ b/plugins/ardop/ardop_crc.h @@ -0,0 +1,15 @@ +#ifndef ARDOP_CRC_H +#define ARDOP_CRC_H + +#include + +/** ARDOP host/TNC CRC-16 (poly 0x8810, init 0xFFFF) per ARDOPC reference. */ +unsigned int ardop_crc16(const unsigned char *data, unsigned short length); + +/** Non-zero when @p length includes trailing 2-byte CRC that validates. */ +int ardop_crc16_valid(const unsigned char *data, unsigned short length); + +/** Append CRC16 (MSB, LSB) after @p length bytes; returns new length. */ +size_t ardop_crc16_append(unsigned char *data, size_t length, size_t cap); + +#endif /* ARDOP_CRC_H */ -- cgit v1.3.1