File tree 1 file changed +23
-3
lines changed
libraries/ESP8266WiFi/src/include
1 file changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -90,20 +90,40 @@ class UdpContext
90
90
}
91
91
}
92
92
93
- bool connect (const ip_addr_t * addr, uint16_t port)
93
+ #if LWIP_VERSION_MAJOR == 1
94
+
95
+ bool connect (IPAddress addr, uint16_t port)
94
96
{
95
- _pcb->remote_ip = * addr;
97
+ _pcb->remote_ip = addr;
96
98
_pcb->remote_port = port;
97
99
return true ;
98
100
}
99
101
100
- bool listen (CONST ip_addr_t * addr, uint16_t port)
102
+ bool listen (IPAddress addr, uint16_t port)
101
103
{
102
104
udp_recv (_pcb, &_s_recv, (void *) this );
103
105
err_t err = udp_bind (_pcb, addr, port);
104
106
return err == ERR_OK;
105
107
}
106
108
109
+ #else // lwIP-v2
110
+
111
+ bool connect (const IPAddress& addr, uint16_t port)
112
+ {
113
+ _pcb->remote_ip = addr;
114
+ _pcb->remote_port = port;
115
+ return true ;
116
+ }
117
+
118
+ bool listen (const IPAddress& addr, uint16_t port)
119
+ {
120
+ udp_recv (_pcb, &_s_recv, (void *) this );
121
+ err_t err = udp_bind (_pcb, addr, port);
122
+ return err == ERR_OK;
123
+ }
124
+
125
+ #endif // lwIP-v2
126
+
107
127
void disconnect ()
108
128
{
109
129
udp_disconnect (_pcb);
You can’t perform that action at this time.
0 commit comments