Skip to content

Commit

Permalink
preparations for lwip2 (#707)
Browse files Browse the repository at this point in the history
  • Loading branch information
s0170071 authored and psy0rz committed Jan 13, 2018
1 parent 3d3a035 commit 71cf207
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
10 changes: 9 additions & 1 deletion src/ESPEasy.ino
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,15 @@
#define FILE_SECURITY "security.dat"
#define FILE_NOTIFICATION "notification.dat"
#define FILE_RULES "rules1.dat"
#include "lwip/tcp_impl.h"
#include <lwip/init.h>
#ifndef LWIP_VERSION_MAJOR
#error
#endif
#if LWIP_VERSION_MAJOR == 2
// #include <lwip/priv/tcp_priv.h>
#else
#include <lwip/tcp_impl.h>
#endif
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
ESP8266WebServer WebServer(80);
Expand Down
12 changes: 8 additions & 4 deletions src/Misc.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
#if defined(ESP8266)
void tcpCleanup()
{
while(tcp_tw_pcbs!=NULL)
{
tcp_abort(tcp_tw_pcbs);
}
#if LWIP_VERSION_MAJOR == 2
// is it still needed ?
#else
while(tcp_tw_pcbs!=NULL)
{
tcp_abort(tcp_tw_pcbs);
}
#endif
}
#endif

Expand Down
5 changes: 5 additions & 0 deletions src/Networking.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
// Syslog
// UDP system messaging
// SSDP
#if LWIP_VERSION_MAJOR == 2
#define IP2STR(addr) (uint8_t)((uint32_t)addr & 0xFF), (uint8_t)(((uint32_t)addr >> 8) & 0xFF), (uint8_t)(((uint32_t)addr >> 16) & 0xFF), (uint8_t)(((uint32_t)addr >> 24) & 0xFF)
#endif



/*********************************************************************************************\
Syslog client
Expand Down

0 comments on commit 71cf207

Please sign in to comment.