AMS Advanced Air Mobility Sensors UG
Loading...
Searching...
No Matches
CSerialProtocol Class Reference

The class that describes and implements the BAHRS serial protocol. More...

Classes

struct  SMessageHeader
 Message header struct. More...
struct  SInertialData
 Inertial data message payload. More...
struct  STimeOfInertialData
 Payload of the time of inertial data message. More...
struct  SNavigationData
 Navigation data message payload. More...
struct  STimeOfNavigationData
 Payload of the "time of navigation data" message. More...
struct  SAccuracyData
 Accuracy message payload. More...
struct  STimeOfLatestSyncPulse
 Payload of the "time of the latest pulse" message. More...
struct  SSoftwareVersionData
 Payload of the "software version" message. More...
struct  SHardwareVersionData
 Payload of the "Hardware version" message. More...
struct  SWriteToPortEventPartialData
 Partial data of the "write to port event". The struct does not include a variable size array of data written to a port. More...
struct  SRunnableCallEventData
 Debug information on runnable call. More...
struct  SInertialDataMessage
 Inertial data message. More...
struct  STimeOfInertialDataMessage
 Time of inertial data message. More...
struct  SNavigationDataMessage
 Navigation data message. More...
struct  SAccuracyDataMessage
 Navigation data accuracy message. More...
struct  STimeOfNavigationDataMessage
 Time of navigation data message. More...
struct  STimeOfLatestSyncPulseMessage
 Time of the latest sync pulse message. More...
struct  SSoftwareVersionMessage
 Software version message. More...
struct  SHardwareVersionMessage
struct  SRunnableCallEventDebugMessage
 A debug message with runnable call data. More...
struct  SPacketReadNVMPage
 Diagnostic Mode Messages. More...
struct  SPacketReceiveConfirmation
 Diagnostic message: confirmation of request processing by the device. More...
struct  SPacketNVMPage
 Diagnostic message: One NVM page ( both: RX & TX ). More...

Public Types

enum class  EMessageIds : uint8_t {
  eInvalid = 0x00 , eInertialData = 0x01 , eNavigationData = 0x02 , eAccuracy = 0x03 ,
  eTimeOfNavigationData = 0x04 , eTimeOfInertialData = 0x05 , eTimeOfSyncPulse = 0x06 , eSoftwareVersion = 0x0F ,
  eHardwareVersion = 0x1F , eDebugEventWriteToPort = 0xC0 , eDebugEventRunnableCall = 0xC1 , eTypeOpenDiagnostic = 0xF0 ,
  eTypeCloseDiagnostic = 0xF1 , eTypeReadNVMPage = 0xF2 , eTypeNVMPageData = 0xF3 , eTypeAccept = 0xFF
}
enum class  ESignalHealthInfo : uint8_t { eUnavailable = 0U , eSafe , eIntegrityRisk }
using CrcType_t = uint32_t

Public Member Functions

 CSerialProtocol ()=default
 ~CSerialProtocol ()=default

Static Public Attributes

static constexpr uint8_t uMarker1_ { 0x4E }
 Sync byte 1, symbol 'N'.
static constexpr uint8_t uMarker2_ { 0x45 }
 Sync char 2, symbol 'E'.
static constexpr uint16_t uVersion_ { 3U }
 Protocol version.
static constexpr float skfMaxHeight_ { 10000.0F }
static constexpr float skfMinHeight_ { -1000.0F }
static constexpr float skfMaxVelocityDown_ { 300.0F }
static constexpr float skfMinVelocityDown_ { -300.0F }
static constexpr float skfMaxAngularRate_ { 300.0F * (CMathConstants::skfPi_ / 180.0F) }
 +-300 [deg/s] in [rad/s]
static constexpr float skfMaxSpecificForce_ { CGeoConstants::skfGravity * 5.0F }
 +-5 [g] in [m/s^2]
static constexpr float skfSpecificForceScale_ { skfMaxSpecificForce_ / static_cast<float>(std::numeric_limits<int16_t>::max()) }
 Integer to float, +-5g range.
static constexpr float skfAngularRateScale_ { skfMaxAngularRate_ / static_cast<float>(std::numeric_limits<int16_t>::max()) }
 Integer to float, +-300 deg/s range.
static constexpr float skfHeightScale_ { 0.16784924F }
 Integer to float, -1000 to 10000 m range.
static constexpr float skfHeighOffset_ { 1000.0F }
 An offset to convert unsigned integer to float.
static constexpr float skfVelocityDownScale_ { 9.155413e-3F }
 Integer to float, -300 to 300 m/s range.
