![]() |
0.5.1
|
Class to read out LN-200 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. | |
| Ln200UartSensor ()=default | |
| Default constructor. | |
| Ln200UartSensor (const Ln200UartSensor &)=delete | |
| Copy constructor. | |
| Ln200UartSensor (Ln200UartSensor &&)=delete | |
| Move constructor. | |
| Ln200UartSensor (std::string name) | |
| Constructor. | |
| uart::sensors::UartSensor * | operator-> () |
| Arrow operator overload. | |
| Ln200UartSensor & | operator= (const Ln200UartSensor &)=delete |
| Copy assignment operator. | |
| Ln200UartSensor & | operator= (Ln200UartSensor &&)=delete |
| Move assignment operator. | |
| ~Ln200UartSensor ()=default | |
| Destructor. | |
Private Types | |
| enum class | State : uint8_t { Idle , Receiving } |
| Operational states of the LN-200 UART sensor node. More... | |
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 | |
| ScrollingBuffer< bool > | _bitBuffer |
| Buffer to accumulate bits of the current frame. | |
| int | _consecutiveOnes |
| Counter for bit insertion. | |
| ScrollingBuffer< bool > | _flagWindow |
| Sliding window buffer to detect flags. | |
| const std::string | _name |
| Name of the Parent Node. | |
| 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. | |
| State | _state |
| Internal state of the sensor. | |
| bool | _wasIdle |
| Flag to detect the start of a frame. | |
Static Private Attributes | |
| static constexpr uart::Endianness | ENDIANNESS |
| Endianess of the sensor. | |
| 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 LN-200 Sensors.
The class is used to read out the LN-200 IMU via UART with 2000
Message content mapping:
Definition at line 46 of file Ln200UartSensor.hpp.
|
strongprivate |
Operational states of the LN-200 UART sensor node.
| Enumerator | |
|---|---|
| Idle | Sensor is idle. |
| Receiving | Sensor is receiving data. |
Definition at line 121 of file Ln200UartSensor.hpp.
|
explicit |
Constructor.
| [in] | name | Name of the Parent Node |
Definition at line 13 of file Ln200UartSensor.cpp.
|
default |
Default constructor.
|
default |
Destructor.
|
delete |
Copy constructor.
|
delete |
Move constructor.
|
staticprivate |
Function which is called to verify packet integrity.
| [in] | packet | Packet to calculate the checksum for |
Definition at line 159 of file Ln200UartSensor.cpp.
| std::unique_ptr< uart::protocol::Packet > NAV::vendor::ln::Ln200UartSensor::findPacket | ( | uint8_t | dataByte | ) |
Collects data bytes and searches for packages inside of them.
| [in] | dataByte | The next data byte |
Definition at line 17 of file Ln200UartSensor.cpp.
|
staticprivate |
Function which determines, if the packet is an Error Packet.
| [in] | packet | The packet to check |
Definition at line 170 of file Ln200UartSensor.cpp.
|
staticprivate |
Function which determines, if the packet is a Response.
| [in] | packet | The packet to check |
Definition at line 175 of file Ln200UartSensor.cpp.
|
inline |
Arrow operator overload.
Definition at line 66 of file Ln200UartSensor.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 138 of file Ln200UartSensor.cpp.
|
staticprivate |
Function which is called to determine the packet type (ascii/binary)
| [in] | packet | Packet to check the type of |
Definition at line 154 of file Ln200UartSensor.cpp.
|
private |
Buffer to accumulate bits of the current frame.
Definition at line 131 of file Ln200UartSensor.hpp.
|
private |
Counter for bit insertion.
Definition at line 140 of file Ln200UartSensor.hpp.
|
private |
Sliding window buffer to detect flags.
Definition at line 134 of file Ln200UartSensor.hpp.
|
private |
Name of the Parent Node.
Definition at line 75 of file Ln200UartSensor.hpp.
|
private |
Used for correlating raw data with where the packet was found for the end user.
Definition at line 143 of file Ln200UartSensor.hpp.
|
private |
UartSensor object which handles the UART interface.
Definition at line 78 of file Ln200UartSensor.hpp.
|
private |
Internal state of the sensor.
Definition at line 128 of file Ln200UartSensor.hpp.
|
private |
Flag to detect the start of a frame.
Definition at line 137 of file Ln200UartSensor.hpp.
|
staticconstexprprivate |
Endianess of the sensor.
Definition at line 116 of file Ln200UartSensor.hpp.
|
staticconstexprprivate |
Maximum size of a ascii packet before resetting it.
Definition at line 118 of file Ln200UartSensor.hpp.
|
staticconstexprprivate |
Length of the packet header.
Definition at line 117 of file Ln200UartSensor.hpp.