Skyward boardcore
Loading...
Searching...
No Matches
Boardcore::ConsoleTransceiver Class Reference

#include <ConsoleTransceiver.h>

Inheritance diagram for Boardcore::ConsoleTransceiver:
Collaboration diagram for Boardcore::ConsoleTransceiver:

Public Member Functions

bool send (uint8_t *pkt, size_t len)
 Send a packet.
 
ssize_t receive (uint8_t *pkt, size_t len)
 Wait until a new packet is received.
 
- Public Member Functions inherited from Boardcore::Transceiver
 Transceiver ()
 
virtual ~Transceiver ()
 

Detailed Description

Definition at line 31 of file ConsoleTransceiver.h.

Member Function Documentation

◆ receive()

ssize_t Boardcore::ConsoleTransceiver::receive ( uint8_t * packet,
size_t packetLength )
inlinevirtual

Wait until a new packet is received.

Parameters
packetBuffer to store the packet (at least packetLength bytes).
packetLengthMaximum length of the received data.
Returns
Size of the data received or -1 if failure

Implements Boardcore::Transceiver.

Definition at line 40 of file ConsoleTransceiver.h.

◆ send()

bool Boardcore::ConsoleTransceiver::send ( uint8_t * packet,
size_t packetLength )
inlinevirtual

Send a packet.

The function must block the thread until the packet is sent (successfully or not).

Parameters
packetPointer to the packet (at least packetLength bytes).
packetLengthLength of the packet to be sent.
Returns
True if the message was sent correctly.

Implements Boardcore::Transceiver.

Definition at line 34 of file ConsoleTransceiver.h.


The documentation for this class was generated from the following file: