simulator_modules/mUtils.c
/** set the crc value of the message **/
set the crc value of the message
set the crc value of the message
void mUtils_set_crc(uint8_t *buf, uint32_t size)
{
	assert(size > 2); 
	uint16_t crc = mUtils_calc_crc(buf, size - 2, 0xFFFF);
	buf[size - 1] = (crc >> 8) & 0xFF;
	buf[size - 2] = crc & 0xFF;
}
void mUtils_set_crc ( uint8_t * buf , uint32_t size ) { assert ( size > 2 ) ; uint16_t crc = mUtils_calc_crc ( buf , size - 2 , 0xFFFF ) ; buf [ size - 1 ] = ( crc >> 8 ) & 0xFF ; buf [ size - 2 ] = crc & 0xFF ; }
set the crc value of the message
set the crc value of the message
// len of buffer must be at least 3 bytes