Pni SeaTRAX Manuel d'utilisateur Page 74

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 77
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 73
PNI Sensor Corporation DOC#1018154 r02
SeaTRAX User Manual Page 69
// Message is a function that displays a C formatted string
// (similar to printf)
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::kPitch:
{
// 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::kRoll:
{
// 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));
// increase the pointer to point to the next data element type
pntr += sizeof(roll);
break;
}
Vue de la page 73
1 2 ... 69 70 71 72 73 74 75 76 77

Commentaires sur ces manuels

Pas de commentaire