UdpConnection.h
Go to the documentation of this file.
25 Delegate<void(UdpConnection& connection, char* data, int size, IpAddress remoteIP, uint16_t remotePort)>;
100 static void staticOnReceive(void* arg, struct udp_pcb* pcb, struct pbuf* p, LWIP_IP_ADDR_T* addr, u16_t port);
A class to make it easier to handle and pass around IP addresses.
Definition: IpAddress.h:45
Definition: IpConnection.h:22
const char * c_str() const
Get a constant (un-modifiable) pointer to String content.
Definition: WString.h:616
size_t length(void) const
Obtain the String length in characters, excluding NUL terminator.
Definition: WString.h:243
Definition: UdpConnection.h:28
UdpConnectionDataDelegate onDataCallback
Definition: UdpConnection.h:104
virtual bool sendTo(IpAddress remoteIP, uint16_t remotePort, const char *data, int length)
virtual bool listen(int port)
bool sendStringTo(IpAddress remoteIP, uint16_t remotePort, const char *data)
Definition: UdpConnection.h:64
bool setMulticastTtl(size_t ttl)
Sets the UDP multicast Time-To-Live(TTL).
virtual void close()
virtual bool send(const char *data, int length)
virtual bool connect(IpAddress ip, uint16_t port)
bool sendStringTo(IpAddress remoteIP, uint16_t remotePort, const String &data)
Definition: UdpConnection.h:69
bool initialize(udp_pcb *pcb=nullptr)
static void staticOnReceive(void *arg, struct udp_pcb *pcb, struct pbuf *p, LWIP_IP_ADDR_T *addr, u16_t port)
virtual void onReceive(pbuf *buf, IpAddress remoteIP, uint16_t remotePort)
UdpConnection(UdpConnectionDataDelegate dataHandler)
Definition: UdpConnection.h:35