1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

Fix ESP8266NetBIOS to compile with lwip V2 (#3823)

* Fix to compile with lwip V2

* Add changes suggested
This commit is contained in:
Luc
2017-11-17 22:02:22 +01:00
committed by Develo
parent 397592fce7
commit bec6a4d302
2 changed files with 29 additions and 3 deletions

View File

@ -2,6 +2,10 @@
#ifndef __ESPNBNS_h__
#define __ESPNBNS_h__
extern "C" {
#include "lwip/init.h" // LWIP_VERSION_
#include <lwip/ip_addr.h>
}
#include <ESP8266WiFi.h>
#define NBNS_PORT 137
@ -15,7 +19,6 @@
struct udp_pcb;
struct pbuf;
struct ip_addr;
class ESP8266NetBIOS
{
@ -24,8 +27,14 @@ protected:
char _name[NBNS_MAX_HOSTNAME_LEN + 1];
void _getnbname(char *nbname, char *name, uint8_t maxlen);
void _makenbname(char *name, char *nbname, uint8_t outlen);
#if LWIP_VERSION_MAJOR == 1
void _recv(udp_pcb *upcb, pbuf *pb, struct ip_addr *addr, uint16_t port);
static void _s_recv(void *arg, udp_pcb *upcb, pbuf *p, struct ip_addr *addr, uint16_t port);
#else
void _recv(udp_pcb *upcb, pbuf *pb, const ip_addr_t *addr, uint16_t port);
static void _s_recv(void *arg, udp_pcb *upcb, pbuf *p, const ip_addr_t *addr, uint16_t port);
#endif
public:
ESP8266NetBIOS();
~ESP8266NetBIOS();