Public Member Functions | Public Attributes | Static Public Attributes | List of all members
imu_3dm_gx4::Imu::Packet Struct Reference

#include <imu.hpp>

Public Member Functions

int ackErrorCodeFor (const Packet &command) const
 Extract the ACK code from this packet. More...
 
void calcChecksum ()
 Calculate the packet checksum. Sets the checksum variable. More...
 
bool isFilterData () const
 True if this packet corresponds to a filter data message. More...
 
bool isIMUData () const
 True if this packet corresponds to an imu data message. More...
 
 Packet (uint8_t desc=0)
 Constructor. More...
 
std::string toString () const
 Make a 'human-readable' version of the packet. More...
 

Public Attributes

union {
   struct {
      uint8_t   syncLSB
 
      uint8_t   syncMSB
 
   } 
 
   uint16_t   sync
 
}; 
 
union {
   struct {
      uint8_t   checkLSB
 
      uint8_t   checkMSB
 
   } 
 
   uint16_t   checksum
 
}; 
 
uint8_t descriptor
 
uint8_t length
 
uint8_t payload [255]
 

Static Public Attributes

static constexpr uint8_t kHeaderLength = 4
 
static constexpr uint8_t kSyncLSB = 0x65
 
static constexpr uint8_t kSyncMSB = 0x75
 

Detailed Description

Definition at line 45 of file imu.hpp.

Constructor & Destructor Documentation

Imu::Packet::Packet ( uint8_t  desc = 0)

Constructor.

Parameters
descMajor descriptor of this command.
lenLength of the packet payload.

Definition at line 316 of file imu.cpp.

Member Function Documentation

int Imu::Packet::ackErrorCodeFor ( const Packet command) const

Extract the ACK code from this packet.

Parameters
commmandCommand packet to which this ACK should correspond.
Returns
-1 if the packets do not correspond or this is not an ACK. The error code is returned otherwise.

Definition at line 265 of file imu.cpp.

void Imu::Packet::calcChecksum ( )

Calculate the packet checksum. Sets the checksum variable.

Definition at line 291 of file imu.cpp.

bool Imu::Packet::isFilterData ( ) const

True if this packet corresponds to a filter data message.

Definition at line 261 of file imu.cpp.

bool Imu::Packet::isIMUData ( ) const

True if this packet corresponds to an imu data message.

Definition at line 257 of file imu.cpp.

std::string Imu::Packet::toString ( ) const

Make a 'human-readable' version of the packet.

Returns
std::string

Definition at line 322 of file imu.cpp.

Member Data Documentation

union { ... }
union { ... }
uint8_t imu_3dm_gx4::Imu::Packet::checkLSB

Definition at line 66 of file imu.hpp.

uint8_t imu_3dm_gx4::Imu::Packet::checkMSB

Definition at line 65 of file imu.hpp.

uint16_t imu_3dm_gx4::Imu::Packet::checksum

Packet checksum

Definition at line 68 of file imu.hpp.

uint8_t imu_3dm_gx4::Imu::Packet::descriptor

Type of packet

Definition at line 58 of file imu.hpp.

constexpr uint8_t imu_3dm_gx4::Imu::Packet::kHeaderLength = 4
static

Definition at line 46 of file imu.hpp.

constexpr uint8_t imu_3dm_gx4::Imu::Packet::kSyncLSB = 0x65
static

Definition at line 48 of file imu.hpp.

constexpr uint8_t imu_3dm_gx4::Imu::Packet::kSyncMSB = 0x75
static

Definition at line 47 of file imu.hpp.

uint8_t imu_3dm_gx4::Imu::Packet::length

Length of the packet in bytes

Definition at line 59 of file imu.hpp.

uint8_t imu_3dm_gx4::Imu::Packet::payload[255]

Payload of packet

Definition at line 61 of file imu.hpp.

uint16_t imu_3dm_gx4::Imu::Packet::sync

Identifer of packet

Definition at line 55 of file imu.hpp.

uint8_t imu_3dm_gx4::Imu::Packet::syncLSB

Definition at line 53 of file imu.hpp.

uint8_t imu_3dm_gx4::Imu::Packet::syncMSB

Definition at line 52 of file imu.hpp.


The documentation for this struct was generated from the following files:


thormang3_imu_3dm_gx4
Author(s): Gareth Cross, SCH
autogenerated on Mon Jun 10 2019 15:26:53