Aceinna IMU383 Series User Manual page 80

Hide thumbs Also See for IMU383 Series:
Table of Contents

Advertisement

IMU383 Series User's Manual
________________________________________________________________________
return 0;
/* empty buffer */
}
/* find header */
for(numToPop=0; numToPop+1<Size(queue_ptr) ;numToPop+=1)
{
if(0x5555==peekWord(queue_ptr, numToPop)) break;
}
Pop(queue_ptr, numToPop);
if(Size(queue_ptr) <= 0)
{
/* header was not found */
return 0;
}
/* make sure we can read through minimum length packet */
if(Size(queue_ptr)<7)
{
return 0;
}
/* get data length (5th byte of packet) */
dataLength = peekByte(queue_ptr, 4);
/* make sure we can read through entire packet */
if(Size(queue_ptr) < 7+dataLength)
{
return 0;
}
/* check CRC */
myCRC = calcCRC(queue_ptr, 2,dataLength+3);
packetCRC = peekWord(queue_ptr, dataLength+5);
if(myCRC != packetCRC)
{
/* bad CRC on packet – remove the bad packet from the queue and return */
Pop(queue_ptr, dataLength+7);
return 0;
Doc# 7430-1398-01
Downloaded From
Oneyac.com
Page 72

Advertisement

Table of Contents
loading

Related Products for Aceinna IMU383 Series

This manual is also suitable for:

Imu383za seriesImu383za-400

Table of Contents