From e4af1950eb5c1efbd31f6e83b6f809e66f23df8f Mon Sep 17 00:00:00 2001 From: Luc Date: Tue, 2 Feb 2016 17:34:15 +0800 Subject: [PATCH] Allow to disable TCP data feature minor fixes: -Correct logic for web ports due to refactoring -Duplicate data read from serial if multiple clients -Improve reliability to reconnect to AP after a restart -Typo issues --- esp8266/config.cpp | 8 +++++--- esp8266/config.h | 3 +++ esp8266/data/system.tpl | 2 +- esp8266/esp8266.ino | 16 ++++++++++++---- esp8266/webinterface.cpp | 32 +++++++++++++++++++++++++++++--- esp8266/wifi.cpp | 1 + keywords.txt | 8 +++++--- 7 files changed, 56 insertions(+), 14 deletions(-) diff --git a/esp8266/config.cpp b/esp8266/config.cpp index 2a47cdb5..f09639a9 100644 --- a/esp8266/config.cpp +++ b/esp8266/config.cpp @@ -375,14 +375,16 @@ void CONFIG::print_config() } else { Serial.println(F("Error reading web port")); } - + Serial.print(F("Data port: ")); +#ifdef TCP_IP_DATA_FEATURE if (CONFIG::read_buffer(EP_DATA_PORT, (byte *)&ibuf , INTEGER_LENGTH)) { - Serial.print(F("Data port: ")); Serial.println(ibuf); } else { Serial.println(F("Error reading data port")); } - +#else + Serial.println(F("Disabled")); +#endif if (CONFIG::read_byte(EP_REFRESH_PAGE_TIME, &bbuf )) { Serial.print(F("Web page refresh time: ")); Serial.println(byte(bbuf)); diff --git a/esp8266/config.h b/esp8266/config.h index 600be435..55869add 100644 --- a/esp8266/config.h +++ b/esp8266/config.h @@ -38,6 +38,9 @@ //SERIAL_COMMAND_FEATURE: allow to send command by serial #define SERIAL_COMMAND_FEATURE +//TCP_IP_DATA_FEATURE: allow to connect serial from TCP/IP +#define TCP_IP_DATA_FEATURE + #ifndef CONFIG_h #define CONFIG_h diff --git a/esp8266/data/system.tpl b/esp8266/data/system.tpl index 2e1c983a..afb89891 100644 --- a/esp8266/data/system.tpl +++ b/esp8266/data/system.tpl @@ -26,7 +26,7 @@ $SLEEP_MODE_OPTIONS_LIST$

-

+