simplified message handling, switch from XOR checksum to CRC8 with polynomial 0x97.
0x97 allows for detection of all 1-3 bit errors in a message of up to 119 bytes (see https://www.faa.gov/aircraft/air_cert/design_approvals/air_software/media/TC-14-49.pdf)
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
#include <gwenhywfar/buffer.h>
|
||||
|
||||
|
||||
#define AQH_MAXMSGSIZE 16
|
||||
#define AQH_MAXMSGSIZE 24
|
||||
|
||||
|
||||
#define AQH_MSG_OFFS_ALL_DEST_ADDRESS 0
|
||||
@@ -69,6 +69,10 @@ AQHOME_API int AQH_NodeMsg_IsMsgComplete(const GWEN_MSG *msg);
|
||||
AQHOME_API int AQH_NodeMsg_IsChecksumValid(const GWEN_MSG *msg);
|
||||
AQHOME_API int AQH_NodeMsg_AddChecksum(GWEN_MSG *msg);
|
||||
|
||||
AQHOME_API uint32_t AQH_NodeMsg_GetUint32At(const GWEN_MSG *msg, int offs, int defaultValue);
|
||||
AQHOME_API uint16_t AQH_NodeMsg_GetUint16At(const GWEN_MSG *msg, int offs, int defaultValue);
|
||||
AQHOME_API uint8_t AQH_NodeMsg_GetUint8At(const GWEN_MSG *msg, int offs, int defaultValue);
|
||||
|
||||
AQHOME_API void AQH_NodeMsg_DumpToBuffer(const GWEN_MSG *msg, GWEN_BUFFER *dbuf, const char *sText);
|
||||
|
||||
AQHOME_API uint32_t AQH_NodeMsg_GetMsgGroup(uint8_t msgType);
|
||||
|
||||
Reference in New Issue
Block a user