@@ -17,6 +17,12 @@ extern "C" {
17
17
18
18
#define NBNSQ_TYPE_NB (0x0020 )
19
19
#define NBNSQ_CLASS_IN (0x0001 )
20
+ #ifndef LWIP_PLATFORM_HTONS
21
+ #define LWIP_PLATFORM_HTONS (_n ) ((u16_t )((((_n) & 0xff ) << 8 ) | (((_n) >> 8 ) & 0xff )))
22
+ #endif
23
+ #ifndef LWIP_PLATFORM_HTONL
24
+ #define LWIP_PLATFORM_HTONL (_n ) ((u32_t )( (((_n) & 0xff ) << 24 ) | (((_n) & 0xff00 ) << 8 ) | (((_n) >> 8 ) & 0xff00 ) | (((_n) >> 24 ) & 0xff ) ))
25
+ #endif
20
26
21
27
// Definice struktury NBNS dotazu (alespon veci, ktere jsem vypozoroval):
22
28
struct NBNSQUESTION {
@@ -140,7 +146,7 @@ bool ESP8266NetBIOS::begin(const char *name)
140
146
}
141
147
142
148
// presuneme jmeno zarizeni se soucasnou upravou na UPPER case
143
- for (int i = 0 ; i < n; ++i) {
149
+ for (size_t i = 0 ; i < n; ++i) {
144
150
_name[i] = toupper (name[i]);
145
151
}
146
152
_name[n] = ' \0 ' ;
@@ -168,8 +174,15 @@ void ESP8266NetBIOS::end()
168
174
}
169
175
}
170
176
171
- void ESP8266NetBIOS::_recv (udp_pcb *upcb, pbuf *pb, ip_addr_t *addr, u16_t port)
177
+ #if LWIP_VERSION_MAJOR == 1
178
+ void ESP8266NetBIOS::_recv (udp_pcb *upcb, pbuf *pb, ip_addr_t *addr, uint16_t port)
179
+ #else
180
+ void ESP8266NetBIOS::_recv (udp_pcb *upcb, pbuf *pb, const ip_addr_t *addr, uint16_t port)
181
+ #endif
172
182
{
183
+ (void )upcb;
184
+ (void )addr;
185
+ (void )port;
173
186
while (pb != NULL ) {
174
187
uint8_t * data = (uint8_t *)((pb)->payload );
175
188
size_t len = pb->len ;
@@ -256,7 +269,11 @@ void ESP8266NetBIOS::_recv(udp_pcb *upcb, pbuf *pb, ip_addr_t *addr, u16_t port)
256
269
}
257
270
}
258
271
272
+ #if LWIP_VERSION_MAJOR == 1
259
273
void ESP8266NetBIOS::_s_recv (void *arg, udp_pcb *upcb, pbuf *p, struct ip_addr *addr, uint16_t port)
274
+ #else
275
+ void ESP8266NetBIOS::_s_recv (void *arg, udp_pcb *upcb, pbuf *p, const ip_addr_t *addr, uint16_t port)
276
+ #endif
260
277
{
261
278
reinterpret_cast <ESP8266NetBIOS*>(arg)->_recv (upcb, p, addr, port);
262
279
}
0 commit comments