Feature/mstp extended frames cobs encoding (#183)

* added COBS encode and decode from BACnet standard

* Add unit tests for COBS encoding and decoding

* Improve COBS unit test and API.

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Steve Karg
2021-07-30 16:16:12 -05:00
committed by GitHub
parent 810a2f93de
commit 4b9e154256
7 changed files with 539 additions and 0 deletions
+7
View File
@@ -45,6 +45,9 @@
#define FRAME_TYPE_BACNET_DATA_EXPECTING_REPLY 5
#define FRAME_TYPE_BACNET_DATA_NOT_EXPECTING_REPLY 6
#define FRAME_TYPE_REPLY_POSTPONED 7
#define FRAME_TYPE_BACNET_EXTENDED_DATA_EXPECTING_REPLY 32
#define FRAME_TYPE_BACNET_EXTENDED_DATA_NOT_EXPECTING_REPLY 33
#define FRAME_TYPE_IPV6_ENCAPSULATION 34
/* Frame Types 128 through 255: Proprietary Frames */
/* These frames are available to vendors as proprietary (non-BACnet) frames. */
/* The first two octets of the Data field shall specify the unique vendor */
@@ -55,6 +58,10 @@
#define FRAME_TYPE_PROPRIETARY_MAX 255
/* The initial CRC16 checksum value */
#define CRC16_INITIAL_VALUE (0xFFFF)
#define CRC32K_INITIAL_VALUE (0xFFFFFFFF)
#define CRC32K_RESIDUE (0x0843323B)
#define MSTP_PREAMBLE_X55 (0x55)
#define MSTP_EXTENDED_FRAME_NPDU_MAX 1497
/* receive FSM states */
typedef enum {