UdpConnection.h
Go to the documentation of this file.
23 typedef Delegate<void(UdpConnection& connection, char* data, int size, IpAddress remoteIP, uint16_t remotePort)>
78 static void staticOnReceive(void* arg, struct udp_pcb* pcb, struct pbuf* p, LWIP_IP_ADDR_T* addr, u16_t port);
virtual bool sendTo(IpAddress remoteIP, uint16_t remotePort, const char *data, int length)
A class to make it easier to handle and pass around IP addresses.
Definition: IpAddress.h:43
Definition: UdpConnection.h:26
bool sendStringTo(IpAddress remoteIP, uint16_t remotePort, const char *data)
Definition: UdpConnection.h:63
const char * c_str() const
Get a constant (un-modifiable) pointer to String content.
Definition: WString.h:600
UdpConnection(UdpConnectionDataDelegate dataHandler)
Definition: UdpConnection.h:34
Delegate< void(UdpConnection &connection, char *data, int size, IpAddress remoteIP, uint16_t remotePort)> UdpConnectionDataDelegate
Definition: UdpConnection.h:21
static void staticOnReceive(void *arg, struct udp_pcb *pcb, struct pbuf *p, LWIP_IP_ADDR_T *addr, u16_t port)
size_t length(void) const
Obtain the String length in characters, excluding NUL terminator.
Definition: WString.h:228
bool initialize(udp_pcb *pcb=nullptr)
virtual bool connect(IpAddress ip, uint16_t port)
virtual bool send(const char *data, int length)
virtual void close()
bool sendStringTo(IpAddress remoteIP, uint16_t remotePort, const String &data)
Definition: UdpConnection.h:68
virtual void onReceive(pbuf *buf, IpAddress remoteIP, uint16_t remotePort)
virtual bool listen(int port)