Class to read out Espressif Sensors.
More...
|
static constexpr uint8_t | BINARY_SYNC_CHAR_1 |
| µ - First sync character which begins a new binary message
|
|
static constexpr uint8_t | BINARY_SYNC_CHAR_2 |
| b - Second sync character which begins a new binary message
|
|
|
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)
|
|
|
static constexpr uart::Endianness | ENDIANNESS |
| Endianess of the sensor.
|
|
static constexpr size_t | PACKET_HEADER_LENGTH |
| Length of the header of each packet.
|
|
Class to read out Espressif Sensors.
Definition at line 24 of file EspressifUartSensor.hpp.
◆ EspressifUartSensor() [1/4]
NAV::vendor::espressif::EspressifUartSensor::EspressifUartSensor |
( |
std::string | name | ) |
|
|
explicit |
◆ EspressifUartSensor() [2/4]
NAV::vendor::espressif::EspressifUartSensor::EspressifUartSensor |
( |
| ) |
|
|
default |
◆ ~EspressifUartSensor()
NAV::vendor::espressif::EspressifUartSensor::~EspressifUartSensor |
( |
| ) |
|
|
default |
◆ EspressifUartSensor() [3/4]
NAV::vendor::espressif::EspressifUartSensor::EspressifUartSensor |
( |
const EspressifUartSensor & | | ) |
|
|
delete |
◆ EspressifUartSensor() [4/4]
◆ checksumFunction()
bool NAV::vendor::espressif::EspressifUartSensor::checksumFunction |
( |
const uart::protocol::Packet & | packet | ) |
|
|
staticprivate |
Function which is called to verify packet integrity.
- Parameters
-
[in] | packet | Packet to calculate the checksum for |
- Returns
- True if the packet is fault free
Definition at line 135 of file EspressifUartSensor.cpp.
◆ findPacket()
std::unique_ptr< uart::protocol::Packet > NAV::vendor::espressif::EspressifUartSensor::findPacket |
( |
uint8_t | dataByte | ) |
|
Collects data bytes and searches for packages inside of them.
- Parameters
-
[in] | dataByte | The next data byte |
- Returns
- nullptr if no packet found yet, otherwise a pointer to the packet
Definition at line 32 of file EspressifUartSensor.cpp.
◆ isErrorFunction()
bool NAV::vendor::espressif::EspressifUartSensor::isErrorFunction |
( |
const uart::protocol::Packet & | packet | ) |
|
|
staticprivate |
Function which determines, if the packet is an Error Packet.
- Parameters
-
[in] | packet | The packet to check |
Definition at line 151 of file EspressifUartSensor.cpp.
◆ isResponseFunction()
bool NAV::vendor::espressif::EspressifUartSensor::isResponseFunction |
( |
const uart::protocol::Packet & | packet | ) |
|
|
staticprivate |
Function which determines, if the packet is a Response.
- Parameters
-
[in] | packet | The packet to check |
Definition at line 156 of file EspressifUartSensor.cpp.
◆ operator->()
uart::sensors::UartSensor * NAV::vendor::espressif::EspressifUartSensor::operator-> |
( |
| ) |
|
|
inline |
◆ operator=() [1/2]
Copy assignment operator.
◆ operator=() [2/2]
Move assignment operator.
◆ packetFinderFunction()
void NAV::vendor::espressif::EspressifUartSensor::packetFinderFunction |
( |
const std::vector< uint8_t > & | data, |
|
|
const uart::xplat::TimeStamp & | timestamp, |
|
|
uart::sensors::UartSensor::ValidPacketFoundHandler | dispatchPacket, |
|
|
void * | dispatchPacketUserData, |
|
|
void * | userData ) |
|
staticprivate |
Function which is called to find packets in the provided data buffer.
- Parameters
-
[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 106 of file EspressifUartSensor.cpp.
◆ packetTypeFunction()
uart::protocol::Packet::Type NAV::vendor::espressif::EspressifUartSensor::packetTypeFunction |
( |
const uart::protocol::Packet & | packet | ) |
|
|
staticprivate |
Function which is called to determine the packet type (ascii/binary)
- Parameters
-
[in] | packet | Packet to check the type of |
- Returns
- The type of the packet
Definition at line 122 of file EspressifUartSensor.cpp.
◆ resetTracking()
void NAV::vendor::espressif::EspressifUartSensor::resetTracking |
( |
| ) |
|
|
private |
◆ _binaryPayloadLength
uint16_t NAV::vendor::espressif::EspressifUartSensor::_binaryPayloadLength |
|
private |
◆ _binaryPayloadLength1Found
bool NAV::vendor::espressif::EspressifUartSensor::_binaryPayloadLength1Found |
|
private |
◆ _binaryPayloadLength2Found
bool NAV::vendor::espressif::EspressifUartSensor::_binaryPayloadLength2Found |
|
private |
◆ _binarySyncChar2Found
bool NAV::vendor::espressif::EspressifUartSensor::_binarySyncChar2Found |
|
private |
◆ _buffer
std::vector<uint8_t> NAV::vendor::espressif::EspressifUartSensor::_buffer |
|
private |
◆ _currentlyBuildingBinaryPacket
bool NAV::vendor::espressif::EspressifUartSensor::_currentlyBuildingBinaryPacket |
|
private |
◆ _name
const std::string NAV::vendor::espressif::EspressifUartSensor::_name |
|
private |
◆ _numOfBytesRemainingForCompletePacket
size_t NAV::vendor::espressif::EspressifUartSensor::_numOfBytesRemainingForCompletePacket |
|
private |
◆ _runningDataIndex
size_t NAV::vendor::espressif::EspressifUartSensor::_runningDataIndex |
|
private |
Used for correlating raw data with where the packet was found for the end user.
Definition at line 113 of file EspressifUartSensor.hpp.
◆ _sensor
uart::sensors::UartSensor NAV::vendor::espressif::EspressifUartSensor::_sensor |
|
private |
◆ BINARY_SYNC_CHAR_1
uint8_t NAV::vendor::espressif::EspressifUartSensor::BINARY_SYNC_CHAR_1 |
|
staticconstexpr |
◆ BINARY_SYNC_CHAR_2
uint8_t NAV::vendor::espressif::EspressifUartSensor::BINARY_SYNC_CHAR_2 |
|
staticconstexpr |
◆ ENDIANNESS
uart::Endianness NAV::vendor::espressif::EspressifUartSensor::ENDIANNESS |
|
staticconstexprprivate |
◆ PACKET_HEADER_LENGTH
size_t NAV::vendor::espressif::EspressifUartSensor::PACKET_HEADER_LENGTH |
|
staticconstexprprivate |
The documentation for this class was generated from the following files: