![]() |
0.4.1
|
Class to read out KVH Sensors. More...
Public Member Functions | |
std::unique_ptr< uart::protocol::Packet > | findPacket (uint8_t dataByte) |
Collects data bytes and searches for packages inside of them. | |
KvhUartSensor ()=default | |
Default constructor. | |
KvhUartSensor (const KvhUartSensor &)=delete | |
Copy constructor. | |
KvhUartSensor (KvhUartSensor &&)=delete | |
Move constructor. | |
KvhUartSensor (std::string name) | |
Constructor. | |
uart::sensors::UartSensor * | operator-> () |
Arrow operator overload. | |
KvhUartSensor & | operator= (const KvhUartSensor &)=delete |
Copy assignment operator. | |
KvhUartSensor & | operator= (KvhUartSensor &&)=delete |
Move assignment operator. | |
~KvhUartSensor ()=default | |
Destructor. | |
Static Public Attributes | |
static constexpr uart::Endianness | ENDIANNESS |
Endianess of the sensor. | |
static constexpr uint32_t | HEADER_FMT_A |
Header Format A. | |
static constexpr uint32_t | HEADER_FMT_B |
Header Format B. | |
static constexpr uint32_t | HEADER_FMT_C |
Header Format C. | |
static constexpr uint32_t | HEADER_FMT_XBIT |
Header Format X Bit. | |
static constexpr uint32_t | HEADER_FMT_XBIT2 |
Header Format X Bit 2. | |
Private Types | |
enum | HeaderType : uint8_t { FMT_A , FMT_B , FMT_C , FMT_XBIT , FMT_XBIT2 , FMT_UNKNOWN } |
Possible Header Types. More... | |
enum | TagState : uint8_t { SM_H1 , SM_H2 , SM_H3 , SM_X3 , SM_IDLE } |
Possible states in the header building process. More... | |
Private Member Functions | |
HeaderType | bFindImuHeader (uint8_t ui8Data) |
Function which finds the header from the provided data. | |
void | resetTracking () |
Resets the current message tracking. | |
Static Private Member Functions | |
static bool | checksumFunction (const uart::protocol::Packet &packet) |
Function which is called to verify packet integrity. | |
static bool | isErrorFunction (const uart::protocol::Packet &packet) |
Function which determines, if the packet is an Error Packet. | |
static bool | isResponseFunction (const uart::protocol::Packet &packet) |
Function which determines, if the packet is a Response. | |
static void | packetFinderFunction (const std::vector< uint8_t > &data, const uart::xplat::TimeStamp ×tamp, uart::sensors::UartSensor::ValidPacketFoundHandler dispatchPacket, void *dispatchPacketUserData, void *userData) |
Function which is called to find packets in the provided data buffer. | |
static uart::protocol::Packet::Type | packetTypeFunction (const uart::protocol::Packet &packet) |
Function which is called to determine the packet type (ascii/binary) | |
Private Attributes | |
bool | _asciiEndChar1Found |
Flag if the first ascii end character was found. | |
std::vector< uint8_t > | _buffer |
Buffer to collect messages till they are complete. | |
bool | _currentlyBuildingAsciiPacket |
Flag if currently a ascii packet is built. | |
bool | _currentlyBuildingBinaryPacket |
Flag if currently a binary packet is built. | |
TagState | _eState |
Current state of the header building process. | |
const std::string | _name |
Name of the Parent Node. | |
HeaderType | _packetType |
Current packet type determined by the header. | |
size_t | _runningDataIndex |
Used for correlating raw data with where the packet was found for the end user. | |
uart::sensors::UartSensor | _sensor |
UartSensor object which handles the UART interface. | |
Static Private Attributes | |
static constexpr uint8_t | ASCII_END_CHAR_1 |
First Ascii End character. | |
static constexpr uint8_t | ASCII_END_CHAR_2 |
Second Ascii End character. | |
static constexpr uint8_t | ASCII_ESCAPE_CHAR |
Ascii Escape charater. | |
static constexpr size_t | MAX_SIZE_ASCII_PACKET |
Maximum size of a ascii packet before resetting it. | |
static constexpr size_t | PACKET_HEADER_LENGTH |
Length of the packet header. | |
Class to read out KVH Sensors.
Definition at line 23 of file KvhUartSensor.hpp.
|
private |
Possible Header Types.
Enumerator | |
---|---|
FMT_A | Use header A. |
FMT_B | Use header B. |
FMT_C | Use header C. |
FMT_XBIT | Format XBIT. |
FMT_XBIT2 | Format XBIT2. |
FMT_UNKNOWN | Unknown format. |
Definition at line 127 of file KvhUartSensor.hpp.
|
private |
Possible states in the header building process.
Enumerator | |
---|---|
SM_H1 | H1. |
SM_H2 | H2. |
SM_H3 | H3. |
SM_X3 | X3. |
SM_IDLE | IDLE. |
Definition at line 114 of file KvhUartSensor.hpp.
|
explicit |
Constructor.
[in] | name | Name of the Parent Node |
Definition at line 14 of file KvhUartSensor.cpp.
|
default |
Default constructor.
|
default |
Destructor.
|
delete |
Copy constructor.
|
delete |
Move constructor.
|
private |
Function which finds the header from the provided data.
[in] | ui8Data | Byte to construct the header from |
Definition at line 31 of file KvhUartSensor.cpp.
|
staticprivate |
Function which is called to verify packet integrity.
[in] | packet | Packet to calculate the checksum for |
Definition at line 275 of file KvhUartSensor.cpp.
std::unique_ptr< uart::protocol::Packet > NAV::vendor::kvh::KvhUartSensor::findPacket | ( | uint8_t | dataByte | ) |
Collects data bytes and searches for packages inside of them.
[in] | dataByte | The next data byte |
Definition at line 113 of file KvhUartSensor.cpp.
|
staticprivate |
Function which determines, if the packet is an Error Packet.
[in] | packet | The packet to check |
Definition at line 304 of file KvhUartSensor.cpp.
|
staticprivate |
Function which determines, if the packet is a Response.
[in] | packet | The packet to check |
Definition at line 309 of file KvhUartSensor.cpp.
|
inline |
Arrow operator overload.
Definition at line 43 of file KvhUartSensor.hpp.
|
delete |
Copy assignment operator.
|
delete |
Move assignment operator.
|
staticprivate |
Function which is called to find packets in the provided data buffer.
[in] | data | Raw data buffer which has potential packets inside |
[in] | timestamp | Timestamp then the data in the buffer was received |
[in] | dispatchPacket | Function to call when a complete packet was found |
[in] | dispatchPacketUserData | User data to forward to the dispatchPacket function |
[in] | userData | User data provided when regisering this function. Should contain the sensor object |
Definition at line 233 of file KvhUartSensor.cpp.
|
staticprivate |
Function which is called to determine the packet type (ascii/binary)
[in] | packet | Packet to check the type of |
Definition at line 249 of file KvhUartSensor.cpp.
|
private |
Resets the current message tracking.
Definition at line 20 of file KvhUartSensor.cpp.
|
private |
Flag if the first ascii end character was found.
Definition at line 111 of file KvhUartSensor.hpp.
|
private |
Buffer to collect messages till they are complete.
Definition at line 146 of file KvhUartSensor.hpp.
|
private |
Flag if currently a ascii packet is built.
Definition at line 108 of file KvhUartSensor.hpp.
|
private |
Flag if currently a binary packet is built.
Definition at line 109 of file KvhUartSensor.hpp.
|
private |
Current state of the header building process.
Definition at line 124 of file KvhUartSensor.hpp.
|
private |
Name of the Parent Node.
Definition at line 60 of file KvhUartSensor.hpp.
|
private |
Current packet type determined by the header.
Definition at line 138 of file KvhUartSensor.hpp.
|
private |
Used for correlating raw data with where the packet was found for the end user.
Definition at line 149 of file KvhUartSensor.hpp.
|
private |
UartSensor object which handles the UART interface.
Definition at line 63 of file KvhUartSensor.hpp.
|
staticconstexprprivate |
First Ascii End character.
Definition at line 103 of file KvhUartSensor.hpp.
|
staticconstexprprivate |
Second Ascii End character.
Definition at line 104 of file KvhUartSensor.hpp.
|
staticconstexprprivate |
Ascii Escape charater.
Definition at line 105 of file KvhUartSensor.hpp.
|
staticconstexpr |
Endianess of the sensor.
Definition at line 56 of file KvhUartSensor.hpp.
|
staticconstexpr |
Header Format A.
Definition at line 50 of file KvhUartSensor.hpp.
|
staticconstexpr |
Header Format B.
Definition at line 51 of file KvhUartSensor.hpp.
|
staticconstexpr |
Header Format C.
Definition at line 52 of file KvhUartSensor.hpp.
|
staticconstexpr |
Header Format X Bit.
Definition at line 53 of file KvhUartSensor.hpp.
|
staticconstexpr |
Header Format X Bit 2.
Definition at line 54 of file KvhUartSensor.hpp.
|
staticconstexprprivate |
Maximum size of a ascii packet before resetting it.
Definition at line 106 of file KvhUartSensor.hpp.
|
staticconstexprprivate |
Length of the packet header.
Definition at line 101 of file KvhUartSensor.hpp.