28.01.2013 Views

X-3D-BL ResearchPilot User's Manual - Ascending Technologies

X-3D-BL ResearchPilot User's Manual - Ascending Technologies

X-3D-BL ResearchPilot User's Manual - Ascending Technologies

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

};<br />

4.2.2 Command input<br />

X-<strong>3D</strong>-<strong>BL</strong> <strong>ResearchPilot</strong> User’s <strong>Manual</strong><br />

All packets send to the X-<strong>3D</strong> <strong>ResearchPilot</strong> have the following frame format:<br />

Startbyte 1: ><br />

Startbyte 2: ∗<br />

Startbyte 3: ><br />

Length of dat in bytes (high byte)<br />

Length of data in bytes (low byte)<br />

DATA<br />

CRC16 of data (high byte)<br />

CRC16 of data (low byte)<br />

Length and CRC16 are unsigned short types.<br />

For calculating the CRC16 of a packet you can use the following algorithm:<br />

//update crc with data<br />

unsigned short crc_update(unsigned short crc,unsigned char data)<br />

{<br />

data ˆ= (crc & 0xff);<br />

data ˆ= data 8)&0xff))<br />

ˆ (unsigned char )(data >> 4) ˆ ((unsigned short )data

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!