PNI TCM 5 User Manual

Page 57

Advertising
background image

PNI Sensor Corporation

Doc #1007537 r12

TCM3 & TCM5 User Manual

– Sept 2012

Page 57

Message(

"Received %u data elements instead of the %u requested\r\n"

,

(UInt16)count,

(UInt16)kDataCount);

return

;

}

// loop through and collect the elements

while

(count)

{

// The elements are received as {type (ie. kHeading), data}

switch

(data[pntr++])

// read the type and go to the first byte of the

data

{

// Only handling the 4 elements we are looking for

case

CommProtocol::kHeading:

{

// Move(source, destination, size (bytes)). Move copies the specified number of

// bytes from the source pointer to the destination pointer.

// Store the heading.

Move(&(data[pntr]), &heading,

sizeof

(heading));

// increase the pointer to point to the next data element type

pntr +=

sizeof

(heading);

break

;

}

case

CommProtocol::kPAngle:

{

// Move(source, destination, size (bytes)). Move copies the

specified number of

// bytes from the source pointer to the destination pointer.

// Store the pitch.

Move(&(data[pntr]), &pitch,

sizeof

(pitch));

// increase the pointer to point to the next data element type

pntr +=

sizeof

(pitch);

break

;

}

case

CommProtocol::kRAngle:

{

// Move(source, destination, size (bytes)). Move copies the

specified number of

// bytes from the source pointer to the destination pointer.

// Store the roll.

Move(&(data[pntr]), &roll,

sizeof

(roll));

Advertising
This manual is related to the following products: