77 uint16_t test_sequence[4] = {0x02u, 0x12u, 0xB1u, 0xB2u};
78 TEST_ASSERT_EQUAL(0xC4u,
MXM_CRC8(test_sequence, 4));
82 uint16_t test_sequence[3] = {0x03u, 0x12u, 0x00u};
83 TEST_ASSERT_EQUAL(0xCBu,
MXM_CRC8(test_sequence, 3));
87 uint16_t test_sequence[10] = {0x02u, 0x5Bu, 0x12u, 0x42u, 0xFFu, 0xD3u, 0x13u, 0x77u, 0xA1u, 0x31u};
88 TEST_ASSERT_EQUAL(0x7Eu,
MXM_CRC8(test_sequence, 10));
92 uint16_t test_sequence[3] = {0x03u, 0x66u, 0x00u};
93 TEST_ASSERT_EQUAL(0x43u,
MXM_CRC8(test_sequence, 3));
STD_RETURN_TYPE_e must_check_return MXM_CRC8SelfTest(void)
Test the CRC8-algorithm with a known pattern.
uint8_t MXM_CRC8(uint16_t *pData, int32_t lenData)
Compute CRC8 with initial value set to 0x00.
Headers for the CRC8 calculation for Maxim Integrated Monitoring devices.
#define TEST_ASSERT_PASS_ASSERT(_code_under_test)
assert whether assert macro has passed
void testCRC8SelfCheckShouldPass(void)
void testCRC8Sequence3(void)
void testCRC8Sequence4(void)
void testCRC8Sequence1(void)
void testCRC8Sequence2(void)