You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libraries/WiFiS3/src/WiFiUdp.h
+187-25
Original file line number
Diff line number
Diff line change
@@ -30,6 +30,13 @@
30
30
#include"Modem.h"
31
31
#include"FifoBuffer.h"
32
32
33
+
/**
34
+
* @brief A class for handling UDP communication over a Wi-Fi network.
35
+
*
36
+
* The WiFiUDP class is an extension of the UDP class that enables sending and receiving UDP packets
37
+
* over a Wi-Fi network. It provides functions for initialization, packet transmission, and reception
38
+
* tailored for Wi-Fi connectivity.
39
+
*/
33
40
classWiFiUDP : publicUDP {
34
41
private:
35
42
int _sock;
@@ -41,57 +48,212 @@ class WiFiUDP : public UDP {
41
48
virtualvoidread_if_needed(size_t s);
42
49
43
50
public:
44
-
WiFiUDP(); // Constructor
45
-
virtualuint8_tbegin(uint16_t); // initialize, start listening on specified port. Returns 1 if successful, 0 if there are no sockets available to use
51
+
/**
52
+
* @brief Default constructor for the WiFiUDP class.
53
+
*/
54
+
WiFiUDP();
55
+
56
+
/**
57
+
* @brief Starts a UDP socket on the specified local port.
58
+
*
59
+
* @param `uint16_t` The local port number to bind the UDP socket to.
60
+
*
61
+
* @return Returns `1` if the socket is successfully opened, or
62
+
* `0` if the socket is already in use or could not be opened.
63
+
*/
64
+
virtualuint8_tbegin(uint16_t);
65
+
66
+
/**
67
+
* @brief Starts a UDP socket bound to a specific IP address and port.
68
+
*
69
+
* @param `a` The local IP address to bind the UDP socket to.
70
+
* @param `p` The local port number to bind the UDP socket to.
71
+
*
72
+
* @return Returns `1` if the socket is successfully opened, or
73
+
* `0` if the socket is already in use or could not be opened.
74
+
*/
46
75
virtualuint8_tbegin(IPAddress a, uint16_t p);
47
-
virtualuint8_tbeginMulticast(IPAddress, uint16_t); // initialize, start listening on specified multicast IP address and port. Returns 1 if successful, 0 if there are no sockets available to use
48
-
virtualvoidstop(); // Finish with the UDP socket
76
+
77
+
/**
78
+
* @brief Starts a UDP multicast socket bound to a specific IP address and port.
79
+
*
80
+
* @param `IPAddress` The multicast IP address to bind the UDP socket to.
81
+
* @param `uint16_t` The port number to bind the UDP socket to.
82
+
*
83
+
* @return Returns `1` if the socket is successfully opened, or
84
+
* `0` if the socket is already in use or could not be opened.
0 commit comments