#include <UdpConnection.h>

Inheritance diagram for UdpConnection:
[legend]
Collaboration diagram for UdpConnection:
[legend]

Public Member Functions

 UdpConnection ()
 
 UdpConnection (UdpConnectionDataDelegate dataHandler)
 
virtual ~UdpConnection ()
 
virtual bool listen (int port)
 
virtual bool connect (IpAddress ip, uint16_t port)
 
virtual void close ()
 
virtual bool send (const char *data, int length)
 
bool sendString (const char *data)
 
bool sendString (const String &data)
 
virtual bool sendTo (IpAddress remoteIP, uint16_t remotePort, const char *data, int length)
 
bool sendStringTo (IpAddress remoteIP, uint16_t remotePort, const char *data)
 
bool sendStringTo (IpAddress remoteIP, uint16_t remotePort, const String &data)
 

Protected Member Functions

virtual void onReceive (pbuf *buf, IpAddress remoteIP, uint16_t remotePort)
 
bool initialize (udp_pcb *pcb=nullptr)
 

Static Protected Member Functions

static void staticOnReceive (void *arg, struct udp_pcb *pcb, struct pbuf *p, LWIP_IP_ADDR_T *addr, u16_t port)
 

Protected Attributes

udp_pcb * udp = nullptr
 
UdpConnectionDataDelegate onDataCallback = nullptr
 

Constructor & Destructor Documentation

◆ UdpConnection() [1/2]

UdpConnection::UdpConnection ( )
inline

◆ UdpConnection() [2/2]

UdpConnection::UdpConnection ( UdpConnectionDataDelegate  dataHandler)
inline

◆ ~UdpConnection()

virtual UdpConnection::~UdpConnection ( )
inlinevirtual

Member Function Documentation

◆ close()

virtual void UdpConnection::close ( )
virtual

◆ connect()

virtual bool UdpConnection::connect ( IpAddress  ip,
uint16_t  port 
)
virtual

◆ initialize()

bool UdpConnection::initialize ( udp_pcb *  pcb = nullptr)
protected

◆ listen()

virtual bool UdpConnection::listen ( int  port)
virtual

◆ onReceive()

virtual void UdpConnection::onReceive ( pbuf *  buf,
IpAddress  remoteIP,
uint16_t  remotePort 
)
protectedvirtual

Reimplemented in NtpClient, and DnsServer.

◆ send()

virtual bool UdpConnection::send ( const char *  data,
int  length 
)
virtual

◆ sendString() [1/2]

bool UdpConnection::sendString ( const char *  data)
inline

◆ sendString() [2/2]

bool UdpConnection::sendString ( const String data)
inline

◆ sendStringTo() [1/2]

bool UdpConnection::sendStringTo ( IpAddress  remoteIP,
uint16_t  remotePort,
const char *  data 
)
inline

◆ sendStringTo() [2/2]

bool UdpConnection::sendStringTo ( IpAddress  remoteIP,
uint16_t  remotePort,
const String data 
)
inline

◆ sendTo()

virtual bool UdpConnection::sendTo ( IpAddress  remoteIP,
uint16_t  remotePort,
const char *  data,
int  length 
)
virtual

◆ staticOnReceive()

static void UdpConnection::staticOnReceive ( void *  arg,
struct udp_pcb *  pcb,
struct pbuf *  p,
LWIP_IP_ADDR_T addr,
u16_t  port 
)
staticprotected

Member Data Documentation

◆ onDataCallback

UdpConnectionDataDelegate UdpConnection::onDataCallback = nullptr
protected

◆ udp

udp_pcb* UdpConnection::udp = nullptr
protected

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