Skip to content

Commit d15cbb2

Browse files
committed
fix 8139 netbios in AP mode
1 parent 1a5ef71 commit d15cbb2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libraries/ESP8266NetBIOS/ESP8266NetBIOS.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,10 @@ void ESP8266NetBIOS::_recv(udp_pcb *upcb, pbuf *pb, const ip_addr_t *addr, uint1
212212
nbnsa.NBNSA_TIMETOLIVE = LWIP_PLATFORM_HTONL(300000UL);// Time to live (30000 sekund)
213213
nbnsa.NBNSA_LENGTH = LWIP_PLATFORM_HTONS(6);
214214
nbnsa.NBNSA_NODEFLAGS = LWIP_PLATFORM_HTONS(0);
215-
nbnsa.NBNSA_NODEADDRESS = WiFi.localIP(); // ulozime nasi IP adresu
215+
if (WiFi.getMode()==WIFI_STA)
216+
nbnsa.NBNSA_NODEADDRESS = WiFi.localIP(); // ulozime nasi IP adresu
217+
else
218+
nbnsa.NBNSA_NODEADDRESS = WiFi.softAPIP(); // ulozime nasi IP adresu
216219

217220
pbuf* pbt = pbuf_alloc(PBUF_TRANSPORT, sizeof(nbnsa), PBUF_RAM);
218221
if(pbt != NULL) {

0 commit comments

Comments
 (0)