WIRELESS CONNECTIVITY & SENSORS
User manual Thyone-I
A. Additional CRC8 Information
This Annex gives an example CRC8 implementation and test vectors.
A.1. Example CRC8 Implementation
#include
<stdint.h>
uint8_t Get_CRC8(uint8_t * bufP, uint16_t len)
{
uint8_t crc = 0x00;
for
(uint16_t i = 0; i < len ; i ++)
{
crc ^= bufP[i ];
}
return
crc;
}
Code 1: Example CRC8 Implementation
A.2. CRC8 Test Vectors
Input data
Data length
Resulting CRC8
Null
0
0x00
0x02 0x01 0x00 0x00
4
0x03
0x02 0x87 0x01 0x00 0x16
5
0x92
0x02 0x04 0x04 0x00 0x41 0x42 0x43 0x44
8
0x06
0x02 0x88 0x07 0x00 0x00 0x55 0x00 0x00 0xDA 0x18 0x00
11
0x1A
Table 31: CRC8 Test Vectors
Order code 2611011021000
184
Version 2.3 , July 2022