8000 wip ipv6: now tcp server is working too :) · esp8266/Arduino@643036f · GitHub
[go: up one dir, main page]

Skip to content

Commit 643036f

Browse files
committed
wip ipv6: now tcp server is working too :)
1 parent b96c1c0 commit 643036f

File tree

11 files changed

+679
-174
lines changed

11 files changed

+679
-174
lines changed

libraries/ESP8266WiFi/src/WiFiServer.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ extern "C" {
3737
#include "lwip/inet.h"
3838
#include "include/ClientContext.h"
3939

40-
WiFiServer::WiFiServer(IPAddress addr, uint16_t port)
40+
WiFiServer::WiFiServer(const IPAddress& addr, uint16_t port)
4141
: _port(port)
42-
, _addr(addr)
42+
, _addr((const ip_addr_t*)addr)
4343
, _pcb(nullptr)
4444
, _unclaimed(nullptr)
4545
, _discarded(nullptr)
@@ -48,7 +48,11 @@ WiFiServer::WiFiServer(IPAddress addr, uint16_t port)
4848

4949
WiFiServer::WiFiServer(uint16_t port)
5050
: _port(port)
51-
, _addr((uint32_t) IPADDR_ANY)
51+
#if LWIP_IPV6
52+
, _addr(IP_ANY_TYPE)
53+
#else
54+
, _addr(IPADDR_ANY)
55+
#endif
5256
, _pcb(nullptr)
5357
, _unclaimed(nullptr)
5458
, _discarded(nullptr)
@@ -61,7 +65,7 @@ void WiFiServer::begin() {
6165

6266
void WiFiServer::begin(uint16_t port) {
6367
close();
64-
_port = port;
68+
_port = port;
6569
err_t err;
6670
tcp_pcb* pcb = tcp_new();
6771
if (!pcb)

libraries/ESP8266WiFi/src/WiFiServer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ class WiFiServer : public Server {
3838
// Secure server needs access to all the private entries here
3939
protected:
4040
uint16_t _port;
41-
IPAddress _addr;
41+
const ip_addr_t* _addr;
4242
tcp_pcb* _pcb;
4343

4444
ClientContext* _unclaimed;
4545
ClientContext* _discarded;
4646
bool _noDelay = false;
4747

4848
public:
49-
WiFiServer(IPAddress addr, uint16_t port);
49+
WiFiServer(const IPAddress& addr, uint16_t port);
5050
WiFiServer(uint16_t port);
5151
virtual ~WiFiServer() {}
5252
WiFiClient available(uint8_t* status = NULL);

tools/boards.txt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@
932932
'lwip2': collections.OrderedDict([
933933
( '.menu.ip.lm2', 'v2 Lower Memory' ),
934934
( '.menu.ip.lm2.build.lwip_include', 'lwip2/include' ),
935-
( '.menu.ip.lm2.build.lwip_lib', '-llwip2' ),
935+
( '.menu.ip.lm2.build.lwip_lib', '-llwip2_536' ),
936936
( '.menu.ip.lm2.build.lwip_flags', '-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_IPV6=0' ),
937937
( '.menu.ip.hb2', 'v2 Higher Bandwidth' ),
938938
( '.menu.ip.hb2.build.lwip_include', 'lwip2/include' ),

tools/sdk/lib/liblwip2_1460.a

68.9 KB
Binary file not shown.

tools/sdk/lib/liblwip2_536.a

68.9 KB
Binary file not shown.

tools/sdk/lib/liblwip6_1460.a

1.44 MB
Binary file not shown.

tools/sdk/lib/liblwip6_536.a

1.44 MB
Binary file not shown.

tools/sdk/lwip2/include/gluedebug.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#define UDEBUGINDEX 0 // 0 or 1 (show debug line number)
1616
#define UDEBUGSTORE 0 // 0 or 1 (store debug into buffer until doprint_allow=1=serial-available)
1717

18-
#define ULWIPDEBUG 0 // 0 or 1 (trigger lwip debug)
18+
#define ULWIPDEBUG 1 // 0 or 1 (trigger lwip debug)
1919
#define ULWIPASSERT 0 // 0 or 1 (trigger lwip self-check, 0 saves flash)
2020

2121
#define STRING_IN_FLASH 1 // *print("fmt is stored in flash")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// generated by makefiles/make-lwip2-hash
22
#ifndef LWIP_HASH_H
33
#define LWIP_HASH_H
4-
#define LWIP_HASH_STR "STABLE-2_1_0_RC1/glue:arduino-2.4.2-6-g5ea7978"
4+
#define LWIP_HASH_STR "STABLE-2_1_0_RC1/glue:arduino-2.4.2-25-gceb069c"
55
#endif // LWIP_HASH_H

0 commit comments

Comments
 (0)
0