simulator_modules/mUtils.c
/** extract the crc value from a message **/
extract the crc value from a message
extract the crc value from a message
uint16_t mUtils_get_crc(uint8_t *buf, uint32_t size)
{
	uint16_t lReturn = 0;
	assert(size > 2); 
	lReturn = ((uint16_t)(buf[size - 1]) << 8);
	lReturn |= buf[size - 2];
	return lReturn;
}
uint16_t mUtils_get_crc ( uint8_t * buf , uint32_t size ) { uint16_t lReturn = 0 ; assert ( size > 2 ) ; lReturn = ( ( uint16_t ) ( buf [ size - 1 ] ) << 8 ) ; lReturn |= buf [ size - 2 ] ; return lReturn ; }
extract the crc value from a message
extract the crc value from a message
// len of buffer must be at least 3 bytes