OmEspHelpers
OmUdp.h
1 #ifndef __OmUdp__
2 #define __OmUdp__
3 
4 #include <stdint.h>
5 #include "WiFiUdp.h"
6 
8 {
9 public:
10  IPAddress ip;
11  uint16_t port;
12  uint16_t size;
13 };
14 class OmUdp
15 {
16 public:
17  WiFiUDP udp;
18  OmUdp *next = NULL; // we maintain a linked list of all udp instances
19  bool udpHere = false;
20  uint16_t portNumber = 0;
21 
22  OmUdp(uint16_t portNumber); // constructor
23 
25  void wifiStatus(const char *ssid, bool trying, bool failure, bool success);
26 
27  // read available udp, return number of bytes if got
28  // or 0 for nothing
29  // or -1 for trouble including too big
30  int checkUdp(uint8_t *data, uint16_t maxPacket, OmUdpPacketInfo *pi = NULL);
31 
32  void sendUdp(IPAddress ipAddress, uint16_t destinationPort, uint8_t *packetBuffer, uint16_t size);
33 
34  static OmUdp *first;
35 };
36 
37 
38 #endif // __OmUdp__
OmUdpPacketInfo
Definition: OmUdp.h:8
OmUdp::wifiStatus
void wifiStatus(const char *ssid, bool trying, bool failure, bool success)
called by OmWebServer
Definition: OmUdp.cpp:4
OmUdp
Definition: OmUdp.h:15