43 uart::sensors::UartSensor*
operator->() {
return &_sensor; };
48 std::unique_ptr<uart::protocol::Packet>
findPacket(uint8_t dataByte);
56 static constexpr uart::Endianness
ENDIANNESS = uart::Endianness::ENDIAN_BIG;
60 const std::string _name;
70 PACKET_HEADER_LENGTH };
78 static void packetFinderFunction(
const std::vector<uint8_t>& data,
79 const uart::xplat::TimeStamp& timestamp,
80 uart::sensors::UartSensor::ValidPacketFoundHandler dispatchPacket,
void* dispatchPacketUserData,
86 static uart::protocol::Packet::Type packetTypeFunction(
const uart::protocol::Packet& packet);
91 static bool checksumFunction(
const uart::protocol::Packet& packet);
95 static bool isErrorFunction(
const uart::protocol::Packet& packet);
99 static bool isResponseFunction(
const uart::protocol::Packet& packet);
101 static constexpr size_t PACKET_HEADER_LENGTH = 0;
103 static constexpr uint8_t ASCII_END_CHAR_1 =
'\r';
104 static constexpr uint8_t ASCII_END_CHAR_2 =
'\n';
105 static constexpr uint8_t ASCII_ESCAPE_CHAR =
'\0';
106 static constexpr size_t MAX_SIZE_ASCII_PACKET = 256;
108 bool _currentlyBuildingAsciiPacket{
false };
109 bool _currentlyBuildingBinaryPacket{
false };
111 bool _asciiEndChar1Found{
false };
124 TagState _eState = SM_IDLE;
138 HeaderType _packetType = HeaderType::FMT_UNKNOWN;
143 HeaderType bFindImuHeader(uint8_t ui8Data);
146 std::vector<uint8_t> _buffer;
149 size_t _runningDataIndex{ 0 };
152 void resetTracking();