39 bool send(uint8_t* packet,
size_t packetLength)
41 usart.
write(packet, packetLength);
45 ssize_t
receive(uint8_t* packet,
size_t packetLength)
48 bool result = usart.
readBlocking(packet, packetLength, bytesRead);
49 return result ? bytesRead : 0;
SerialTransceiver(USARTInterface &usart)
bool send(uint8_t *packet, size_t packetLength)
Send a packet.
ssize_t receive(uint8_t *packet, size_t packetLength)
Wait until a new packet is received.
Abstract class that implements the interface for the USART/UART serial communication.
virtual bool readBlocking(void *buffer, size_t nBytes, std::chrono::nanoseconds timeout=std::chrono::nanoseconds::zero())
Blocking read operation to read nBytes until the data transfer is complete or the timeout is reached.
virtual void write(const void *buf, size_t nBytes)=0
Blocking write operation.
This file includes all the types the logdecoder script will decode.