static constexpr float skfAngleScale_ { 9.587526e-5F }
 Integer to float, -pi to pi or 0 to 2 pi range.

Detailed Description

The class that describes and implements the BAHRS serial protocol.

Member Typedef Documentation

◆ CrcType_t

using CSerialProtocol::CrcType_t = uint32_t

Member Enumeration Documentation

◆ EMessageIds

enum class CSerialProtocol::EMessageIds : uint8_t
strong
Enumerator
eInvalid 

Invalid.

eInertialData 

Inertial data message.

eNavigationData 

Navigation data message.

eAccuracy 

Attitude accuracy information.

eTimeOfNavigationData 

"Time of navigation data" message

eTimeOfInertialData 

"Time of inertial data" message

eTimeOfSyncPulse 

"Time of the latest sync pulse" message

eSoftwareVersion 

"Software version" message

eHardwareVersion 

"Hardware version" message

eDebugEventWriteToPort 

Debug information: SWC port data.

eDebugEventRunnableCall 

Debug information: SWC API call.

eTypeOpenDiagnostic 

Request to enter diagnostics mode.

eTypeCloseDiagnostic 

Request to exit diagnostics mode.

eTypeReadNVMPage 

Request to read NVM page.

eTypeNVMPageData 

A message with NVM page data.

eTypeAccept 

Acknowledgment of diagnostics message reception.

◆ ESignalHealthInfo

enum class CSerialProtocol::ESignalHealthInfo : uint8_t
strong
Enumerator
eUnavailable 
eSafe 
eIntegrityRisk 

Constructor & Destructor Documentation

◆ CSerialProtocol()

CSerialProtocol::CSerialProtocol ( )
default

◆ ~CSerialProtocol()

CSerialProtocol::~CSerialProtocol ( )
default

Member Data Documentation

◆ skfAngleScale_

float CSerialProtocol::skfAngleScale_ { 9.587526e-5F }
staticconstexpr

Integer to float, -pi to pi or 0 to 2 pi range.

◆ skfAngularRateScale_

float CSerialProtocol::skfAngularRateScale_ { skfMaxAngularRate_ / static_cast<float>(std::numeric_limits<int16_t>::max()) }
staticconstexpr

Integer to float, +-300 deg/s range.

◆ skfHeighOffset_

float CSerialProtocol::skfHeighOffset_ { 1000.0F }
staticconstexpr

An offset to convert unsigned integer to float.

◆ skfHeightScale_

float CSerialProtocol::skfHeightScale_ { 0.16784924F }
staticconstexpr

Integer to float, -1000 to 10000 m range.

◆ skfMaxAngularRate_

float CSerialProtocol::skfMaxAngularRate_ { 300.0F * (CMathConstants::skfPi_ / 180.0F) }
staticconstexpr

+-300 [deg/s] in [rad/s]

◆ skfMaxHeight_

float CSerialProtocol::skfMaxHeight_ { 10000.0F }
staticconstexpr

◆ skfMaxSpecificForce_

float CSerialProtocol::skfMaxSpecificForce_ { CGeoConstants::skfGravity * 5.0F }
staticconstexpr

+-5 [g] in [m/s^2]

◆ skfMaxVelocityDown_

float CSerialProtocol::skfMaxVelocityDown_ { 300.0F }
staticconstexpr

◆ skfMinHeight_

float CSerialProtocol::skfMinHeight_ { -1000.0F }
staticconstexpr

◆ skfMinVelocityDown_

float CSerialProtocol::skfMinVelocityDown_ { -300.0F }
staticconstexpr

◆ skfSpecificForceScale_

float CSerialProtocol::skfSpecificForceScale_ { skfMaxSpecificForce_ / static_cast<float>(std::numeric_limits<int16_t>::max()) }
staticconstexpr

Integer to float, +-5g range.

◆ skfVelocityDownScale_

float CSerialProtocol::skfVelocityDownScale_ { 9.155413e-3F }
staticconstexpr

Integer to float, -300 to 300 m/s range.

◆ uMarker1_

uint8_t CSerialProtocol::uMarker1_ { 0x4E }
staticconstexpr

Sync byte 1, symbol 'N'.

◆ uMarker2_

uint8_t CSerialProtocol::uMarker2_ { 0x45 }
staticconstexpr

Sync char 2, symbol 'E'.

◆ uVersion_

uint16_t CSerialProtocol::uVersion_ { 3U }
staticconstexpr

Protocol version.


The documentation for this class was generated from the following file: