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

#include <UdpTransceiver.h>

Inheritance diagram for Boardcore::UdpTransceiver:
Collaboration diagram for Boardcore::UdpTransceiver:

Public Member Functions

 UdpTransceiver (std::shared_ptr< Wiz5500 > wiz, int sock_n)
 
 ~UdpTransceiver ()
 
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.
 
bool open (uint16_t recv_port, Boardcore::WizIp send_ip, uint16_t send_port)
 Open this UdpTransceiver on the specified ports.
 
void close ()
 Close this transceiver.
 
- Public Member Functions inherited from Boardcore::Transceiver
 Transceiver ()
 
virtual ~Transceiver ()
 

Detailed Description

Definition at line 33 of file UdpTransceiver.h.

Constructor & Destructor Documentation

◆ UdpTransceiver()

Boardcore::UdpTransceiver::UdpTransceiver ( std::shared_ptr< Wiz5500 > wiz,
int sock_n )
inline

Definition at line 36 of file UdpTransceiver.h.

◆ ~UdpTransceiver()

Boardcore::UdpTransceiver::~UdpTransceiver ( )
inline

Definition at line 41 of file UdpTransceiver.h.

Member Function Documentation

◆ close()

void Boardcore::UdpTransceiver::close ( )
inline

Close this transceiver.

Definition at line 71 of file UdpTransceiver.h.

◆ open()

bool Boardcore::UdpTransceiver::open ( uint16_t recv_port,
Boardcore::WizIp send_ip,
uint16_t send_port )
inline

Open this UdpTransceiver on the specified ports.

Parameters
recv_portPort to receive data from.
send_ipIP to send data to.
send_portPort to send data to.

Definition at line 63 of file UdpTransceiver.h.

◆ receive()

ssize_t Boardcore::UdpTransceiver::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 49 of file UdpTransceiver.h.

◆ send()

bool Boardcore::UdpTransceiver::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 47 of file UdpTransceiver.h.


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