From 12de405b8670631b9708ef924c2d6f74d6876e4e Mon Sep 17 00:00:00 2001
From: slaff
Date: Tue, 25 Jul 2017 10:14:10 +0200
Subject: [PATCH 01/50] Preparation for the final 3.3.0 release. (#1202)
This version includes:
- Refactored HttpClient and HttpServer
- Support for SSL session resumption in TcpConnection and TcpServer.
- Removed deprecated Station::waitConnection.
- Custom PWM is enabled by default.
- Multiple fixes to issues reported from Codacy's Vera++ and CppCheck reports.
---
Readme.md | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Readme.md b/Readme.md
index 5acd9f49d6..5063811398 100644
--- a/Readme.md
+++ b/Readme.md
@@ -43,7 +43,7 @@ SDK = Software Development Kit
n/a = The selected SDK is not available on that OS
## Latest Stable Release
-- [Sming V3.2.0](https://github.com/SmingHub/Sming/releases/tag/3.2.0)
+- [Sming V3.3.0](https://github.com/SmingHub/Sming/releases/tag/3.3.0)
## Getting started
- [Windows](https://github.com/SmingHub/Sming/wiki/Windows-Quickstart)
@@ -64,7 +64,7 @@ n/a = The selected SDK is not available on that OS
- Custom PWM: (default: ON) If you don't want to use the [open PWM implementation](https://github.com/StefanBruens/ESP8266_new_pwm) then compile your application with `ENABLE_CUSTOM_PWM=0`. There is no need to recompile the Sming library.
- Custom serial baud rate: (default: OFF) The default serial baud rate is 115200. If you want to change it to a higher baud rate you can recompile Sming and your application changing the `COM_SPEED_SERIAL` directive. For example `COM_SPEED_SERIAL=921600`.
- Custom heap allocation: (default: OFF) If your application is experiencing heap fragmentation then you can try the [umm_malloc](https://github.com/rhempel/umm_malloc) heap allocation. To enable it compile Sming with `ENABLE_CUSTOM_HEAP=1`. In order to use it in your sample/application make sure to compile the sample with `ENABLE_CUSTOM_HEAP=1`. **Do not enable custom heap allocation and -mforce-l32 compiler flag together**.
-- Debug information log level and format: There are four debug levels: debug=3, info=2, warn=1, error=0. Using `DEBUG_VERBOSE_LEVEL` you can set the desired level (0-3). For example `DEBUG_VERBOSE_LEVEL=2` will show only info messages and above. Another make directive is `DEBUG_PRINT_FILENAME_AND_LINE=1` which enables printing the filename and line number of every debug line. This will require extra space on flash. Note: you can compile the Sming library with a set of debug directives and your project with another settings, this way you can control debugging sepparately for sming and your application code.
+- Debug information log level and format: There are four debug levels: debug=3, info=2, warn=1, error=0. Using `DEBUG_VERBOSE_LEVEL` you can set the desired level (0-3). For example `DEBUG_VERBOSE_LEVEL=2` will show only info messages and above. Another make directive is `DEBUG_PRINT_FILENAME_AND_LINE=1` which enables printing the filename and line number of every debug line. This will require extra space on flash. Note: you can compile the Sming library with a set of debug directives and your project with another settings, this way you can control debugging separately for Sming and your application code.
- Debug information for custom LWIP: If you use custom LWIP (see above) some debug information will be printed for critical errors and situations. You can enable debug information printing altogether using `ENABLE_LWIPDEBUG=1`. To increase debugging for certain areas you can modify debug options in `third-party/esp-open-lwip/include/lwipopts.h`.
- CommandExecutor feature: (default: ON) This feature enables execution of certain commands by registering token handlers for text received via serial, websocket or telnet connection. If this feature is not used additional RAM/Flash can be obtained by setting `ENABLE_CMD_EXECUTOR=0`. This will save ~1KB RAM and ~3KB of flash memory.
@@ -74,6 +74,7 @@ n/a = The selected SDK is not available on that OS
See the getting started page for your respective operating system.
You can find more information about compilation and flashing process by reading esp8266.com forum discussion thread.
+Official ESP8266 documentation can be found in the [Espressif website](https://espressif.com/en/support/download/documents?keys=&field_type_tid%5B%5D=14).
## Examples
More information at **[Wiki Examples](https://github.com/SmingHub/Sming/wiki/examples)** page.
From a789c2092486372cb66cd2bca23f12ce2686c8c5 Mon Sep 17 00:00:00 2001
From: slaff
Date: Wed, 26 Jul 2017 14:03:03 +0200
Subject: [PATCH 02/50] Small fixes before the final 3.3.0 (#1203)
* Pass the fingerprints and certification pairs by reference.
* Replace the external GNU find with GNU makefile standard functions: dir, wildcard and sort.
---
Readme.md | 1 +
Sming/Makefile | 4 +-
Sming/SmingCore/Network/Http/HttpRequest.cpp | 4 +-
Sming/SmingCore/Network/Http/HttpRequest.h | 4 +-
samples/Basic_Debug/README.md | 84 +++++++++++++-------
5 files changed, 62 insertions(+), 35 deletions(-)
diff --git a/Readme.md b/Readme.md
index 5063811398..4d2ef01ecf 100644
--- a/Readme.md
+++ b/Readme.md
@@ -66,6 +66,7 @@ n/a = The selected SDK is not available on that OS
- Custom heap allocation: (default: OFF) If your application is experiencing heap fragmentation then you can try the [umm_malloc](https://github.com/rhempel/umm_malloc) heap allocation. To enable it compile Sming with `ENABLE_CUSTOM_HEAP=1`. In order to use it in your sample/application make sure to compile the sample with `ENABLE_CUSTOM_HEAP=1`. **Do not enable custom heap allocation and -mforce-l32 compiler flag together**.
- Debug information log level and format: There are four debug levels: debug=3, info=2, warn=1, error=0. Using `DEBUG_VERBOSE_LEVEL` you can set the desired level (0-3). For example `DEBUG_VERBOSE_LEVEL=2` will show only info messages and above. Another make directive is `DEBUG_PRINT_FILENAME_AND_LINE=1` which enables printing the filename and line number of every debug line. This will require extra space on flash. Note: you can compile the Sming library with a set of debug directives and your project with another settings, this way you can control debugging separately for Sming and your application code.
- Debug information for custom LWIP: If you use custom LWIP (see above) some debug information will be printed for critical errors and situations. You can enable debug information printing altogether using `ENABLE_LWIPDEBUG=1`. To increase debugging for certain areas you can modify debug options in `third-party/esp-open-lwip/include/lwipopts.h`.
+- Interactive debugging on the device: (default: OFF) In order to be able to debug live directly on the ESP8266 microcontroller you should re-compile your application and the Sming library with `ENABLE_GDB=1` directive. See [Basic_Debug](https://github.com/SmingHub/Sming/tree/develop/samples/Basic_Debug) sample for more details.
- CommandExecutor feature: (default: ON) This feature enables execution of certain commands by registering token handlers for text received via serial, websocket or telnet connection. If this feature is not used additional RAM/Flash can be obtained by setting `ENABLE_CMD_EXECUTOR=0`. This will save ~1KB RAM and ~3KB of flash memory.
diff --git a/Sming/Makefile b/Sming/Makefile
index 49fbf68dfa..28e4ba65fc 100644
--- a/Sming/Makefile
+++ b/Sming/Makefile
@@ -152,7 +152,9 @@ TARGET = app
CUSTOM_TARGETS ?=
# which modules (subdirectories) of the project to include in compiling
-MODULES = system system/helpers Wiring appinit $(shell find SmingCore -type d) $(filter %/, $(wildcard Services/*/)) $(filter %/, $(wildcard Libraries/*/))
+MODULES = system system/helpers Wiring appinit \
+ $(sort $(dir $(wildcard SmingCore/*/ SmingCore/*/*/ SmingCore/*/*/*/))) \
+ $(filter %/, $(wildcard Services/*/)) $(filter %/, $(wildcard Libraries/*/))
EXTRA_INCDIR = include system/include Wiring Libraries SmingCore $(SDK_BASE)/../include
# Place a file that should exist in a submodule that is fetched separately
diff --git a/Sming/SmingCore/Network/Http/HttpRequest.cpp b/Sming/SmingCore/Network/Http/HttpRequest.cpp
index 614c3b7f35..26cd7607d6 100644
--- a/Sming/SmingCore/Network/Http/HttpRequest.cpp
+++ b/Sming/SmingCore/Network/Http/HttpRequest.cpp
@@ -185,12 +185,12 @@ uint32_t HttpRequest::getSslOptions() {
return sslOptions;
}
-HttpRequest* HttpRequest::pinCertificate(SSLFingerprints fingerprints) {
+HttpRequest* HttpRequest::pinCertificate(const SSLFingerprints& fingerprints) {
sslFingerprint = fingerprints;
return this;
}
-HttpRequest* HttpRequest::setSslClientKeyCert(SSLKeyCertPair clientKeyCert) {
+HttpRequest* HttpRequest::setSslClientKeyCert(const SSLKeyCertPair& clientKeyCert) {
this->sslClientKeyCert = clientKeyCert;
return this;
}
diff --git a/Sming/SmingCore/Network/Http/HttpRequest.h b/Sming/SmingCore/Network/Http/HttpRequest.h
index 35f7807c1b..23aac97ae3 100644
--- a/Sming/SmingCore/Network/Http/HttpRequest.h
+++ b/Sming/SmingCore/Network/Http/HttpRequest.h
@@ -94,7 +94,7 @@ class HttpRequest {
*
* @return bool true of success, false or failure
*/
- HttpRequest* pinCertificate(SSLFingerprints fingerprints);
+ HttpRequest* pinCertificate(const SSLFingerprints& fingerprints);
/**
* @brief Sets client private key, certificate and password from memory
@@ -103,7 +103,7 @@ class HttpRequest {
*
* @return HttpRequest pointer
*/
- HttpRequest* setSslClientKeyCert(SSLKeyCertPair clientKeyCert);
+ HttpRequest* setSslClientKeyCert(const SSLKeyCertPair& clientKeyCert);
#endif
HttpRequest* setBody(const String& body);
diff --git a/samples/Basic_Debug/README.md b/samples/Basic_Debug/README.md
index 10ca427d7d..3d42e0deec 100644
--- a/samples/Basic_Debug/README.md
+++ b/samples/Basic_Debug/README.md
@@ -3,32 +3,64 @@ It relies on the GDBStub project to do the heavy-lifting.
Exception Handling
------------------
-If there is an exception in your code usually ESP prints a message like the following one:
+Sming comes with a built-in exception handling that takes care to display the stack trace
+leading to the issue. Usually it looks like this
```
-Fatal exception (0):
-epc1=0x4020997c, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000
+***** Fatal exception 28
+pc=0x40100e96 sp=0x3ffff640 excvaddr=0x000015b8
+ps=0x00000033 sar=0x00000018 vpri=0x000000f0
+r00: 0x40100d69=1074793833 r01: 0x3ffff640=1073739328 r02: 0x3fff3900=1073690880
+r03: 0x2b265ed4= 723934932 r04: 0x3fffbff0=1073725424 r05: 0x000015b8= 5560
+r06: 0x000015b8= 5560 r07: 0x14a8433b= 346571579 r08: 0x00000008= 8
+r09: 0x14a842f3= 346571507 r10: 0x3fff22d0=1073685200 r11: 0x00000003= 3
+r12: 0x00000048= 72 r13: 0x3fff38c0=1073690816 r14: 0x3ffe9da0=1073651104
+r15: 0x3fff1138=1073680696
+
+Stack dump:
+To decode the stack dump call from command line:
+ python $SMING_HOME/../tools/decode-stacktrace.py out/build/app.out
+and copy & paste the text enclosed in '===='.
+================================================================
+3ffff640: 40100e96 00000033 00000018 000000f0
+3ffff650: 40100d69 3fff3900 2b265ed4 3fffbff0
+3ffff660: 000015b8 000015b8 14a8433b 00000008
+3ffff670: 14a842f3 3fff22d0 00000003 00000048
+3ffff680: 3fff38c0 3ffe9da0 3fff1138 0000001c
+3ffff690: 002222fb c0fb5c01 0bc10000 facfd1fb
+3ffff6a0: 620020c0 6162802d 0020c004 59062c52
+3ffff6b0: 0020c051 61492c48 210020c0 7c38fb50
+...
+
+================================================================
```
-That information can help you discover the function call that caused the exception.
-Using the value of epc1 and executing a command like the one below:
+With the help of `decode-stacktrace.py` you can decode the stack trace to something readable like:
-```bash
-xtensa-lx106-elf-objdump -dtr out/build/app.out | grep 4020997c
-```
-
-can give you an idea about the function. In my test case this is:
```
-4020997c: fffe61 l32r a6, 40209974
+0x40100e96: pvPortRealloc at ??: ?
+0x40100d69: pvPortMalloc at ??:?
+0x402455f0: ax_port_malloc at C:\tools\Sming-3.1.2\Sming/third-party/axtls-8266/ replacements/mem.c:51
+0x4024561a: ax_port_calloc at C:\tools\Sming-3.1.2\Sming/third-party/axtls-8266/ replacements/mem.c:63
+0x40230acc: x509_new at c:\tools\Sming-3.1.2\Sming\third-party\axtls-8266/ssl/x5 09.c:81
+0x4023d3e4: m_vsnprintf at C:\tools\Sming-3.1.2\Sming/system/m_printf.cpp:69
+0x4023d4a6: m_vprintf at C:\tools\Sming-3.1.2\Sming/system/m_printf.cpp:83
+0x40000a39: ?? ??:0
+0x4021418a: pp_attach at ??:?
+0x40221d60: pbuf_alloc at ??:?
+0x40221f0a: pbuf_copy at ??:?
+0x4023d3e4: m_vsnprintf at C:\tools\Sming-3.1.2\Sming/system/m_printf.cpp:69
```
-But that information might not be enough to find the issue. And finding the
+Using the information about the type of the exception (ex: `***** Fatal exception 28`)
+and the sequence of commands might help us figure out the issue.
+
+But that information might not be enough. And finding the
root cause may take quite some time.
GDB Debugging
-------------
-Debugging is a powerful technique giving better understanding of the code and
-the things that went wrong.
+Debugging is a powerful technique allowing you to interactively run your code and be able to see much more information about the things that went wrong.
There is already existing GDBStub that tries to make it easier to use software
debugger. And this project is an example of what you need to do in order to
@@ -36,25 +68,17 @@ integrate it.
Here are the commands that you need to execute:
-1. Fetch the [GDBStub](https://github.com/espressif/esp-gdbstub) by
-executing the following commands ( usually needs to be done only once).
-
-```bash
-git submodule init
-git submodule update --recursive
-```
-
-2. You will need a version of the sming library with enabled GDBStub functionality.
+1. You will need a version of the Sming library with enabled GDBStub functionality.
For that purpose you should compile Sming with ENABLE_GDB flag. Under Linux
you should do the following:
```bash
-cd /Sming
-make clean
+cd $SMING_HOME
+make dist-clean
ENABLE_GDB=1 make
```
-3. In you project inside of you Makefile-user.mk file you should add the following
+2. In your project inside of your Makefile-user.mk file you should add the following
variable:
```make
@@ -64,13 +88,13 @@ ENABLE_GDB=1
If you are looking for an example then take a look at the Makefile-user.mk file
that is in the same directory as this README.md file.
-4. Now compile your project and flash it to the board.
+3. Now compile your project and flash it to the board.
```bash
-make
+make ENABLE_GDB=1
make flash
```
-5. Run gdb immediately after resetting the board or after it has run into an exception.
+4. Run gdb immediately after resetting the board or after it has run into an exception.
The easiest way to do it is to use the provided script:
```bash
xtensa-lx106-elf-gdb -x /Basic_Debug/gdbcmds -b 115200
@@ -79,7 +103,7 @@ xtensa-lx106-elf-gdb -x /Basic_Debug/gdbcmds -b 115200
115200 stands for the baud rate your program is using. Change it accordingly.
You may also need to change the gdbcmds script to fit the configuration of your hardware and build environment.
-6. Software breakpoints ('br') only work on code that is in RAM. During development you can use the GDB_IRAM_ATTR attribute in your function declarations.
+5. Software breakpoints ('br') only work on code that is in RAM. During development you can use the GDB_IRAM_ATTR attribute in your function declarations.
Code in flash can only have a hardware breakpoint ('hbr').
Read the [Notes](https://github.com/espressif/esp-gdbstub#notes) for more information.
From 50df3f026f8862c5395f68a1a716ee555b9b5b32 Mon Sep 17 00:00:00 2001
From: slaff
Date: Thu, 27 Jul 2017 09:30:29 +0200
Subject: [PATCH 03/50] Better Arduino compatability: Changed to order of the
Wire.begin and Wire.pins parameters to (#1193)
match the [Arduino order](samples/DS3232RTC_NTP_Setter/app/application.cpp).
Related to #1179 and #1061.
Warning: this is a backward incompatible change.
---
Sming/SmingCore/Wire.cpp | 6 +++---
Sming/SmingCore/Wire.h | 4 ++--
samples/Accelerometer_MMA7455/app/application.cpp | 2 +-
samples/Arducam/app/application.cpp | 2 +-
samples/Basic_ScannerI2C/app/application.cpp | 4 ++--
samples/DS3232RTC_NTP_Setter/app/application.cpp | 2 +-
samples/Humidity_AM2321/app/application.cpp | 2 +-
samples/Humidity_SI7021/app/application.cpp | 2 +-
samples/MeteoControl_mqtt/app/application.cpp | 2 +-
samples/PortExpander_MCP23017/app/application.cpp | 2 +-
10 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/Sming/SmingCore/Wire.cpp b/Sming/SmingCore/Wire.cpp
index 36e3c2c932..bdec5b1a19 100644
--- a/Sming/SmingCore/Wire.cpp
+++ b/Sming/SmingCore/Wire.cpp
@@ -54,20 +54,20 @@ TwoWire::TwoWire(){}
// Public Methods //////////////////////////////////////////////////////////////
-void TwoWire::begin(int scl, int sda){
+void TwoWire::begin(int sda, int scl){
default_sda_pin = sda;
default_scl_pin = scl;
twi_init(sda, scl);
flush();
}
-void TwoWire::pins(int scl, int sda){
+void TwoWire::pins(int sda, int scl){
default_sda_pin = sda;
default_scl_pin = scl;
}
void TwoWire::begin(void){
- begin(default_scl_pin, default_sda_pin);
+ begin(default_sda_pin, default_scl_pin);
}
void TwoWire::begin(uint8_t address){
diff --git a/Sming/SmingCore/Wire.h b/Sming/SmingCore/Wire.h
index f2ca80880d..e69604e35b 100644
--- a/Sming/SmingCore/Wire.h
+++ b/Sming/SmingCore/Wire.h
@@ -48,8 +48,8 @@ class TwoWire : public Stream
static void onReceiveService(uint8_t*, int);
public:
TwoWire();
- void begin(int scl, int sda);
- void pins(int scl, int sda);
+ void begin(int sda, int scl);
+ void pins(int sda, int scl);
void begin();
void begin(uint8_t);
void begin(int);
diff --git a/samples/Accelerometer_MMA7455/app/application.cpp b/samples/Accelerometer_MMA7455/app/application.cpp
index e3773672da..605755eb74 100644
--- a/samples/Accelerometer_MMA7455/app/application.cpp
+++ b/samples/Accelerometer_MMA7455/app/application.cpp
@@ -29,7 +29,7 @@ void init()
Serial.println("Starting...");
// You can change pins:
- //Wire.pins(12, 14); // SCL, SDA
+ //Wire.pins(14, 12); // SDA, SCL
Wire.begin();
// Select the Working Mode
diff --git a/samples/Arducam/app/application.cpp b/samples/Arducam/app/application.cpp
index 397704c6ba..53fbfca837 100644
--- a/samples/Arducam/app/application.cpp
+++ b/samples/Arducam/app/application.cpp
@@ -75,7 +75,7 @@ void initCam() {
Serial.printf("ArduCAM init!");
// initialize I2C
- Wire.pins(CAM_SCL, CAM_SDA);
+ Wire.pins(CAM_SDA, CAM_SCL);
Wire.begin();
//Check if the camera module type is OV2640
diff --git a/samples/Basic_ScannerI2C/app/application.cpp b/samples/Basic_ScannerI2C/app/application.cpp
index 889e24d298..58d820748c 100644
--- a/samples/Basic_ScannerI2C/app/application.cpp
+++ b/samples/Basic_ScannerI2C/app/application.cpp
@@ -81,10 +81,10 @@ void init()
WDT.enable(false); // First (but not the best) option: fully disable watch dog timer
- // Default I2C pins (SCL:0 , SDA: 2)
+ // Default I2C pins (SDA: 2, SCL:0)
// You can change pins:
- //Wire.pins(12, 14); // SCL, SDA
+ //Wire.pins(14, 12); // SDA, SCL
Wire.begin();
procTimer.initializeMs(3000, scanBus).start();
diff --git a/samples/DS3232RTC_NTP_Setter/app/application.cpp b/samples/DS3232RTC_NTP_Setter/app/application.cpp
index b0f07492e0..4f2d43b23d 100644
--- a/samples/DS3232RTC_NTP_Setter/app/application.cpp
+++ b/samples/DS3232RTC_NTP_Setter/app/application.cpp
@@ -41,7 +41,7 @@ void init()
{
Serial.begin(SERIAL_BAUD_RATE);
Serial.println("Sming DSRTC_NTP_SETTER started!");
- Wire.pins(0, 2); //Change to your SCL - 0,SDA - 2 GPIO pin number
+ Wire.pins(2, 0); //Change to your SDA - 2, SCL - 0 GPIO pin number
Wire.begin();
// Station - WiFi client
diff --git a/samples/Humidity_AM2321/app/application.cpp b/samples/Humidity_AM2321/app/application.cpp
index fd3afb8f8e..5949c3d1e9 100644
--- a/samples/Humidity_AM2321/app/application.cpp
+++ b/samples/Humidity_AM2321/app/application.cpp
@@ -31,7 +31,7 @@ void init()
delay(500);
// Apply I2C pins
- Wire.pins(SCL, SDA);
+ Wire.pins(SDA, SCL);
Wire.begin();
am2321.begin(); // REQUIRED. Call it after choosing I2C pins.
diff --git a/samples/Humidity_SI7021/app/application.cpp b/samples/Humidity_SI7021/app/application.cpp
index dd0b1772da..eb4ed1383e 100644
--- a/samples/Humidity_SI7021/app/application.cpp
+++ b/samples/Humidity_SI7021/app/application.cpp
@@ -84,7 +84,7 @@ void init()
Serial.begin(SERIAL_BAUD_RATE); // 115200 by default
Serial.systemDebugOutput(true); // Allow debug output to serial
Serial.print("Start I2c");
- Wire.pins(I2C_SCL, I2C_SDA); // SCL, SDA
+ Wire.pins(I2C_SDA, I2C_SCL); // SDA, SCL
Wire.begin();
procTimer_ht.initializeMs(10000, si_read_ht).start();
procTimer_olt.initializeMs(15000, si_read_olt).start();
diff --git a/samples/MeteoControl_mqtt/app/application.cpp b/samples/MeteoControl_mqtt/app/application.cpp
index aa81e93e43..b73c03dd57 100644
--- a/samples/MeteoControl_mqtt/app/application.cpp
+++ b/samples/MeteoControl_mqtt/app/application.cpp
@@ -14,7 +14,7 @@ void init()
{
Serial.begin(SERIAL_BAUD_RATE); // 115200 by default
- Wire.pins(5, 4); // SCL, SDA
+ Wire.pins(4, 5); // SDA, SCL
Wire.begin();
// initialization config
diff --git a/samples/PortExpander_MCP23017/app/application.cpp b/samples/PortExpander_MCP23017/app/application.cpp
index 6810c50b23..e42d3680d1 100644
--- a/samples/PortExpander_MCP23017/app/application.cpp
+++ b/samples/PortExpander_MCP23017/app/application.cpp
@@ -18,7 +18,7 @@ void init()
Serial.begin(115200);
// You can select ESP I2C pins here:
- //Wire.pins(4, 5); // SCL, SDA
+ //Wire.pins(5, 4); // SDA, SCL
mcp.begin(0); // 0 - for default mcp address, possible values: 0..7
From 7aa3d4c2837ad122ca4e3124566f3a9a11938cbd Mon Sep 17 00:00:00 2001
From: slaff
Date: Thu, 27 Jul 2017 15:31:45 +0200
Subject: [PATCH 04/50] Added Gitter Notifications. (#1205)
---
.travis.yml | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/.travis.yml b/.travis.yml
index c5cd0aa543..2d6c6ba0e4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -64,3 +64,10 @@ deploy:
on:
tags: true
condition: $DEPLOY == true
+
+notifications:
+ webhooks:
+ urls:
+ - https://webhooks.gitter.im/e/c1a5e8bc97d3794a0417
+ on_success: always # options: [always|never|change] default: always
+ on_failure: always # options: [always|never|change] default: always
From c6df682a127b22550a1471f89d4c5680b039b050 Mon Sep 17 00:00:00 2001
From: slaff
Date: Sat, 29 Jul 2017 10:12:04 +0200
Subject: [PATCH 05/50] Added dynamic recalculation of image offsets to prever
rom overlapping. (#1208)
---
Sming/Makefile-project.mk | 42 ++++++++++++++++++++++++++++++---------
samples/.gitignore | 1 +
2 files changed, 34 insertions(+), 9 deletions(-)
create mode 100644 samples/.gitignore
diff --git a/Sming/Makefile-project.mk b/Sming/Makefile-project.mk
index 03e7b76c53..3d2e4ab568 100644
--- a/Sming/Makefile-project.mk
+++ b/Sming/Makefile-project.mk
@@ -41,10 +41,10 @@ SPIFFY ?= $(SMING_HOME)/spiffy/spiffy
#ESPTOOL2 config to generate rBootLESS images
IMAGE_MAIN ?= 0x00000.bin
-IMAGE_SDK ?= 0x0a000.bin # The name must match the starting address of the irom0 section
- # in the LD file ($SMING_HOME/compiler/ld/standalone.rom.ld).
- # To calculate the value do the following: x = irom0_0_seg.org - 0x40200000
- # Example: 0x4020a000 - 0x40200000 = 0x0a000
+IMAGE_SDK_OFFSET = $(shell printf '0x%x\n' $$(( ($$($(GET_FILESIZE) $(FW_BASE)/$(IMAGE_MAIN)) + 0x1000 + $(basename $(IMAGE_MAIN))) & (0xFFFFF000) )) )
+IMAGE_SDK ?= $(IMAGE_SDK_OFFSET).bin
+IROM0_ORG0 = $(shell printf '0x%x\n' $$(( 0x40200000 + $(IMAGE_SDK_OFFSET))) )
+
INIT_BIN_ADDR = 0x7c000
BLANK_BIN_ADDR = 0x4b000
@@ -55,6 +55,9 @@ ESPTOOL2_SECTS ?= .text .data .rodata
ESPTOOL2_MAIN_ARGS ?= -quiet -bin -boot0
ESPTOOL2_SDK_ARGS ?= -quiet -lib
+# SED path
+SED ?= sed
+
## ESP_HOME sets the path where ESP tools and SDK are located.
## Windows:
# ESP_HOME = c:/Espressif
@@ -259,6 +262,8 @@ LDFLAGS = -nostdlib -u call_user_start -Wl,-static -Wl,--gc-sections -Wl,-Map=$
# linker script used for the above linkier step
LD_PATH = $(SMING_HOME)/compiler/ld
+PROJECT_LD_PATH=ld
+
LD_SCRIPT = standalone.rom.ld
ifeq ($(SPI_SPEED), 26)
@@ -367,9 +372,28 @@ all: $(USER_LIBDIR)/lib$(LIBSMING).a checkdirs $(TARGET_OUT) $(SPIFF_BIN_OUT) $(
spiff_update: spiff_clean $(SPIFF_BIN_OUT)
-$(TARGET_OUT): $(APP_AR)
- $(vecho) "LD $@"
- $(Q) $(LD) -L$(USER_LIBDIR) -L$(SDK_LIBDIR) -L$(LD_PATH) -T$(LD_SCRIPT) $(LDFLAGS) -Wl,--start-group $(LIBS) $(APP_AR) -Wl,--end-group -o $@
+$(PROJECT_LD_PATH)/$(LD_SCRIPT):
+ $(Q) mkdir -p $(PROJECT_LD_PATH)
+ $(Q) cp $(LD_PATH)/$(LD_SCRIPT) $@
+
+$(FW_BASE)/$(IMAGE_MAIN): $(APP_AR)
+# Pass 1: Generate rom0 to be able to check its size
+ $(Q) $(LD) -L$(USER_LIBDIR) -L$(SDK_LIBDIR) -L$(LD_PATH) -T$(LD_SCRIPT) $(LDFLAGS) -Wl,--start-group $(LIBS) $(APP_AR) -Wl,--end-group -o $(TARGET_OUT).tmp
+
+ $(Q) $(STRIP) $(TARGET_OUT).tmp
+
+ $(Q) $(ESPTOOL2) $(ESPTOOL2_MAIN_ARGS) $(TARGET_OUT).tmp $@ $(ESPTOOL2_SECTS)
+
+ $(Q) rm $(TARGET_OUT).tmp
+
+$(TARGET_OUT): $(FW_BASE)/$(IMAGE_MAIN) $(PROJECT_LD_PATH)/$(LD_SCRIPT)
+ $(vecho) "LD $@"
+
+# Readjust linker
+ $(Q) $(SED) -r "s/(^\s*irom0_0_seg *: *).*/\\1org = $(IROM0_ORG0), len = \(1M - $(IMAGE_SDK_OFFSET)\)/" $(LD_PATH)/$(LD_SCRIPT) > $(PROJECT_LD_PATH)/$(LD_SCRIPT)
+
+# Pass 2: Generate roms with correct offsets
+ $(Q) $(LD) -L$(USER_LIBDIR) -L$(SDK_LIBDIR) -L$(PROJECT_LD_PATH) -L$(LD_PATH) -T$(LD_SCRIPT) $(LDFLAGS) -Wl,--start-group $(LIBS) $(APP_AR) -Wl,--end-group -o $@
$(Q) $(STRIP) $@
@@ -454,9 +478,9 @@ flash: all
$(vecho) "Killing Terminal to free $(COM_PORT)"
-$(Q) $(KILL_TERM)
ifeq ($(DISABLE_SPIFFS), 1)
- $(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED_ESPTOOL) write_flash $(flashimageoptions) $(basename $(IMAGE_MAIN)) $(FW_BASE)/$(IMAGE_MAIN) $(basename $(IMAGE_SDK)) $(FW_BASE)/$(IMAGE_SDK)
+ $(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED_ESPTOOL) write_flash $(flashimageoptions) $(basename $(IMAGE_MAIN)) $(FW_BASE)/$(IMAGE_MAIN) $(IMAGE_SDK_OFFSET) $(FW_BASE)/$(IMAGE_SDK)
else
- $(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED_ESPTOOL) write_flash $(flashimageoptions) $(basename $(IMAGE_MAIN)) $(FW_BASE)/$(IMAGE_MAIN) $(basename $(IMAGE_SDK)) $(FW_BASE)/$(IMAGE_SDK) $(SPIFF_START_OFFSET) $(SPIFF_BIN_OUT)
+ $(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED_ESPTOOL) write_flash $(flashimageoptions) $(basename $(IMAGE_MAIN)) $(FW_BASE)/$(IMAGE_MAIN) $(IMAGE_SDK_OFFSET) $(FW_BASE)/$(IMAGE_SDK) $(SPIFF_START_OFFSET) $(SPIFF_BIN_OUT)
endif
$(TERMINAL)
diff --git a/samples/.gitignore b/samples/.gitignore
new file mode 100644
index 0000000000..003e406d3d
--- /dev/null
+++ b/samples/.gitignore
@@ -0,0 +1 @@
+**/ld/standalone.rom.ld
From b1bb00538bc1b8f9f8dfe4d04aa1e39610c2c473 Mon Sep 17 00:00:00 2001
From: slaff
Date: Sat, 29 Jul 2017 10:13:24 +0200
Subject: [PATCH 06/50] Appvoyer CI will use the updated choco packages.
(#1210)
* Move to using the update choco repository.
* Build with SDK 1.5.0 and SDK 2.0.0
---
appveyor.yml | 25 +++++++++++++++++++------
1 file changed, 19 insertions(+), 6 deletions(-)
diff --git a/appveyor.yml b/appveyor.yml
index 0810e32159..2ab96b8a4c 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -10,15 +10,28 @@ environment:
build_compiler: "mingw"
build_bindings: 1
SDK_VERSION: 2.0.0
+ - build_platform: "x86"
+ build_compiler: "mingw"
+ build_bindings: 1
+ SDK_VERSION: 1.5.0
+
# cache:
# - src/ # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified
install:
- - choco sources add -name kireevco -source 'https://www.myget.org/F/kireevco-chocolatey/'
- - choco install -y esp8266-udk wget curl
-# - C:\MinGW\bin\mingw-get install
- - mkdir c:\Espressif\utils\ESP8266
- - cp c:\Espressif\utils\memanalyzer.exe c:\Espressif\utils\ESP8266\memanalyzer.exe
- - cp c:\Espressif\utils\esptool.exe c:\Espressif\utils\ESP8266\esptool.exe
+ - choco sources add -name sming -source 'https://www.myget.org/F/sming/'
+ - ps: if($env:SDK_VERSION -eq '1.5.0') {
+ choco install esp8266-udk --source https://www.myget.org/F/kireevco-chocolatey/;
+ mkdir c:\Espressif\utils\ESP8266;
+ cp c:\Espressif\utils\memanalyzer.exe c:\Espressif\utils\ESP8266\memanalyzer.exe;
+ cp c:\Espressif\utils\esptool.exe c:\Espressif\utils\ESP8266\esptool.exe;
+ }
+ else {
+ choco install esp8266-udk
+ }
+
+
+
+# Install esptool2
- git clone https://github.com/raburton/esptool2
- cd esptool2
- make
From 855933d10fe88fee52399930f80fa0362c2180a5 Mon Sep 17 00:00:00 2001
From: robertkendrick
Date: Thu, 3 Aug 2017 07:53:11 +0100
Subject: [PATCH 07/50] Added WifiStation.connect() to Basic_rboot sample
(#1215)
Newer NoOS SDKs seem to need WifiStation.connect() before they will connect to the network. This has been added to the serialCallBack command handler.
---
samples/Basic_rBoot/app/application.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/samples/Basic_rBoot/app/application.cpp b/samples/Basic_rBoot/app/application.cpp
index 46b03d4565..48c7567e97 100644
--- a/samples/Basic_rBoot/app/application.cpp
+++ b/samples/Basic_rBoot/app/application.cpp
@@ -112,6 +112,7 @@ void serialCallBack(Stream& stream, char arrivedChar, unsigned short availableCh
// connect to wifi
WifiStation.config(WIFI_SSID, WIFI_PWD);
WifiStation.enable(true);
+ WifiStation.connect();
} else if (!strcmp(str, "ip")) {
Serial.printf("ip: %s mac: %s\r\n", WifiStation.getIP().toString().c_str(), WifiStation.getMAC().c_str());
} else if (!strcmp(str, "ota")) {
From 43072bd847096ccfe51c630567484ac4005cc5ed Mon Sep 17 00:00:00 2001
From: slaff
Date: Tue, 8 Aug 2017 10:15:28 +0200
Subject: [PATCH 08/50] Ported fix igmp issues. (#1218)
---
Sming/system/include/lwip/igmp.h | 2 +-
Sming/third-party/.patches/esp-open-lwip.patch | 13 +++++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/Sming/system/include/lwip/igmp.h b/Sming/system/include/lwip/igmp.h
index 8cf9a48104..f0c9dea3fa 100644
--- a/Sming/system/include/lwip/igmp.h
+++ b/Sming/system/include/lwip/igmp.h
@@ -96,7 +96,7 @@ void igmp_input(struct pbuf *p, struct netif *inp, ip_addr_t *dest)ICACHE_FLAS
err_t igmp_joingroup(ip_addr_t *ifaddr, ip_addr_t *groupaddr)ICACHE_FLASH_ATTR;
err_t igmp_leavegroup(ip_addr_t *ifaddr, ip_addr_t *groupaddr)ICACHE_FLASH_ATTR;
void igmp_tmr(void)ICACHE_FLASH_ATTR;
-#define LWIP_RAND() rand()
+#define LWIP_RAND() os_random()
#ifdef __cplusplus
}
#endif
diff --git a/Sming/third-party/.patches/esp-open-lwip.patch b/Sming/third-party/.patches/esp-open-lwip.patch
index 9e1875e5b6..21a025222f 100644
--- a/Sming/third-party/.patches/esp-open-lwip.patch
+++ b/Sming/third-party/.patches/esp-open-lwip.patch
@@ -306,3 +306,16 @@ index 24ca8bb..0c20b6a 100644
#endif
/* Keepalive values, compliant with RFC 1122. Don't change this unless you know what you're doing */
+diff --git a/include/lwip/igmp.h b/include/lwip/igmp.h
+index c90adcd..f0c9dea 100644
+--- a/include/lwip/igmp.h
++++ b/include/lwip/igmp.h
+@@ -96,7 +96,7 @@ void igmp_input(struct pbuf *p, struct netif *inp, ip_addr_t *dest)ICACHE_FLAS
+ err_t igmp_joingroup(ip_addr_t *ifaddr, ip_addr_t *groupaddr)ICACHE_FLASH_ATTR;
+ err_t igmp_leavegroup(ip_addr_t *ifaddr, ip_addr_t *groupaddr)ICACHE_FLASH_ATTR;
+ void igmp_tmr(void)ICACHE_FLASH_ATTR;
+-#define LWIP_RAND() r_rand()
++#define LWIP_RAND() os_random()
+ #ifdef __cplusplus
+ }
+ #endif
From 78bcb1d78f683f76a18f2f08e1a275a867f7c48f Mon Sep 17 00:00:00 2001
From: Vogler Hartmut
Date: Sun, 23 Jul 2017 13:32:32 +0200
Subject: [PATCH 09/50] Add methods to config via WPS (ENABLE_WPS=1 must be set
in make) Add ENABLE_WPS switches also to Makefile-rboot.mk Keep the current
opmode unchanged while starting wps Expand readme for WPS notices
---
Readme.md | 2 +
Sming/Makefile | 5 ++
Sming/Makefile-project.mk | 6 +++
Sming/Makefile-rboot.mk | 7 +++
Sming/SmingCore/Platform/Station.cpp | 73 ++++++++++++++++++++++++++++
Sming/SmingCore/Platform/Station.h | 25 ++++++++++
6 files changed, 118 insertions(+)
diff --git a/Readme.md b/Readme.md
index 5acd9f49d6..5573500d6e 100644
--- a/Readme.md
+++ b/Readme.md
@@ -27,6 +27,7 @@ Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native develo
* Out of the box support for OTA over HTTPS.
* [SNI](https://tools.ietf.org/html/rfc6066#page-6) and [Maximum Fragment Length](https://tools.ietf.org/html/rfc6066#page-8) SSL support.
* PWM support based on [Stefan Bruens PWM](https://github.com/StefanBruens/ESP8266_new_pwm.git)
+* WPS support optional activatable
* Optional custom heap allocation based on [Umm Malloc](https://github.com/rhempel/umm_malloc.git)
* Based on Espressif NONOS SDK. Tested with versions 1.4, 1.5 and 2.0.
@@ -62,6 +63,7 @@ n/a = The selected SDK is not available on that OS
- Custom LWIP: (default: ON) By default we are using custom compiled LWIP stack instead of the binary one provided from Espressif. This is increasing the free memory and decreasing the space on the flash. All espconn_* functions are turned off by default. If your application requires the use of some of the espconn_* functions then add the ENABLE_ESPCONN=1 directive. See `Makefile-user.mk` from the [Basic_SmartConfig](https://github.com/SmingHub/Sming/blob/develop/samples/Basic_SmartConfig/Makefile-user.mk#L41) application for examples. If you would like to use the binary LWIP then you should turn off the custom LWIP compilation by providing `ENABLE_CUSTOM_LWIP=0`.
- SSL: (default: OFF) The SSL support is not built-in by default to conserve resources. If you want to enable it then take a look at the [Readme](https://github.com/SmingHub/Sming/blob/develop/samples/Basic_Ssl/README.md) in the Basic_Ssl samples.
- Custom PWM: (default: ON) If you don't want to use the [open PWM implementation](https://github.com/StefanBruens/ESP8266_new_pwm) then compile your application with `ENABLE_CUSTOM_PWM=0`. There is no need to recompile the Sming library.
+- WPS: (default: OFF) The WPS support (Wi-Fi Protected Setup) is not built-in by default to reach small images sizes in cases, where no WPS is needed. To enable WPS, use the switch ENABLE_WPS=1 for compiling Sming.
- Custom serial baud rate: (default: OFF) The default serial baud rate is 115200. If you want to change it to a higher baud rate you can recompile Sming and your application changing the `COM_SPEED_SERIAL` directive. For example `COM_SPEED_SERIAL=921600`.
- Custom heap allocation: (default: OFF) If your application is experiencing heap fragmentation then you can try the [umm_malloc](https://github.com/rhempel/umm_malloc) heap allocation. To enable it compile Sming with `ENABLE_CUSTOM_HEAP=1`. In order to use it in your sample/application make sure to compile the sample with `ENABLE_CUSTOM_HEAP=1`. **Do not enable custom heap allocation and -mforce-l32 compiler flag together**.
- Debug information log level and format: There are four debug levels: debug=3, info=2, warn=1, error=0. Using `DEBUG_VERBOSE_LEVEL` you can set the desired level (0-3). For example `DEBUG_VERBOSE_LEVEL=2` will show only info messages and above. Another make directive is `DEBUG_PRINT_FILENAME_AND_LINE=1` which enables printing the filename and line number of every debug line. This will require extra space on flash. Note: you can compile the Sming library with a set of debug directives and your project with another settings, this way you can control debugging sepparately for sming and your application code.
diff --git a/Sming/Makefile b/Sming/Makefile
index 49fbf68dfa..87a8d1d6a1 100644
--- a/Sming/Makefile
+++ b/Sming/Makefile
@@ -275,6 +275,11 @@ ifeq ($(ENABLE_SSL),1)
CXXFLAGS += $(AXTLS_FLAGS)
endif
+ifeq ($(ENABLE_WPS), 1)
+ LIBS += wps
+ CFLAGS += -DENABLE_WPS=1
+endif
+
SRC_DIR := $(MODULES)
BUILD_DIR := $(addprefix $(BUILD_BASE)/,$(MODULES))
diff --git a/Sming/Makefile-project.mk b/Sming/Makefile-project.mk
index 03e7b76c53..a711768b51 100644
--- a/Sming/Makefile-project.mk
+++ b/Sming/Makefile-project.mk
@@ -205,6 +205,9 @@ endif
# libraries used in this project, mainly provided by the SDK
LIBS = microc microgcc hal phy pp net80211 $(LIBLWIP) wpa $(LIBMAIN) $(LIBSMING) crypto $(LIBPWM) smartconfig $(EXTRA_LIBS)
+ifeq ($(ENABLE_WPS),1)
+ LIBS += wps
+endif
# compiler flags using during compilation of source files
CFLAGS = -Wpointer-arith -Wundef -Werror -Wl,-EL -nostdlib -mlongcalls -mtext-section-literals -finline-functions -fdata-sections -ffunction-sections -D__ets__ -DICACHE_FLASH -DARDUINO=106 -DCOM_SPEED_SERIAL=$(COM_SPEED_SERIAL) $(USER_CFLAGS) -DENABLE_CMD_EXECUTOR=$(ENABLE_CMD_EXECUTOR)
@@ -221,6 +224,9 @@ else
CFLAGS += -Os -g
STRIP := @true
endif
+ifeq ($(ENABLE_WPS),1)
+ CFLAGS += -DENABLE_WPS=1
+endif
#Append debug options
CFLAGS += -DCUST_FILE_BASE=$$* -DDEBUG_VERBOSE_LEVEL=$(DEBUG_VERBOSE_LEVEL) -DDEBUG_PRINT_FILENAME_AND_LINE=$(DEBUG_PRINT_FILENAME_AND_LINE)
diff --git a/Sming/Makefile-rboot.mk b/Sming/Makefile-rboot.mk
index b26f761668..1564d5e7dc 100644
--- a/Sming/Makefile-rboot.mk
+++ b/Sming/Makefile-rboot.mk
@@ -205,6 +205,10 @@ else
CFLAGS += -Os -g
STRIP := @true
endif
+ifeq ($(ENABLE_WPS),1)
+ CFLAGS += -DENABLE_WPS=1
+endif
+
#Append debug options
CFLAGS += -DCUST_FILE_BASE=$$* -DDEBUG_VERBOSE_LEVEL=$(DEBUG_VERBOSE_LEVEL) -DDEBUG_PRINT_FILENAME_AND_LINE=$(DEBUG_PRINT_FILENAME_AND_LINE)
CXXFLAGS = $(CFLAGS) -fno-rtti -fno-exceptions -std=c++11 -felide-constructors
@@ -252,6 +256,9 @@ ifeq ($(ENABLE_CUSTOM_PWM), 1)
endif
LIBS = microc microgcc hal phy pp net80211 $(LIBLWIP) wpa $(LIBMAIN) $(LIBSMING) crypto $(LIBPWM) smartconfig $(EXTRA_LIBS)
+ifeq ($(ENABLE_WPS),1)
+ LIBS += wps
+endif
# SSL support using axTLS
ifeq ($(ENABLE_SSL),1)
diff --git a/Sming/SmingCore/Platform/Station.cpp b/Sming/SmingCore/Platform/Station.cpp
index 3e2c3ed84e..dde41ae049 100644
--- a/Sming/SmingCore/Platform/Station.cpp
+++ b/Sming/SmingCore/Platform/Station.cpp
@@ -388,6 +388,79 @@ void StationClass::smartConfigStop() {
smartConfigCallback = NULL;
}
+#ifdef ENABLE_WPS
+void StationClass::internalWpsConfig(wps_cb_status status)
+{
+ bool processInternal=true;
+ if (wpsConfigCallback){
+ processInternal=wpsConfigCallback(status);
+ }
+ if (processInternal){
+ switch (status) {
+ case WPS_CB_ST_SUCCESS:
+ debugf("wifi_wps_status_cb(): WPS_CB_ST_SUCCESS\n");
+ wpsConfigStop();
+ connect();
+ break;
+ case WPS_CB_ST_FAILED:
+ debugf("wifi_wps_status_cb(): WPS_CB_ST_FAILED\n");
+ wpsConfigStop();
+ connect(); // try to reconnect with old config
+ break;
+ case WPS_CB_ST_TIMEOUT:
+ debugf("wifi_wps_status_cb(): WPS_CB_ST_TIMEOUT\n");
+ wpsConfigStop();
+ connect(); // try to reconnect with old config
+ break;
+ case WPS_CB_ST_WEP:
+ debugf("wifi_wps_status_cb(): WPS_CB_ST_WEP\n");
+ break;
+ default :
+ debugf("wifi_wps_status_cb(): unknown wps_cb_status %d\n",status);
+ wpsConfigStop();
+ connect(); // try to reconnect with old config
+ }
+ }
+}
+
+void StationClass::staticWpsConfigCallback(wps_cb_status status) {
+ WifiStation.internalWpsConfig(status);
+}
+
+bool StationClass::wpsConfigStart(WPSConfigDelegate callback) {
+ debugf("WPS start\n");
+ wpsConfigCallback=callback;
+ wifi_station_disconnect();
+ wifi_set_opmode_current(wifi_get_opmode() | STATION_MODE);
+ debugf("WPS stationmode activated\n");
+ if(!wifi_wps_enable(WPS_TYPE_PBC)) {
+ debugf("StationClass::wpsConfigStart() : wps enable failed\n");
+ return(false);
+ }
+ if(!wifi_set_wps_cb((wps_st_cb_t) &staticWpsConfigCallback)) {
+ debugf("StationClass::wpsConfigStart() : cb failed\n");
+ return(false);
+ }
+
+ if(!wifi_wps_start()) {
+ debugf("StationClass::wpsConfigStart() : wifi_wps_start() failed\n");
+ return(false);
+ }
+ return(true);
+}
+
+bool StationClass::beginWPSConfig() {
+ debugf("StationClass::beginWPSConfig()\n");
+ return(wpsConfigStart());
+}
+
+void StationClass::wpsConfigStop() {
+ if(!wifi_wps_disable()) {
+ debugf("StationClass::wpsConfigStop() : wifi_wps_disable() failed\n");
+ }
+}
+#endif
+
////////////
BssInfo::BssInfo(bss_info* info)
diff --git a/Sming/SmingCore/Platform/Station.h b/Sming/SmingCore/Platform/Station.h
index b78484ee5f..4c6f60fe4b 100644
--- a/Sming/SmingCore/Platform/Station.h
+++ b/Sming/SmingCore/Platform/Station.h
@@ -71,6 +71,9 @@ typedef Vector BssList; ///< List of BSS
typedef Delegate ScanCompletedDelegate; ///< Scan complete handler function
typedef Delegate ConnectionDelegate; ///< Connection handler function
typedef Delegate SmartConfigDelegate; ///< Smart configuration handler function
+#ifdef ENABLE_WPS
+typedef Delegate WPSConfigDelegate;
+#endif
/** @} */
class StationClass : protected ISystemReadyHandler
@@ -218,6 +221,25 @@ class StationClass : protected ISystemReadyHandler
*/
void smartConfigStop();
+#ifdef ENABLE_WPS
+ /** @brief Start WiFi station by WPS method
+ * @param callback Function to call on WiFi WPS Events (Default: none)
+ */
+ bool wpsConfigStart(WPSConfigDelegate callback=NULL);
+
+ /** @brief Start WiFi station by WPS method
+ * @param callback Function to call on WiFi staton smart configuration complete (Default: none)
+ */
+ bool beginWPSConfig();
+
+ /** @brief Stop WiFi station WPS configuration
+ */
+ void wpsConfigStop();
+
+ void internalWpsConfig(wps_cb_status status);
+ static void staticWpsConfigCallback(wps_cb_status status);
+#endif
+
protected:
virtual void onSystemReady();
static void staticScanCompleted(void *arg, STATUS status);
@@ -231,6 +253,9 @@ class StationClass : protected ISystemReadyHandler
private:
ScanCompletedDelegate scanCompletedCallback;
SmartConfigDelegate smartConfigCallback = NULL;
+#ifdef ENABLE_WPS
+ WPSConfigDelegate wpsConfigCallback = NULL;
+#endif
bool runScan;
};
From 7d28d063168b65b5c9522af4f0f970ddb484c96e Mon Sep 17 00:00:00 2001
From: Slavey Karadzhov
Date: Mon, 14 Aug 2017 08:20:01 +0200
Subject: [PATCH 10/50] WPS: Small changes to the documentation.
---
Readme.md | 3 +--
Sming/SmingCore/Platform/Station.h | 1 -
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/Readme.md b/Readme.md
index 5573500d6e..726675a0c0 100644
--- a/Readme.md
+++ b/Readme.md
@@ -27,7 +27,6 @@ Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native develo
* Out of the box support for OTA over HTTPS.
* [SNI](https://tools.ietf.org/html/rfc6066#page-6) and [Maximum Fragment Length](https://tools.ietf.org/html/rfc6066#page-8) SSL support.
* PWM support based on [Stefan Bruens PWM](https://github.com/StefanBruens/ESP8266_new_pwm.git)
-* WPS support optional activatable
* Optional custom heap allocation based on [Umm Malloc](https://github.com/rhempel/umm_malloc.git)
* Based on Espressif NONOS SDK. Tested with versions 1.4, 1.5 and 2.0.
@@ -63,7 +62,7 @@ n/a = The selected SDK is not available on that OS
- Custom LWIP: (default: ON) By default we are using custom compiled LWIP stack instead of the binary one provided from Espressif. This is increasing the free memory and decreasing the space on the flash. All espconn_* functions are turned off by default. If your application requires the use of some of the espconn_* functions then add the ENABLE_ESPCONN=1 directive. See `Makefile-user.mk` from the [Basic_SmartConfig](https://github.com/SmingHub/Sming/blob/develop/samples/Basic_SmartConfig/Makefile-user.mk#L41) application for examples. If you would like to use the binary LWIP then you should turn off the custom LWIP compilation by providing `ENABLE_CUSTOM_LWIP=0`.
- SSL: (default: OFF) The SSL support is not built-in by default to conserve resources. If you want to enable it then take a look at the [Readme](https://github.com/SmingHub/Sming/blob/develop/samples/Basic_Ssl/README.md) in the Basic_Ssl samples.
- Custom PWM: (default: ON) If you don't want to use the [open PWM implementation](https://github.com/StefanBruens/ESP8266_new_pwm) then compile your application with `ENABLE_CUSTOM_PWM=0`. There is no need to recompile the Sming library.
-- WPS: (default: OFF) The WPS support (Wi-Fi Protected Setup) is not built-in by default to reach small images sizes in cases, where no WPS is needed. To enable WPS, use the switch ENABLE_WPS=1 for compiling Sming.
+- WPS: (default: OFF) The WPS support (Wi-Fi Protected Setup) is not activated by default to preserve resources. To enable WPS, use the switch ENABLE_WPS=1 for compiling Sming.
- Custom serial baud rate: (default: OFF) The default serial baud rate is 115200. If you want to change it to a higher baud rate you can recompile Sming and your application changing the `COM_SPEED_SERIAL` directive. For example `COM_SPEED_SERIAL=921600`.
- Custom heap allocation: (default: OFF) If your application is experiencing heap fragmentation then you can try the [umm_malloc](https://github.com/rhempel/umm_malloc) heap allocation. To enable it compile Sming with `ENABLE_CUSTOM_HEAP=1`. In order to use it in your sample/application make sure to compile the sample with `ENABLE_CUSTOM_HEAP=1`. **Do not enable custom heap allocation and -mforce-l32 compiler flag together**.
- Debug information log level and format: There are four debug levels: debug=3, info=2, warn=1, error=0. Using `DEBUG_VERBOSE_LEVEL` you can set the desired level (0-3). For example `DEBUG_VERBOSE_LEVEL=2` will show only info messages and above. Another make directive is `DEBUG_PRINT_FILENAME_AND_LINE=1` which enables printing the filename and line number of every debug line. This will require extra space on flash. Note: you can compile the Sming library with a set of debug directives and your project with another settings, this way you can control debugging sepparately for sming and your application code.
diff --git a/Sming/SmingCore/Platform/Station.h b/Sming/SmingCore/Platform/Station.h
index 4c6f60fe4b..2f0363c3e6 100644
--- a/Sming/SmingCore/Platform/Station.h
+++ b/Sming/SmingCore/Platform/Station.h
@@ -228,7 +228,6 @@ class StationClass : protected ISystemReadyHandler
bool wpsConfigStart(WPSConfigDelegate callback=NULL);
/** @brief Start WiFi station by WPS method
- * @param callback Function to call on WiFi staton smart configuration complete (Default: none)
*/
bool beginWPSConfig();
From 3132cda3619a977144f1e28f81bd0f1e13182d31 Mon Sep 17 00:00:00 2001
From: Max Weller
Date: Mon, 21 Aug 2017 12:28:47 +0200
Subject: [PATCH 11/50] fix python3 compatibility problem in decode-stacktrace
---
tools/decode-stacktrace.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/decode-stacktrace.py b/tools/decode-stacktrace.py
index b1ac29e871..52628f7fc0 100755
--- a/tools/decode-stacktrace.py
+++ b/tools/decode-stacktrace.py
@@ -47,6 +47,6 @@ def extractAddresses(data):
line = "\r\n".join(addresses)+"\r\n"
# line = line.ljust(125," ")
- pipe.stdin.write(line)
+ pipe.stdin.write(line.encode('ascii'))
pipe.stdin.flush()
From d408e7de1382c22c2ac0289a1a074821eb504186 Mon Sep 17 00:00:00 2001
From: Maya Posch
Date: Mon, 4 Sep 2017 11:43:09 +0200
Subject: [PATCH 12/50] Add custom PWM compile flag to enable old PWM library
behaviour. (#1237)
---
Sming/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/Sming/Makefile b/Sming/Makefile
index 39d0b826d0..b5fba81462 100644
--- a/Sming/Makefile
+++ b/Sming/Makefile
@@ -221,6 +221,7 @@ LIBS = microc microgcc hal phy pp net80211 $(LIBLWIP) wpa main
ENABLE_CUSTOM_PWM ?= 1
ifeq ($(ENABLE_CUSTOM_PWM), 1)
THIRD_PARTY_DATA += third-party/pwm/pwm.c
+ CFLAGS += -DSDK_PWM_PERIOD_COMPAT_MODE=1
endif
MFORCE32 := $(shell $(CC) --help=target | grep mforce-l32)
From 7c759fca7dcf10455c4dddd8d906c97e75d38eea Mon Sep 17 00:00:00 2001
From: slaff
Date: Tue, 19 Sep 2017 13:45:31 +0200
Subject: [PATCH 13/50] Updated Spiffs code to version 0.3.7 + fixes. (#1246)
Developers will have to call `make dist-clean` in order to test the newer version.
---
Sming/Services/SpifFS/spiffs_config.h | 18 ++++++++++++++++++
Sming/third-party/spiffs | 2 +-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/Sming/Services/SpifFS/spiffs_config.h b/Sming/Services/SpifFS/spiffs_config.h
index 84436f6c5d..8a931a149a 100644
--- a/Sming/Services/SpifFS/spiffs_config.h
+++ b/Sming/Services/SpifFS/spiffs_config.h
@@ -35,6 +35,10 @@
#ifndef SPIFFS_CHECK_DBG
#define SPIFFS_CHECK_DBG(...) //printf(__VA_ARGS__)
#endif
+// Set spiffs debug output call for all api invocations.
+#ifndef SPIFFS_API_DBG
+#define SPIFFS_API_DBG(_f, ...) //printf(_f, ## __VA_ARGS__)
+#endif
// Enable/disable API functions to determine exact number of bytes
// for filedescriptor and cache buffers. Once decided for a configuration,
@@ -103,6 +107,20 @@
#define SPIFFS_OBJ_NAME_LEN (32)
#endif
+// Maximum length of the metadata associated with an object.
+// Setting to non-zero value enables metadata-related API but also
+// changes the on-disk format, so the change is not backward-compatible.
+//
+// Do note: the meta length must never exceed
+// logical_page_size - (SPIFFS_OBJ_NAME_LEN + 64)
+//
+// This is derived from following:
+// logical_page_size - (SPIFFS_OBJ_NAME_LEN + sizeof(spiffs_page_header) +
+// spiffs_object_ix_header fields + at least some LUT entries)
+#ifndef SPIFFS_OBJ_META_LEN
+#define SPIFFS_OBJ_META_LEN (0)
+#endif
+
// Size of buffer allocated on stack used when copying data.
// Lower value generates more read/writes. No meaning having it bigger
// than logical page size.
diff --git a/Sming/third-party/spiffs b/Sming/third-party/spiffs
index 21fe570974..f5e26c4e93 160000
--- a/Sming/third-party/spiffs
+++ b/Sming/third-party/spiffs
@@ -1 +1 @@
-Subproject commit 21fe570974103f71cf7ff02f9888c77746fbc66d
+Subproject commit f5e26c4e933189593a71c6b82cda381a7b21e41c
From 73f0c0d208e16863bd24d9858c3c70bc45ed2d45 Mon Sep 17 00:00:00 2001
From: slaff
Date: Tue, 19 Sep 2017 13:46:10 +0200
Subject: [PATCH 14/50] Allow HttpResponse::sendString to be used multiple
times for a single response. (#1243)
Fixes #1240.
---
Sming/SmingCore/Network/Http/HttpResponse.cpp | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/Sming/SmingCore/Network/Http/HttpResponse.cpp b/Sming/SmingCore/Network/Http/HttpResponse.cpp
index 1715b23b70..7729df71a8 100644
--- a/Sming/SmingCore/Network/Http/HttpResponse.cpp
+++ b/Sming/SmingCore/Network/Http/HttpResponse.cpp
@@ -55,22 +55,20 @@ HttpResponse* HttpResponse::setHeader(const String& name, const String& value)
bool HttpResponse::sendString(const String& text)
{
- MemoryDataStream* memStream = new MemoryDataStream();
- if (memStream->write((const uint8_t*)text.c_str(), text.length()) != text.length()) {
- delete memStream;
- return false;
- }
-
- if (stream != NULL)
- {
+ if (stream != NULL && stream->getStreamType() != eSST_Memory) {
SYSTEM_ERROR("Stream already created");
delete stream;
stream = NULL;
}
- stream = memStream;
+ if(stream == NULL) {
+ stream = new MemoryDataStream();
+ }
+
+ MemoryDataStream *writable = static_cast(stream);
+ bool success = (writable->write((const uint8_t*)text.c_str(), text.length()) == text.length());
- return true;
+ return success;
}
bool HttpResponse::hasHeader(const String& name)
From ed94fb77d7e8a948e7fc6837844b48d1a94f933c Mon Sep 17 00:00:00 2001
From: tius2000
Date: Fri, 29 Sep 2017 17:54:00 +0200
Subject: [PATCH 15/50] m_printf: stacksize reduced (#1097)
reduced buffer size from 256 to 128 bytes
allocate more stack if required
size is no longer limited
---
Sming/system/m_printf.cpp | 38 ++++++++++++++++++--------------------
1 file changed, 18 insertions(+), 20 deletions(-)
diff --git a/Sming/system/m_printf.cpp b/Sming/system/m_printf.cpp
index 03971661ab..507f873e00 100644
--- a/Sming/system/m_printf.cpp
+++ b/Sming/system/m_printf.cpp
@@ -9,7 +9,7 @@ Descr: embedded very simple version of printf with float support
#include
#include "osapi.h"
-#define MPRINTF_BUF_SIZE 256
+#define INITIAL_BUFFSIZE 128
static void defaultPrintChar(uart_t *uart, char c) {
return uart_tx_one_char(c);
@@ -62,27 +62,25 @@ int m_snprintf(char* buf, int length, const char *fmt, ...)
return n;
}
-int m_vprintf ( const char * format, va_list arg )
+int m_vprintf(const char *fmt, va_list va)
{
- if(!cbc_printchar)
- {
- return 0;
- }
-
- char buf[MPRINTF_BUF_SIZE], *p;
-
- int n = 0;
- m_vsnprintf(buf, sizeof(buf), format, arg);
-
- p = buf;
- while (p && n < sizeof(buf) && *p)
- {
- cbc_printchar(cbc_printchar_uart, *p);
- n++;
- p++;
- }
+ size_t size = INITIAL_BUFFSIZE - 1;
+
+ // need to retry if size is not big enough
+ while (1) {
+ char buffer[size + 1];
+ size_t sz = m_vsnprintf(buffer, sizeof(buffer), fmt, va);
+ if (sz > size) {
+ size = sz;
+ continue;
+ }
- return n;
+ const char *p = buffer;
+ while (char c = *p++) {
+ cbc_printchar(cbc_printchar_uart, c);
+ }
+ return sz;
+ }
}
/**
From 481eeb1c3970e4a6ec3280da1b098dbffe9b9731 Mon Sep 17 00:00:00 2001
From: Piotr Dobrowolski
Date: Mon, 9 Oct 2017 10:16:50 +0200
Subject: [PATCH 16/50] Makefile: clear rboot configuration when flashing
(#1249)
make flash always flashes image 0. If rboot is switched to image 1,
device will sill boot second image. This flashes blank.bin over rboot
configuration sector (0x1000 address).
---
Sming/Makefile-rboot.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Sming/Makefile-rboot.mk b/Sming/Makefile-rboot.mk
index 1564d5e7dc..a75b30f0ce 100644
--- a/Sming/Makefile-rboot.mk
+++ b/Sming/Makefile-rboot.mk
@@ -534,10 +534,10 @@ flash: all
-$(Q) $(KILL_TERM)
ifeq ($(DISABLE_SPIFFS), 1)
# flashes rboot and first rom
- $(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED_ESPTOOL) write_flash $(flashimageoptions) 0x00000 $(RBOOT_BIN) 0x02000 $(RBOOT_ROM_0)
+ $(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED_ESPTOOL) write_flash $(flashimageoptions) 0x00000 $(RBOOT_BIN) 0x01000 $(SDK_BASE)/bin/blank.bin 0x02000 $(RBOOT_ROM_0)
else
# flashes rboot, first rom and spiffs
- $(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED_ESPTOOL) write_flash $(flashimageoptions) 0x00000 $(RBOOT_BIN) 0x02000 $(RBOOT_ROM_0) $(RBOOT_SPIFFS_0) $(SPIFF_BIN_OUT)
+ $(ESPTOOL) -p $(COM_PORT) -b $(COM_SPEED_ESPTOOL) write_flash $(flashimageoptions) 0x00000 $(RBOOT_BIN) 0x01000 $(SDK_BASE)/bin/blank.bin 0x02000 $(RBOOT_ROM_0) $(RBOOT_SPIFFS_0) $(SPIFF_BIN_OUT)
endif
$(TERMINAL)
From a1ac636bb691ad02c7d5e699a6da8a4cc9c592e7 Mon Sep 17 00:00:00 2001
From: slaff
Date: Mon, 9 Oct 2017 22:40:53 +0200
Subject: [PATCH 17/50] Simplified and improved Http Client and Http Server
stream handling (#1247)
Added support for chunked transfer encoding.
Added support for multipart streams.
Sending and receiving data should require less memory.
Fixed sending of big streams over SSL.
Added sample that demos secure HTTP upload of a "big" local file to remote server.
Sending of "endless" data from the HttpClient and HttpServer should work as expected.
---
Sming/Libraries/ArduCAM/ArduCAMStream.cpp | 3 +
Sming/Libraries/ArduCAM/ArduCAMStream.h | 18 +-
Sming/SmingCore/CircularBuffer.cpp | 123 +++++++++
Sming/SmingCore/CircularBuffer.h | 101 ++++++++
Sming/SmingCore/DataSourceStream.cpp | 6 +-
Sming/SmingCore/DataSourceStream.h | 26 +-
Sming/SmingCore/Network/Http/HttpCommon.h | 11 +
.../SmingCore/Network/Http/HttpConnection.cpp | 235 ++++++++++--------
Sming/SmingCore/Network/Http/HttpConnection.h | 14 +-
Sming/SmingCore/Network/Http/HttpRequest.cpp | 6 +-
Sming/SmingCore/Network/Http/HttpRequest.h | 6 +-
Sming/SmingCore/Network/Http/HttpResponse.cpp | 8 +-
Sming/SmingCore/Network/Http/HttpResponse.h | 6 +-
.../Network/Http/HttpServerConnection.cpp | 179 ++++++++-----
.../Network/Http/HttpServerConnection.h | 12 +-
.../Network/Http/Stream/HttpChunkedStream.cpp | 74 ++++++
.../Network/Http/Stream/HttpChunkedStream.h | 69 +++++
.../Http/Stream/HttpMultipartStream.cpp | 109 ++++++++
.../Network/Http/Stream/HttpMultipartStream.h | 90 +++++++
Sming/SmingCore/Network/TcpClient.h | 7 +-
Sming/SmingCore/Network/TcpConnection.cpp | 9 +-
samples/Arducam/app/application.cpp | 49 ++--
samples/Basic_WebClient/Makefile-user.mk | 2 +-
samples/Basic_WebClient/app/application.cpp | 39 ++-
24 files changed, 961 insertions(+), 241 deletions(-)
create mode 100644 Sming/SmingCore/CircularBuffer.cpp
create mode 100644 Sming/SmingCore/CircularBuffer.h
create mode 100644 Sming/SmingCore/Network/Http/Stream/HttpChunkedStream.cpp
create mode 100644 Sming/SmingCore/Network/Http/Stream/HttpChunkedStream.h
create mode 100644 Sming/SmingCore/Network/Http/Stream/HttpMultipartStream.cpp
create mode 100644 Sming/SmingCore/Network/Http/Stream/HttpMultipartStream.h
diff --git a/Sming/Libraries/ArduCAM/ArduCAMStream.cpp b/Sming/Libraries/ArduCAM/ArduCAMStream.cpp
index c21adcc247..54791f6667 100644
--- a/Sming/Libraries/ArduCAM/ArduCAMStream.cpp
+++ b/Sming/Libraries/ArduCAM/ArduCAMStream.cpp
@@ -78,6 +78,9 @@ bool ArduCAMStream::isFinished() {
uint16_t ArduCAMStream::readMemoryBlock(char* data, int bufSize) {
+ if(!dataReady()) {
+ return 0;
+ }
if (!transfer) {
transfer = true;
diff --git a/Sming/Libraries/ArduCAM/ArduCAMStream.h b/Sming/Libraries/ArduCAM/ArduCAMStream.h
index 29416bc965..c1dd82734f 100644
--- a/Sming/Libraries/ArduCAM/ArduCAMStream.h
+++ b/Sming/Libraries/ArduCAM/ArduCAMStream.h
@@ -10,11 +10,10 @@
#include "ArduCAM.h"
-
#include "../../Services/HexDump/HexDump.h"
-class ArduCAMStream: public IDataSourceStream {
+class ArduCAMStream: public ReadWriteStream {
public:
ArduCAMStream(ArduCAM *cam);
virtual ~ArduCAMStream();
@@ -25,6 +24,21 @@ class ArduCAMStream: public IDataSourceStream {
virtual bool seek(int len);
virtual bool isFinished();
+ virtual size_t write(uint8_t charToWrite)
+ {
+ return 0;
+ }
+
+ /** @brief Write chars to stream
+ * @param buffer Pointer to buffer to write to the stream
+ * @param size Quantity of chars to writen
+ * @retval size_t Quantity of chars written to stream
+ */
+ virtual size_t write(const uint8_t *buffer, size_t size)
+ {
+ return 0;
+ }
+
bool dataReady();
size_t available();
diff --git a/Sming/SmingCore/CircularBuffer.cpp b/Sming/SmingCore/CircularBuffer.cpp
new file mode 100644
index 0000000000..b005cd7172
--- /dev/null
+++ b/Sming/SmingCore/CircularBuffer.cpp
@@ -0,0 +1,123 @@
+/****
+ * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
+ * Created 2015 by Skurydin Alexey
+ * http://github.com/SmingHub/Sming
+ * All files of the Sming Core are provided under the LGPL v3 license.
+ *
+ * Initial code done by Ivan Grokhotkov as part of the esp8266 core for Arduino environment.
+ * https://github.com/esp8266/Arduino/blob/master/cores/esp8266/cbuf.h
+ *
+ * Adapted for Sming by Slavey Karadzhov
+ *
+ ****/
+
+#include "CircularBuffer.h"
+
+CircularBuffer::CircularBuffer(int size): buffer(new char[size]), readPos(buffer), writePos(buffer), size(size)
+{
+
+}
+
+CircularBuffer::~CircularBuffer()
+{
+ delete[] buffer;
+}
+
+StreamType CircularBuffer::getStreamType()
+{
+ return StreamType::eSST_Memory;
+}
+
+uint16_t CircularBuffer::readMemoryBlock(char* data, int bufSize)
+{
+ size_t bytesAvailable = length();
+ size_t sizeToRead = (bufSize < bytesAvailable) ? bufSize : bytesAvailable;
+ size_t sizeRead = sizeToRead;
+ char * start = readPos;
+ if(writePos < readPos && sizeToRead > (size_t) ((buffer + size) - readPos)) {
+ size_t topSize = (buffer + size) - readPos;
+ memcpy(data, readPos, topSize);
+ start = buffer;
+ sizeToRead -= topSize;
+ data += topSize;
+ }
+ memcpy(data, start, sizeToRead);
+ return sizeRead;
+}
+
+bool CircularBuffer::seek(int len)
+{
+ if(len > length()) {
+ flush();
+ return false;
+ }
+
+ if(readPos < writePos) {
+ readPos += len;
+ }
+ else if(readPos + len > buffer + size) {
+ readPos = buffer + (len - (buffer + size - readPos));
+ }
+ else {
+ readPos += len;
+ }
+
+ return true;
+}
+
+bool CircularBuffer::isFinished()
+{
+ return (length() < 1);
+}
+
+int CircularBuffer::length()
+{
+ if(writePos >= readPos) {
+ return writePos - readPos;
+ }
+ return size - (readPos - writePos);
+}
+
+size_t CircularBuffer::room() const
+{
+ if(writePos >= readPos) {
+ return size - (writePos - readPos) - 1;
+ }
+ return readPos - writePos - 1;
+}
+
+
+String CircularBuffer::id()
+{
+ // TODO: check if that is printing the address of the buffer...
+ return String((char *)&buffer);
+}
+
+size_t CircularBuffer::write(uint8_t charToWrite)
+{
+ if(!room()) {
+ return 0;
+ }
+
+ *writePos = charToWrite;
+ writePos = wrap(writePos + 1);
+
+ return 1;
+}
+
+size_t CircularBuffer::write(const uint8_t *data, size_t bufSize)
+{
+ size_t space = room();
+ size_t sizeToWrite = (bufSize < space) ? bufSize : space;
+ size_t sizeWritten = sizeToWrite;
+ if(writePos >= readPos && sizeToWrite > (size_t) (buffer + size - writePos)) {
+ size_t topSize = buffer + size - writePos;
+ memcpy(writePos, data, topSize);
+ writePos = buffer;
+ sizeToWrite -= topSize;
+ data += topSize;
+ }
+ memcpy(writePos, data, sizeToWrite);
+ writePos = wrap(writePos + sizeToWrite);
+ return sizeWritten;
+}
diff --git a/Sming/SmingCore/CircularBuffer.h b/Sming/SmingCore/CircularBuffer.h
new file mode 100644
index 0000000000..8eef647f14
--- /dev/null
+++ b/Sming/SmingCore/CircularBuffer.h
@@ -0,0 +1,101 @@
+/****
+ * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
+ * Created 2015 by Skurydin Alexey
+ * http://github.com/SmingHub/Sming
+ * All files of the Sming Core are provided under the LGPL v3 license.
+ *
+ * Initial code done by Ivan Grokhotkov as part of the esp8266 core for Arduino environment.
+ * https://github.com/esp8266/Arduino/blob/master/cores/esp8266/cbuf.h
+ *
+ * Adapted for Sming by Slavey Karadzhov
+ *
+ ****/
+
+#ifndef _SMING_CORE_CIRCULARBUFFER_H_
+#define _SMING_CORE_CIRCULARBUFFER_H_
+
+#include "DataSourceStream.h"
+
+/**
+ * @brief Circular stream class
+ * @ingroup stream
+ *
+ * @{
+*/
+
+///Base class for data source stream
+class CircularBuffer: public ReadWriteStream
+{
+public:
+ CircularBuffer(int size);
+
+ virtual ~CircularBuffer();
+
+ /** @brief Get the stream type
+ * @retval StreamType The stream type.
+ * @todo Return value of IDataSourceStream:getStreamType base class function should be of type StreamType, e.g. eSST_User
+ */
+ virtual StreamType getStreamType();
+
+ /** @brief Read a block of memory
+ * @param data Pointer to the data to be read
+ * @param bufSize Quantity of chars to read
+ * @retval uint16_t Quantity of chars read
+ * @todo Should IDataSourceStream::readMemoryBlock return same data type as its bufSize param?
+ */
+ virtual uint16_t readMemoryBlock(char* data, int bufSize);
+
+ /** @brief Move read cursor
+ * @param len Position within stream to move cursor to
+ * @retval bool True on success.
+ */
+ virtual bool seek(int len);
+
+ /** @brief Check if stream is finished
+ * @retval bool True on success.
+ */
+ virtual bool isFinished();
+
+ /**
+ * @brief Return the total length of the stream
+ * @retval int -1 is returned when the size cannot be determined
+ */
+ virtual int length();
+
+ /**
+ * @brief Returns unique id of the resource.
+ * @retval String the unique id of the stream.
+ */
+ virtual String id();
+
+ virtual size_t write(uint8_t charToWrite);
+
+ /** @brief Write chars to stream
+ * @param buffer Pointer to buffer to write to the stream
+ * @param size Quantity of chars to writen
+ * @retval size_t Quantity of chars written to stream
+ */
+ virtual size_t write(const uint8_t *buffer, size_t size);
+
+ size_t room() const;
+
+ inline void flush() {
+ readPos = buffer;
+ writePos = buffer;
+ }
+
+private:
+ inline char* wrap(char* ptr) const {
+ return (ptr == buffer + size) ? buffer: ptr;
+ }
+
+
+private:
+ char* buffer = NULL;
+ char* readPos = NULL;
+ char* writePos = NULL;
+ int size = 0;
+};
+
+/** @} */
+#endif /* _SMING_CORE_CIRCULARBUFFER_H_ */
diff --git a/Sming/SmingCore/DataSourceStream.cpp b/Sming/SmingCore/DataSourceStream.cpp
index 760c8d1b78..070e0bb051 100644
--- a/Sming/SmingCore/DataSourceStream.cpp
+++ b/Sming/SmingCore/DataSourceStream.cpp
@@ -17,10 +17,8 @@ MemoryDataStream::MemoryDataStream()
MemoryDataStream::~MemoryDataStream()
{
- if(buf != NULL) {
- free(buf);
- buf = NULL;
- }
+ free(buf);
+ buf = NULL;
pos = NULL;
size = 0;
}
diff --git a/Sming/SmingCore/DataSourceStream.h b/Sming/SmingCore/DataSourceStream.h
index fd81116c66..e0b2a48cc1 100644
--- a/Sming/SmingCore/DataSourceStream.h
+++ b/Sming/SmingCore/DataSourceStream.h
@@ -89,8 +89,26 @@ class IDataSourceStream
virtual String id() { return String(); }
};
+class ReadWriteStream : public IDataSourceStream
+{
+public:
+ virtual ~ReadWriteStream() {}
+
+ virtual size_t write(uint8_t charToWrite) = 0;
+
+ /** @brief Write chars to stream
+ * @param buffer Pointer to buffer to write to the stream
+ * @param size Quantity of chars to writen
+ * @retval size_t Quantity of chars written to stream
+ */
+ virtual size_t write(const uint8_t *buffer, size_t size) = 0;
+
+ //Use base class documentation
+ virtual uint16_t readMemoryBlock(char* data, int bufSize) = 0;
+};
+
/// Memory data stream class
-class MemoryDataStream : public Print, public IDataSourceStream
+class MemoryDataStream : public Print, public ReadWriteStream
{
public:
/** @brief Memory data stream base class
@@ -109,7 +127,7 @@ class MemoryDataStream : public Print, public IDataSourceStream
/** @brief Get size of stream
* @retval int Quantity of chars in stream
*
- * @deprecated Use getLength instead
+ * @deprecated Use length() instead
*/
int getStreamLength() { return size; }
@@ -149,7 +167,7 @@ class MemoryDataStream : public Print, public IDataSourceStream
};
/// File stream class
-class FileStream : public IDataSourceStream
+class FileStream : public ReadWriteStream
{
public:
@@ -188,7 +206,7 @@ class FileStream : public IDataSourceStream
* @brief Return the total length of the stream
* @retval int -1 is returned when the size cannot be determined
*/
- int length() { return -1; }
+ int length() { return size; }
virtual String id();
diff --git a/Sming/SmingCore/Network/Http/HttpCommon.h b/Sming/SmingCore/Network/Http/HttpCommon.h
index 96bfc2a8d5..183d5a1fa0 100644
--- a/Sming/SmingCore/Network/Http/HttpCommon.h
+++ b/Sming/SmingCore/Network/Http/HttpCommon.h
@@ -65,4 +65,15 @@ typedef HashMap HttpParams;
typedef HashMap HttpHeaders;
typedef enum http_method HttpMethod;
+enum HttpConnectionState
+{
+ eHCS_Ready = 0,
+ eHCS_StartSending,
+ eHCS_SendingHeaders,
+ eHCS_StartBody,
+ eHCS_SendingBody,
+ eHCS_Sent
+};
+
+
#endif /* _SMING_CORE_HTTP_COMMON_H_ */
diff --git a/Sming/SmingCore/Network/Http/HttpConnection.cpp b/Sming/SmingCore/Network/Http/HttpConnection.cpp
index 7d4e3c33d6..403069b02b 100644
--- a/Sming/SmingCore/Network/Http/HttpConnection.cpp
+++ b/Sming/SmingCore/Network/Http/HttpConnection.cpp
@@ -11,6 +11,7 @@
****/
#include "HttpConnection.h"
+#include "HttpChunkedStream.h"
#include "../../Services/WebHelpers/escape.h"
@@ -136,9 +137,9 @@ String HttpConnection::getResponseString()
void HttpConnection::reset()
{
- if(currentRequest != NULL) {
- delete currentRequest;
- currentRequest = NULL;
+ if(incomingRequest != NULL) {
+ delete incomingRequest;
+ incomingRequest = NULL;
}
code = 0;
@@ -169,12 +170,12 @@ int HttpConnection::staticOnMessageBegin(http_parser* parser)
connection->reset();
- connection->currentRequest = connection->executionQueue.dequeue();
- if(connection->currentRequest == NULL) {
+ connection->incomingRequest = connection->executionQueue.dequeue();
+ if(connection->incomingRequest == NULL) {
return 1; // there are no requests in the queue
}
- if(connection->currentRequest->responseStream != NULL) {
+ if(connection->incomingRequest->responseStream != NULL) {
connection->mode = eHCM_Stream;
}
else {
@@ -192,39 +193,39 @@ int HttpConnection::staticOnMessageComplete(http_parser* parser)
return -1;
}
- if(!connection->currentRequest) {
+ if(!connection->incomingRequest) {
return -2; // no current request...
}
debugf("staticOnMessageComplete: Execution queue: %d, %s",
connection->executionQueue.count(),
- connection->currentRequest->uri.toString().c_str()
+ connection->incomingRequest->uri.toString().c_str()
);
// we are finished with this request
int hasError = 0;
- if(connection->currentRequest->requestCompletedDelegate) {
+ if(connection->incomingRequest->requestCompletedDelegate) {
bool success = (HTTP_PARSER_ERRNO(parser) == HPE_OK) && // false when the parsing has failed
(connection->code >= 200 && connection->code <= 399); // false when the HTTP status code is not ok
- hasError = connection->currentRequest->requestCompletedDelegate(*connection, success);
+ hasError = connection->incomingRequest->requestCompletedDelegate(*connection, success);
}
- if(connection->currentRequest->auth != NULL) {
- connection->currentRequest->auth->setResponse(connection->getResponse());
+ if(connection->incomingRequest->auth != NULL) {
+ connection->incomingRequest->auth->setResponse(connection->getResponse());
}
- if(connection->currentRequest->retries > 0) {
- connection->currentRequest->retries--;
- return (connection->executionQueue.enqueue(connection->currentRequest)? 0: -1);
+ if(connection->incomingRequest->retries > 0) {
+ connection->incomingRequest->retries--;
+ return (connection->executionQueue.enqueue(connection->incomingRequest)? 0: -1);
}
- if(connection->currentRequest->responseStream != NULL) {
- connection->currentRequest->responseStream->close();
- delete connection->currentRequest->responseStream;
+ if(connection->incomingRequest->responseStream != NULL) {
+ connection->incomingRequest->responseStream->close();
+ delete connection->incomingRequest->responseStream;
}
- delete connection->currentRequest;
- connection->currentRequest = NULL;
+ delete connection->incomingRequest;
+ connection->incomingRequest = NULL;
if(!connection->executionQueue.count()) {
connection->onConnected(ERR_OK);
@@ -259,17 +260,17 @@ int HttpConnection::staticOnHeadersComplete(http_parser* parser)
*/
connection->code = parser->status_code;
- if(connection->currentRequest == NULL) {
+ if(connection->incomingRequest == NULL) {
// nothing to process right now...
return 1;
}
int error = 0;
- if(connection->currentRequest->headersCompletedDelegate) {
- error = connection->currentRequest->headersCompletedDelegate(*connection, connection->responseHeaders);
+ if(connection->incomingRequest->headersCompletedDelegate) {
+ error = connection->incomingRequest->headersCompletedDelegate(*connection, connection->responseHeaders);
}
- if(!error && connection->currentRequest->method == HTTP_HEAD) {
+ if(!error && connection->incomingRequest->method == HTTP_HEAD) {
error = 1;
}
@@ -326,8 +327,8 @@ int HttpConnection::staticOnBody(http_parser *parser, const char *at, size_t len
return -1;
}
- if(connection->currentRequest->requestBodyDelegate) {
- return connection->currentRequest->requestBodyDelegate(*connection, at, length);
+ if(connection->incomingRequest->requestBodyDelegate) {
+ return connection->incomingRequest->requestBodyDelegate(*connection, at, length);
}
if (connection->mode == eHCM_String) {
@@ -335,10 +336,10 @@ int HttpConnection::staticOnBody(http_parser *parser, const char *at, size_t len
return 0;
}
- if(connection->currentRequest->responseStream != NULL) {
- int res = connection->currentRequest->responseStream->write((const uint8_t *)at, length);
+ if(connection->incomingRequest->responseStream != NULL) {
+ int res = connection->incomingRequest->responseStream->write((const uint8_t *)at, length);
if (res != length) {
- connection->currentRequest->responseStream->close();
+ connection->incomingRequest->responseStream->close();
return 1;
}
}
@@ -358,57 +359,100 @@ int HttpConnection::staticOnChunkComplete(http_parser* parser) {
}
#endif
-err_t HttpConnection::onConnected(err_t err) {
- if (err == ERR_OK) {
- debugf("HttpConnection::onConnected: waitingQueue.count: %d", waitingQueue->count());
+void HttpConnection::onReadyToSendData(TcpConnectionEvent sourceEvent) {
- do {
+ if(!(sourceEvent == eTCE_Connected || sourceEvent == eTCE_Sent)) {
+ return;
+ }
+
+ debugf("HttpConnection::onReadyToSendData: waitingQueue.count: %d", waitingQueue->count());
+
+ do {
+ if(state == eHCS_Sent) {
+ state = eHCS_Ready;
+ }
+
+ if(state == eHCS_Ready) {
HttpRequest* request = waitingQueue->peek();
if(request == NULL) {
debugf("Nothing in the waiting queue");
+ outgoingRequest = NULL;
break;
}
+ // if the executionQueue is not empty then we have to check if we can pipeline that request
+ if(executionQueue.count()) {
+ if(!(request->method == HTTP_GET || request->method == HTTP_HEAD)) {
+ // if the current request cannot be pipelined -> break;
+ break;
+ }
+
+ // if we have previous request
+ if(outgoingRequest != NULL) {
+ if(!(outgoingRequest->method == HTTP_GET || outgoingRequest->method == HTTP_HEAD)) {
+ // the outgoing request does not allow pipelining
+ break;
+ }
+ }
+ } // executionQueue.count()
+
if(!executionQueue.enqueue(request)) {
debugf("The working queue is full at the moment");
break;
}
waitingQueue->dequeue();
- send(request);
- if(!(request->method == HTTP_GET || request->method == HTTP_HEAD)) {
- // if the current request cannot be pipelined -> break;
- break;
+ outgoingRequest = request;
+ state = eHCS_SendingHeaders;
+ sendRequestHeaders(request);
+
+ break;
+ }
+
+ if(state >= eHCS_StartSending && state < eHCS_Sent) {
+ if(state == eHCS_SendingHeaders) {
+ if(stream != NULL && !stream->isFinished()) {
+ break;
+ }
+
+ state = eHCS_StartBody;
}
- HttpRequest* nextRequest = waitingQueue->peek();
- if(nextRequest != NULL && !(nextRequest->method == HTTP_GET || nextRequest->method == HTTP_HEAD)) {
- // if the next request cannot be pipelined -> break for now
- break;
+ if(sendRequestBody(outgoingRequest)) {
+ state = eHCS_Sent;
+ delete stream;
+ stream = NULL;
+ continue;
}
- } while(1);
- }
+ }
- TcpClient::onConnected(err);
- return ERR_OK;
+ break;
+
+ } while(true);
+
+ TcpClient::onReadyToSendData(sourceEvent);
}
-void HttpConnection::send(HttpRequest* request) {
+void HttpConnection::sendRequestHeaders(HttpRequest* request) {
sendString(http_method_str(request->method) + String(" ") + request->uri.getPathWithQuery() + " HTTP/1.1\r\nHost: " + request->uri.Host + "\r\n");
+ // TODO: represent the post params as stream ...
+
// Adjust the content-length
request->headers["Content-Length"] = "0";
if(request->rawDataLength) {
request->headers["Content-Length"] = String(request->rawDataLength);
}
- else if (request->stream != NULL && request->stream->length() > -1) {
- request->headers["Content-Length"] = String(request->stream->length());
+ else if (request->stream != NULL) {
+ if(request->stream->length() > -1) {
+ request->headers["Content-Length"] = String(request->stream->length());
+ }
+ else {
+ request->headers.remove("Content-Length");
+ }
}
- // TODO: represent the post params as stream ...
-
-
if(!request->headers.contains("Content-Length")) {
request->headers["Transfer-Encoding"] = "chunked";
}
@@ -423,72 +467,61 @@ void HttpConnection::send(HttpRequest* request) {
sendString(write.c_str());
}
sendString("\r\n");
+}
- // Send content
+bool HttpConnection::sendRequestBody(HttpRequest* request) {
+ if(state == eHCS_StartBody) {
+ state = eHCS_SendingBody;
+ // if there is input raw data -> send it
+ if(request->rawDataLength > 0) {
+ TcpClient::send((const char*)request->rawData, (uint16_t)request->rawDataLength);
+ request->rawDataLength = 0;
- // if there is input raw data -> send it
- if(request->rawDataLength > 0) {
- TcpClient::send((const char*)request->rawData, (uint16_t)request->rawDataLength);
- }
- else if(request->stream != NULL) {
- send(request->stream);
+ return false;
+ }
- debugf("Stream completed");
- delete request->stream;
- request->stream = NULL;
- }
#if 0
+ // Post Params should be also stream...
+ if (request->postParams.count()) {
+ for(int i = 0; i < request->postParams.count(); i++) {
+ // TODO: prevent memory fragmentation ...
+ char *dest = uri_escape(NULL, 0, request->postParams.valueAt(i).c_str(), request->postParams.valueAt(i).length());
+ String write = request->postParams.keyAt(i) + "=" + String(dest) + "&";
+ sendString(write.c_str());
+ free(dest);
+ }
+ }
+#endif
- // Post Params should be also stream...
+ if(request->stream == NULL) {
+ return true;
+ }
- else if (request->postParams.count()) {
- for(int i = 0; i < request->postParams.count(); i++) {
- // TODO: prevent memory fragmentation ...
- char *dest = uri_escape(NULL, 0, request->postParams.valueAt(i).c_str(), request->postParams.valueAt(i).length());
- String write = request->postParams.keyAt(i) + "=" + String(dest) + "&";
- sendString(write.c_str());
- free(dest);
+ delete stream;
+ if(request->headers["Transfer-Encoding"] == "chunked") {
+ stream = new HttpChunkedStream(request->stream);
+ }
+ else {
+ stream = request->stream; // avoid intermediate buffers
}
+ request->stream = NULL;
+ return false;
}
-#endif
-}
-
-bool HttpConnection::send(IDataSourceStream* inputStream, bool forceCloseAfterSent /* = false*/)
-{
- if(inputStream->length() != -1) {
- // send the data as one big blob
- do {
- int len = 256;
- char data[len];
- len = inputStream->readMemoryBlock(data, len);
- TcpClient::send(data, len);
- inputStream->seek(max(len, 0));
- } while(!inputStream->isFinished());
+ if(stream == NULL) {
+ // we are done for now
return true;
}
- // Send the data in chunked-encoding
-
- do {
- int len = 256;
- char data[len];
- len = inputStream->readMemoryBlock(data, len);
-
- // send the data in chunks...
- sendString(String(len)+ "\r\n");
- TcpClient::send(data, len);
- sendString("\n\r");
- inputStream->seek(max(len, 0));
- } while(!inputStream->isFinished());
-
- sendString("0\r\n\r\n", forceCloseAfterSent);
+ if(request->stream == NULL && !stream->isFinished()) {
+ return false;
+ }
return true;
}
HttpRequest* HttpConnection::getRequest() {
- return currentRequest;
+ return incomingRequest;
}
HttpResponse* HttpConnection::getResponse() {
@@ -508,7 +541,7 @@ HttpResponse* HttpConnection::getResponse() {
MemoryDataStream* memory = new MemoryDataStream();
memory->write((uint8_t *)responseStringData.c_str(), responseStringData.length());
- response->stream = (IDataSourceStream* )memory;
+ response->stream = memory;
}
return response;
}
diff --git a/Sming/SmingCore/Network/Http/HttpConnection.h b/Sming/SmingCore/Network/Http/HttpConnection.h
index 2ea81f7072..019f71ee74 100644
--- a/Sming/SmingCore/Network/Http/HttpConnection.h
+++ b/Sming/SmingCore/Network/Http/HttpConnection.h
@@ -77,14 +77,11 @@ class HttpConnection : protected TcpClient {
protected:
void reset();
- virtual err_t onConnected(err_t err);
virtual err_t onReceive(pbuf *buf);
virtual err_t onProtocolUpgrade(http_parser* parser);
-
+ virtual void onReadyToSendData(TcpConnectionEvent sourceEvent);
virtual void onError(err_t err);
- bool send(IDataSourceStream* inputStream, bool forceCloseAfterSent = false);
-
void cleanup();
private:
@@ -102,6 +99,9 @@ class HttpConnection : protected TcpClient {
#endif
static int IRAM_ATTR staticOnMessageComplete(http_parser* parser);
+ void sendRequestHeaders(HttpRequest* request);
+ bool sendRequestBody(HttpRequest* request);
+
protected:
HttpClientMode mode;
String responseStringData;
@@ -117,7 +117,11 @@ class HttpConnection : protected TcpClient {
bool lastWasValue = true;
String lastData = "";
String currentField = "";
- HttpRequest* currentRequest = NULL;
+ HttpRequest* incomingRequest = NULL;
+ HttpRequest* outgoingRequest = NULL;
+
+private:
+ HttpConnectionState state = eHCS_Ready;
};
#endif /* _SMING_CORE_HTTP_CONNECTION_H_ */
diff --git a/Sming/SmingCore/Network/Http/HttpRequest.cpp b/Sming/SmingCore/Network/Http/HttpRequest.cpp
index 26cd7607d6..7dddbc8b93 100644
--- a/Sming/SmingCore/Network/Http/HttpRequest.cpp
+++ b/Sming/SmingCore/Network/Http/HttpRequest.cpp
@@ -12,7 +12,7 @@
#include "HttpRequest.h"
-HttpRequest::HttpRequest(URL uri) {
+HttpRequest::HttpRequest(const URL& uri) {
this->uri = uri;
}
@@ -209,7 +209,7 @@ HttpRequest* HttpRequest::setBody(const String& body) {
if(written < body.length()) {
debugf("HttpRequest::setBody: Unable to store the complete body");
}
- stream = (IDataSourceStream*)memory;
+ stream = memory;
return this;
}
@@ -219,7 +219,7 @@ HttpRequest* HttpRequest::setBody(uint8_t *rawData, size_t length) {
return this;
}
-HttpRequest* HttpRequest::setBody(IDataSourceStream *stream) {
+HttpRequest* HttpRequest::setBody(ReadWriteStream *stream) {
this->stream = stream;
return this;
}
diff --git a/Sming/SmingCore/Network/Http/HttpRequest.h b/Sming/SmingCore/Network/Http/HttpRequest.h
index 23aac97ae3..59de80a991 100644
--- a/Sming/SmingCore/Network/Http/HttpRequest.h
+++ b/Sming/SmingCore/Network/Http/HttpRequest.h
@@ -35,7 +35,7 @@ class HttpRequest {
public:
- HttpRequest(URL uri);
+ HttpRequest(const URL& uri);
HttpRequest(const HttpRequest& value);
__forceinline HttpRequest* clone() const { return new HttpRequest(*this); }
HttpRequest& operator = (const HttpRequest& rhs);
@@ -107,7 +107,7 @@ class HttpRequest {
#endif
HttpRequest* setBody(const String& body);
- HttpRequest* setBody(IDataSourceStream *stream);
+ HttpRequest* setBody(ReadWriteStream *stream);
HttpRequest* setBody(uint8_t *rawData, size_t length);
HttpRequest* setResponseStream(IOutputStream *stream);
@@ -144,7 +144,7 @@ class HttpRequest {
uint8_t *rawData = NULL;
size_t rawDataLength = 0;
- IDataSourceStream *stream = NULL;
+ ReadWriteStream *stream = NULL;
IOutputStream *responseStream = NULL;
diff --git a/Sming/SmingCore/Network/Http/HttpResponse.cpp b/Sming/SmingCore/Network/Http/HttpResponse.cpp
index 7729df71a8..21505838fa 100644
--- a/Sming/SmingCore/Network/Http/HttpResponse.cpp
+++ b/Sming/SmingCore/Network/Http/HttpResponse.cpp
@@ -15,10 +15,8 @@
HttpResponse::~HttpResponse()
{
- if(stream != NULL) {
- delete stream;
- stream = NULL;
- }
+ delete stream;
+ stream = NULL;
}
HttpResponse* HttpResponse::setContentType(const String& type)
@@ -162,7 +160,7 @@ bool HttpResponse::sendJsonObject(JsonObjectStream* newJsonStreamInstance)
return true;
}
-bool HttpResponse::sendDataStream( IDataSourceStream * newDataStream , const String& reqContentType /* = "" */)
+bool HttpResponse::sendDataStream( ReadWriteStream * newDataStream , const String& reqContentType /* = "" */)
{
if (stream != NULL)
{
diff --git a/Sming/SmingCore/Network/Http/HttpResponse.h b/Sming/SmingCore/Network/Http/HttpResponse.h
index c0a57def4f..97a387da96 100644
--- a/Sming/SmingCore/Network/Http/HttpResponse.h
+++ b/Sming/SmingCore/Network/Http/HttpResponse.h
@@ -74,19 +74,19 @@ class HttpResponse {
// @end deprecated
// Send Datastream, can be called with Classes derived from
- bool sendDataStream( IDataSourceStream * newDataStream , enum MimeType type) {
+ bool sendDataStream( ReadWriteStream * newDataStream , enum MimeType type) {
return sendDataStream(newDataStream, ContentType::toString(type));
}
// Send Datastream, can be called with Classes derived from
- bool sendDataStream( IDataSourceStream * newDataStream , const String& reqContentType = "" );
+ bool sendDataStream( ReadWriteStream * newDataStream , const String& reqContentType = "" );
void reset();
public:
int code;
HttpHeaders headers;
- IDataSourceStream* stream = NULL;
+ ReadWriteStream* stream = NULL;
};
#endif /* _SMING_CORE_HTTP_RESPONSE_H_ */
diff --git a/Sming/SmingCore/Network/Http/HttpServerConnection.cpp b/Sming/SmingCore/Network/Http/HttpServerConnection.cpp
index d672da16cd..f9309ffddc 100644
--- a/Sming/SmingCore/Network/Http/HttpServerConnection.cpp
+++ b/Sming/SmingCore/Network/Http/HttpServerConnection.cpp
@@ -16,6 +16,7 @@
#include "TcpServer.h"
#include "../../Services/cWebsocket/websocket.h"
#include "WebConstants.h"
+#include "HttpChunkedStream.h"
bool HttpServerConnection::parserSettingsInitialized = false;
http_parser_settings HttpServerConnection::parserSettings;
@@ -73,7 +74,6 @@ int HttpServerConnection::staticOnMessageBegin(http_parser* parser)
connection->response.stream = NULL;
}
- connection->headersSent = false;
connection->state = eHCS_Ready;
// ... and Request
@@ -347,101 +347,149 @@ err_t HttpServerConnection::onReceive(pbuf *buf)
void HttpServerConnection::onReadyToSendData(TcpConnectionEvent sourceEvent)
{
- if(state != eHCS_Sending) {
- TcpClient::onReadyToSendData(sourceEvent);
+ if(sourceEvent == eTCE_Poll) {
return;
}
- bool sendContent = (request.method != HTTP_HEAD);
+ if(state == eHCS_Sent) {
+ state = eHCS_Ready;
+ }
- if(!headersSent) {
-#ifndef DISABLE_HTTPSRV_ETAG
- if(response.stream != NULL && !response.headers.contains("ETag")) {
- String tag = response.stream->id();
- if(tag.length() > 0) {
- response.headers["ETag"] = String('"' + tag + '"');
- }
+ do {
+
+ if(!(state >= eHCS_StartSending && state < eHCS_Sent)) {
+ break;
+ }
+
+ if(state == eHCS_StartSending) {
+ sendResponseHeaders(&response);
+ state = eHCS_SendingHeaders;
+ break;
}
- if(request.headers.contains("If-Match") && response.headers.contains("ETag") &&
- request.headers["If-Match"] == response.headers["ETag"]) {
- if(request.method == HTTP_GET || request.method == HTTP_HEAD) {
- response.code = HTTP_STATUS_NOT_MODIFIED;
- response.headers["Content-Length"] = "0";
- sendContent = false;
+ if(state == eHCS_SendingHeaders) {
+ if(stream != NULL && !stream->isFinished()) {
+ break;
}
+
+ state = eHCS_StartBody;
}
-#endif /* DISABLE_HTTPSRV_ETAG */
- String statusLine = "HTTP/1.1 "+String(response.code) + " " + getStatus((enum http_status)response.code) + "\r\n";
- writeString(statusLine, TCP_WRITE_FLAG_MORE | TCP_WRITE_FLAG_COPY);
- if(response.stream != NULL && response.stream->length() != -1) {
- response.headers["Content-Length"] = String(response.stream->length());
+ if(sendResponseBody(&response)) {
+ delete stream;
+ stream = NULL;
+ state = eHCS_Sent;
}
- if(!response.headers.contains("Content-Length") && response.stream == NULL) {
- response.headers["Content-Length"] = "0";
+
+ break;
+
+ } while(false);
+
+ if(state == eHCS_Sent && response.headers["Connection"] == "close") {
+ setTimeOut(1); // decrease the timeout to 1 tick
+ }
+
+ if(state == eHCS_Sent) {
+ response.reset();
+ request.reset();
+ }
+
+ TcpClient::onReadyToSendData(sourceEvent);
+}
+
+void HttpServerConnection::sendResponseHeaders(HttpResponse* response)
+{
+#ifndef DISABLE_HTTPSRV_ETAG
+ if(response->stream != NULL && !response->headers.contains("ETag")) {
+ String tag = response->stream->id();
+ if(tag.length() > 0) {
+ response->headers["ETag"] = String('"' + tag + '"');
}
+ }
- if(!response.headers.contains("Connection")) {
- if(request.headers.contains("Connection") && request.headers["Connection"] == "close") {
- // the other side requests closing of the tcp connection...
- response.headers["Connection"] = "close";
- }
- else {
- response.headers["Connection"] = "keep-alive"; // Keep-Alive to reuse the connection
- }
+ if(request.headers.contains("If-Match") && response->headers.contains("ETag") &&
+ request.headers["If-Match"] == response->headers["ETag"]) {
+ if(request.method == HTTP_GET || request.method == HTTP_HEAD) {
+ response->code = HTTP_STATUS_NOT_MODIFIED;
+ response->headers["Content-Length"] = "0";
+ delete response->stream;
+ response->stream = NULL;
+ }
+ }
+#endif /* DISABLE_HTTPSRV_ETAG */
+ String statusLine = "HTTP/1.1 "+String(response->code) + " " + getStatus((enum http_status)response->code) + "\r\n";
+ sendString(statusLine.c_str());
+ if(response->stream != NULL && response->stream->length() != -1) {
+ response->headers["Content-Length"] = String(response->stream->length());
+ }
+ if(!response->headers.contains("Content-Length") && response->stream == NULL) {
+ response->headers["Content-Length"] = "0";
+ }
+
+ if(!response->headers.contains("Connection")) {
+ if(request.headers.contains("Connection") && request.headers["Connection"] == "close") {
+ // the other side requests closing of the tcp connection...
+ response->headers["Connection"] = "close";
}
+ else {
+ response->headers["Connection"] = "keep-alive"; // Keep-Alive to reuse the connection
+ }
+ }
#if HTTP_SERVER_EXPOSE_NAME == 1
- response.headers["Server"] = "HttpServer/Sming";
+ response->headers["Server"] = "HttpServer/Sming";
#endif
#if HTTP_SERVER_EXPOSE_DATE == 1
- response.headers["Date"] = SystemClock.getSystemTimeString();
+ response->headers["Date"] = SystemClock.getSystemTimeString();
#endif
- for (int i = 0; i < response.headers.count(); i++)
- {
- String write = response.headers.keyAt(i) + ": " + response.headers.valueAt(i) + "\r\n";
- writeString(write.c_str(), TCP_WRITE_FLAG_MORE | TCP_WRITE_FLAG_COPY);
- }
- writeString("\r\n", TCP_WRITE_FLAG_MORE | TCP_WRITE_FLAG_COPY);
- headersSent = true;
+ for (int i = 0; i < response->headers.count(); i++)
+ {
+ String write = response->headers.keyAt(i) + ": " + response->headers.valueAt(i) + "\r\n";
+ sendString(write.c_str());
}
+ sendString("\r\n");
+}
- do {
- if(sendContent == false) {
- if(response.stream != NULL) {
- delete response.stream;
- response.stream = NULL;
+bool HttpServerConnection::sendResponseBody(HttpResponse *response)
+{
+ if (state == eHCS_StartBody) {
+ state = eHCS_SendingBody;
+ if(request.method == HTTP_HEAD) {
+ if(response->stream != NULL) {
+ delete response->stream;
+ response->stream = NULL;
}
- state = eHCS_Sent;
- break;
+ return true;
}
- if(response.stream == NULL) {
- state = eHCS_Sent;
- break;
+ if(response->stream == NULL) {
+ return true;
}
- write(response.stream);
- if (response.stream->isFinished()) {
- debugf("Body stream completed");
- delete response.stream; // Free memory now!
- response.stream = NULL;
- state = eHCS_Sent;
+ delete stream;
+ if(response->headers["Transfer-Encoding"] == "chunked") {
+ stream = new HttpChunkedStream(response->stream);
}
- } while(false);
+ else {
+ stream = response->stream; // avoid intermediate buffers
+ }
+ response->stream = NULL;
- if(state == eHCS_Sent && response.headers["Connection"] == "close") {
- setTimeOut(1); // decrease the timeout to 1 tick
+ return false;
}
- if(state == eHCS_Sent) {
- response.reset();
- request.reset();
+ if(stream == NULL) {
+ // we are done for now
+ return true;
}
- TcpClient::onReadyToSendData(sourceEvent);
+ if(response->stream == NULL && !stream->isFinished()) {
+ return false;
+ }
+
+ return true;
+
}
void HttpServerConnection::onError(err_t err) {
@@ -460,7 +508,8 @@ const char * HttpServerConnection::getStatus(enum http_status code)
void HttpServerConnection::send()
{
- state = eHCS_Sending;
+ state = eHCS_StartSending;
+ onReadyToSendData(eTCE_Received);
}
void HttpServerConnection::sendError(const char* message /* = NULL*/, enum http_status code /* = HTTP_STATUS_BAD_REQUEST */)
diff --git a/Sming/SmingCore/Network/Http/HttpServerConnection.h b/Sming/SmingCore/Network/Http/HttpServerConnection.h
index 6a68e415fa..e9f0818de2 100644
--- a/Sming/SmingCore/Network/Http/HttpServerConnection.h
+++ b/Sming/SmingCore/Network/Http/HttpServerConnection.h
@@ -34,13 +34,6 @@ class HttpServerConnection;
typedef Delegate HttpServerConnectionDelegate;
-enum HttpConnectionState
-{
- eHCS_Ready,
- eHCS_Sending,
- eHCS_Sent
-};
-
class HttpServerConnection: public TcpClient
{
public:
@@ -71,6 +64,9 @@ class HttpServerConnection: public TcpClient
static int IRAM_ATTR staticOnBody(http_parser *parser, const char *at, size_t length);
static int IRAM_ATTR staticOnMessageComplete(http_parser* parser);
+ void sendResponseHeaders(HttpResponse* response);
+ bool sendResponseBody(HttpResponse* response);
+
public:
void* userData = NULL; // << use to pass user data between requests
@@ -87,8 +83,6 @@ class HttpServerConnection: public TcpClient
HttpRequest request = HttpRequest(URL());
HttpResponse response;
- bool headersSent = false;
-
HttpResourceDelegate headersCompleteDelegate = 0;
HttpResourceDelegate requestCompletedDelegate = 0;
HttpServerConnectionBodyDelegate onBodyDelegate = 0;
diff --git a/Sming/SmingCore/Network/Http/Stream/HttpChunkedStream.cpp b/Sming/SmingCore/Network/Http/Stream/HttpChunkedStream.cpp
new file mode 100644
index 0000000000..cd29889270
--- /dev/null
+++ b/Sming/SmingCore/Network/Http/Stream/HttpChunkedStream.cpp
@@ -0,0 +1,74 @@
+#include "HttpChunkedStream.h"
+
+HttpChunkedStream::HttpChunkedStream(ReadWriteStream *stream)
+{
+ this->stream = stream;
+}
+
+HttpChunkedStream::~HttpChunkedStream()
+{
+ delete tempStream;
+ delete stream;
+ tempStream = NULL;
+ stream = NULL;
+}
+
+size_t HttpChunkedStream::write(uint8_t charToWrite)
+{
+ return stream->write(charToWrite);
+}
+
+size_t HttpChunkedStream::write(const uint8_t *buffer, size_t size)
+{
+ return stream->write(buffer, size);
+}
+
+uint16_t HttpChunkedStream::readMemoryBlock(char* data, int bufSize)
+{
+ const int readSize = NETWORK_SEND_BUFFER_SIZE;
+
+ if(stream == NULL || stream->isFinished()) {
+ return 0;
+ }
+
+ if(tempStream == NULL) {
+ tempStream = new CircularBuffer(readSize + 10);
+ }
+
+ if(!tempStream->isFinished()) {
+ return tempStream->readMemoryBlock(data, bufSize);
+ }
+
+ // pump new data into the stream
+ int len = readSize;
+ char buffer[len];
+ len = stream->readMemoryBlock(buffer, len);
+ stream->seek(max(len, 0));
+ if(len < 1) {
+ return 0;
+ }
+
+ String content = String(len) + "\r\n";
+ tempStream->write((uint8_t*)content.c_str(), content.length());
+ tempStream->write((uint8_t*)buffer, len);
+ content = "\n\r";
+ tempStream->write((uint8_t*)content.c_str(), content.length());
+ if (len < readSize) {
+ content = "0\r\n\r\n";
+ tempStream->write((uint8_t*)content.c_str(), content.length());
+ }
+
+ return tempStream->readMemoryBlock(data, bufSize);
+}
+
+//Use base class documentation
+bool HttpChunkedStream::seek(int len)
+{
+ return tempStream->seek(len);
+}
+
+//Use base class documentation
+bool HttpChunkedStream::isFinished()
+{
+ return (stream->isFinished() && tempStream->isFinished());
+}
diff --git a/Sming/SmingCore/Network/Http/Stream/HttpChunkedStream.h b/Sming/SmingCore/Network/Http/Stream/HttpChunkedStream.h
new file mode 100644
index 0000000000..0a962df04f
--- /dev/null
+++ b/Sming/SmingCore/Network/Http/Stream/HttpChunkedStream.h
@@ -0,0 +1,69 @@
+/****
+ * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
+ * Created 2015 by Skurydin Alexey
+ * http://github.com/SmingHub/Sming
+ * All files of the Sming Core are provided under the LGPL v3 license.
+ *
+ * @author Slavey Karadzhov
+ *
+ ****/
+
+#ifndef _SMING_CORE_HTTP_CHUNKEDSTREAM_H_
+#define _SMING_CORE_HTTP_CHUNKEDSTREAM_H_
+
+#include "../HttpCommon.h"
+#include "../HttpResponse.h"
+#include "../HttpRequest.h"
+#include "../../../CircularBuffer.h"
+
+/**
+ * @brief HTTP chunked stream class
+ * @ingroup stream http
+ *
+ * @{
+*/
+
+class HttpChunkedStream: public ReadWriteStream
+{
+public:
+ HttpChunkedStream(ReadWriteStream *stream);
+ virtual ~HttpChunkedStream();
+
+ //Use base class documentation
+ virtual StreamType getStreamType() { return stream->getStreamType(); }
+
+ /**
+ * @brief Return the total length of the stream
+ * @retval int -1 is returned when the size cannot be determined
+ */
+ int length() { return stream->length(); }
+
+ /** @brief Write a single char to stream
+ * @param charToWrite Char to write to the stream
+ * @retval size_t Quantity of chars written to stream (always 1)
+ */
+ virtual size_t write(uint8_t charToWrite);
+
+ /** @brief Write chars to stream
+ * @param buffer Pointer to buffer to write to the stream
+ * @param size Quantity of chars to written
+ * @retval size_t Quantity of chars written to stream
+ */
+ virtual size_t write(const uint8_t *buffer, size_t size);
+
+ //Use base class documentation
+ virtual uint16_t readMemoryBlock(char* data, int bufSize);
+
+ //Use base class documentation
+ virtual bool seek(int len);
+
+ //Use base class documentation
+ virtual bool isFinished();
+
+private:
+ ReadWriteStream *stream = NULL;
+ CircularBuffer *tempStream = NULL;
+};
+
+/** @} */
+#endif /* _SMING_CORE_HTTP_CHUNKEDSTREAM_H_ */
diff --git a/Sming/SmingCore/Network/Http/Stream/HttpMultipartStream.cpp b/Sming/SmingCore/Network/Http/Stream/HttpMultipartStream.cpp
new file mode 100644
index 0000000000..c2d8b55678
--- /dev/null
+++ b/Sming/SmingCore/Network/Http/Stream/HttpMultipartStream.cpp
@@ -0,0 +1,109 @@
+/****
+ * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
+ * Created 2015 by Skurydin Alexey
+ * http://github.com/SmingHub/Sming
+ * All files of the Sming Core are provided under the LGPL v3 license.
+ *
+ * @author Slavey Karadzhov
+ *
+ ****/
+
+#include "HttpMultipartStream.h"
+
+HttpMultipartStream::HttpMultipartStream(HttpPartProducerDelegate delegate): producer(delegate)
+{
+
+}
+
+
+HttpMultipartStream::~HttpMultipartStream()
+{
+ delete stream;
+ stream = NULL;
+ delete nextStream;
+ nextStream = NULL;
+}
+
+size_t HttpMultipartStream::write(uint8_t charToWrite)
+{
+ // TODO: those methods should not be used...
+ return 0;
+}
+
+size_t HttpMultipartStream::write(const uint8_t *buffer, size_t size)
+{
+ // TODO: those methods should not be used...
+ return 0;
+}
+ //Use base class documentation
+uint16_t HttpMultipartStream::readMemoryBlock(char* data, int bufSize)
+{
+ if(stream != NULL && stream->isFinished()) {
+ delete stream;
+ stream = NULL;
+ }
+
+ if(stream == NULL && nextStream != NULL) {
+ stream = nextStream;
+ nextStream = NULL;
+ }
+
+ if(stream == NULL) {
+ HttpPartResult result = producer();
+ stream = new MemoryDataStream();
+
+ String line = String("\r\n--") + getBoundary() + String("\r\n");
+ stream->write((uint8_t *)line.c_str(), line.length());
+ if(result.headers != NULL) {
+
+ if(!result.headers->contains("Content-Length") ) {
+ if(result.stream != NULL && result.stream->length() > -1) {
+ (*result.headers)["Content-Length"] = result.stream->length();
+ }
+ }
+
+ for (int i = 0; i < result.headers->count(); i++) {
+ line = result.headers->keyAt(i) + ": " + result.headers->valueAt(i) + "\r\n";
+ stream->write((uint8_t *)line.c_str(), line.length());
+ }
+
+ delete result.headers;
+ result.headers = NULL;
+ }
+ line = "\r\n";
+ stream->write((uint8_t *)line.c_str(), line.length());
+
+ nextStream = result.stream;
+ }
+
+ return stream->readMemoryBlock(data, bufSize);
+}
+
+bool HttpMultipartStream::seek(int len)
+{
+ return stream->seek(len);
+}
+
+bool HttpMultipartStream::isFinished()
+{
+ return false;
+}
+
+const char* HttpMultipartStream::getBoundary()
+{
+ if(boundary[0] == 0) {
+ static const char pool[] =
+ "0123456789"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "abcdefghijklmnopqrstuvwxyz";
+
+ int len = sizeof(boundary);
+ memset(boundary, 0, len);
+ for (int i = 0; i < len - 1; ++i) {
+ boundary[i] = pool[os_random() % (sizeof(pool) - 1)];
+ }
+ boundary[len - 1] = 0;
+ }
+
+ return boundary;
+}
diff --git a/Sming/SmingCore/Network/Http/Stream/HttpMultipartStream.h b/Sming/SmingCore/Network/Http/Stream/HttpMultipartStream.h
new file mode 100644
index 0000000000..28bea02cd3
--- /dev/null
+++ b/Sming/SmingCore/Network/Http/Stream/HttpMultipartStream.h
@@ -0,0 +1,90 @@
+/****
+ * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
+ * Created 2015 by Skurydin Alexey
+ * http://github.com/SmingHub/Sming
+ * All files of the Sming Core are provided under the LGPL v3 license.
+ *
+ * @author Slavey Karadzhov
+ *
+ ****/
+
+#ifndef _SMING_CORE_HTTP_MPARTSTREAM_H_
+#define _SMING_CORE_HTTP_MPARTSTREAM_H_
+
+#include "../HttpCommon.h"
+#include "../HttpResponse.h"
+#include "../HttpRequest.h"
+#include "../../../Delegate.h"
+
+/**
+ * @brief HTTP multipart stream class
+ * @ingroup stream http
+ *
+ * @{
+*/
+
+typedef struct {
+ HttpHeaders* headers = NULL;
+ ReadWriteStream* stream = NULL;
+} HttpPartResult;
+
+typedef Delegate HttpPartProducerDelegate;
+
+class HttpMultipartStream: public ReadWriteStream
+{
+public:
+ HttpMultipartStream(HttpPartProducerDelegate delegate);
+ virtual ~HttpMultipartStream();
+
+ //Use base class documentation
+ virtual StreamType getStreamType() {
+ // TODO: fix this...
+ return stream->getStreamType();
+ }
+
+ /**
+ * @brief Return the total length of the stream
+ * @retval int -1 is returned when the size cannot be determined
+ */
+ int length() { return -1; }
+
+ /** @brief Write a single char to stream
+ * @param charToWrite Char to write to the stream
+ * @retval size_t Quantity of chars written to stream (always 1)
+ */
+ virtual size_t write(uint8_t charToWrite);
+
+ /** @brief Write chars to stream
+ * @param buffer Pointer to buffer to write to the stream
+ * @param size Quantity of chars to written
+ * @retval size_t Quantity of chars written to stream
+ */
+ virtual size_t write(const uint8_t *buffer, size_t size);
+
+ //Use base class documentation
+ virtual uint16_t readMemoryBlock(char* data, int bufSize);
+
+ //Use base class documentation
+ virtual bool seek(int len);
+
+ //Use base class documentation
+ virtual bool isFinished();
+
+ /**
+ * @brief Returns the generated boundary
+ *
+ * @retval const char*
+ */
+ const char* getBoundary();
+
+private:
+ HttpPartProducerDelegate producer;
+
+ ReadWriteStream *stream = NULL;
+ ReadWriteStream *nextStream = NULL;
+
+ char boundary[16] = {0};
+};
+
+/** @} */
+#endif /* _SMING_CORE_HTTP_MPARTSTREAM_H_ */
diff --git a/Sming/SmingCore/Network/TcpClient.h b/Sming/SmingCore/Network/TcpClient.h
index 4f27342ca0..7b67e78ce6 100644
--- a/Sming/SmingCore/Network/TcpClient.h
+++ b/Sming/SmingCore/Network/TcpClient.h
@@ -18,7 +18,7 @@
#include "../Delegate.h"
class TcpClient;
-class MemoryDataStream;
+class ReadWriteStream;
class IPAddress;
//typedef void (*TcpClientEventDelegate)(TcpClient& client, TcpConnectionEvent sourceEvent);
@@ -78,12 +78,15 @@ class TcpClient : public TcpConnection
void pushAsyncPart();
+protected:
+ ReadWriteStream* stream = nullptr;
+
private:
TcpClientState state;
TcpClientCompleteDelegate completed = nullptr;
TcpClientDataDelegate receive = nullptr;
TcpClientEventDelegate ready = nullptr;
- MemoryDataStream* stream = nullptr;
+
bool asyncCloseAfterSent = false;
int16_t asyncTotalSent = 0;
int16_t asyncTotalLen = 0;
diff --git a/Sming/SmingCore/Network/TcpConnection.cpp b/Sming/SmingCore/Network/TcpConnection.cpp
index ee9e2066e4..f29399a53e 100644
--- a/Sming/SmingCore/Network/TcpConnection.cpp
+++ b/Sming/SmingCore/Network/TcpConnection.cpp
@@ -193,6 +193,13 @@ int TcpConnection::write(const char* data, int len, uint8_t apiflags /* = TCP_WR
#ifdef ENABLE_SSL
if(ssl) {
+ u16_t expected = ssl_calculate_write_length(ssl, len);
+ u16_t available = tcp ? tcp_sndbuf(tcp) : 0;
+// debugf("SSL: Expected: %d, Available: %d", expected, available);
+ if (expected < 0 || available < expected) {
+ return -1; // No memory
+ }
+
int written = axl_ssl_write(ssl, (const uint8_t *)data, len);
// debugf("SSL: Write len: %d, Written: %d", len, written);
if(written < ERR_OK) {
@@ -267,7 +274,7 @@ int TcpConnection::write(IDataSourceStream* stream)
int written = write(buffer, available, TCP_WRITE_FLAG_COPY | TCP_WRITE_FLAG_MORE);
total += written;
stream->seek(max(written, 0));
- debugf("Written: %d, Available: %d, isFinished: %d, PushCount: %d", written, available, (stream->isFinished()?1:0), pushCount);
+ debugf("Written: %d, Available: %d, isFinished: %d, PushCount: %d [TcpBuf: %d]", written, available, (stream->isFinished()?1:0), pushCount, tcp_sndbuf(tcp));
repeat = written == available && !stream->isFinished() && pushCount < 25;
}
else
diff --git a/samples/Arducam/app/application.cpp b/samples/Arducam/app/application.cpp
index 53fbfca837..f3eb0d9e55 100644
--- a/samples/Arducam/app/application.cpp
+++ b/samples/Arducam/app/application.cpp
@@ -14,6 +14,7 @@
#include
#include
+#include
// If you want, you can define WiFi settings globally in Eclipse Environment Variables
@@ -36,7 +37,7 @@
* RES (RESET) GPIO16
* DC (DC) GPIO2
*/
-#define CAM_SCLK 14 // HW SPI pins - dont change
+#define CAM_SCLK 14 // HW SPI pins - don't change
#define CAM_MOSI 13
#define CAM_MISO 12
@@ -65,7 +66,7 @@ void startApplicationCommand()
/*
* initCam()
*
- * Initalize I2C, SPI Bus and check if the cammera is there
+ * Initialize I2C, SPI Bus and check if the camera is there
* Initialize the camera for JPEG 320x240
*
*/
@@ -165,7 +166,7 @@ void onCamSetup(HttpRequest &request, HttpResponse &response) {
/*
- * http request to capture and send an image from the cammera
+ * http request to capture and send an image from the camera
* uses actual setting set by ArdCammCommand Handler
*/
void onCapture(HttpRequest &request, HttpResponse &response) {
@@ -187,13 +188,27 @@ void onCapture(HttpRequest &request, HttpResponse &response) {
const char * contentType = arduCamCommand.getContentType();
if (stream->dataReady()) {
- response.setHeader("Content Lenght", String(stream->available()));
+ response.setHeader("Content-Length", String(stream->available()));
response.sendDataStream(stream, contentType);
}
Serial.printf("onCapture() process Stream %d ms\r\n", millis() - startTime);
}
+HttpPartResult snapshotProducer()
+{
+ HttpPartResult result;
+
+ startCapture();
+ ArduCAMStream *camStream = new ArduCAMStream(&myCAM);
+ result.stream = camStream;
+
+ result.headers = new HttpHeaders();
+ (*result.headers)["Content-Type"] = "image/jpeg";
+
+ return result;
+}
+
void onStream(HttpRequest &request, HttpResponse &response) {
Serial.printf("perform onCapture()\r\n");
@@ -203,24 +218,8 @@ void onStream(HttpRequest &request, HttpResponse &response) {
myCAM.clear_fifo_flag();
myCAM.write_reg(ARDUCHIP_FRAMES, 0x00);
- // get the picture
- startTime = millis();
- startCapture();
- Serial.printf("onCapture() startCapture() %d ms\r\n", millis() - startTime);
-
- response.setContentType("Content-Type: multipart/x-mixed-replace; boundary=frame\r\n\r\n");
- response.sendString("HTTP/1.1 200 OK\r\n");
-
-
- while (1) {
- startCapture();
- ArduCAMStream *stream = new ArduCAMStream(&myCAM);
-
- if (stream->dataReady()) {
- response.sendString("--frame\r\n");
- response.sendDataStream(stream, "Content-Type: image/jpeg\r\n\r\n");
- }
- }
+ HttpMultipartStream* stream = new HttpMultipartStream(snapshotProducer);
+ response.sendDataStream(stream, String("multipart/x-mixed-replace; boundary=") + stream->getBoundary());
}
void onFavicon(HttpRequest &request, HttpResponse &response) {
@@ -230,8 +229,8 @@ void onFavicon(HttpRequest &request, HttpResponse &response) {
/*
* start http and telnet server
- * telnet can be used to configure cammera settings
- * unsing ArdCammCommand handler
+ * telnet can be used to configure camera settings
+ * using ArdCammCommand handler
*/
void StartServers()
{
@@ -239,7 +238,7 @@ void StartServers()
server.addPath("/", onIndex);
server.addPath("/cam/set", onCamSetup);
server.addPath("/cam/capture", onCapture);
-// server.addPath("/stream", onStream);
+ server.addPath("/stream", onStream);
server.addPath("/favicon.ico", onFavicon);
server.setDefaultHandler(onFile);
diff --git a/samples/Basic_WebClient/Makefile-user.mk b/samples/Basic_WebClient/Makefile-user.mk
index 3901e89699..079d48ffed 100644
--- a/samples/Basic_WebClient/Makefile-user.mk
+++ b/samples/Basic_WebClient/Makefile-user.mk
@@ -33,7 +33,7 @@ MODULES = app
# SPI_MODE = dio
## SPIFFS options
-DISABLE_SPIFFS = 1
+# DISABLE_SPIFFS = 1
# SPIFF_FILES = files
# We need rBoot in order to be able to run bigger Flash roms.
diff --git a/samples/Basic_WebClient/app/application.cpp b/samples/Basic_WebClient/app/application.cpp
index e501b59fc2..05ec2d5d43 100644
--- a/samples/Basic_WebClient/app/application.cpp
+++ b/samples/Basic_WebClient/app/application.cpp
@@ -19,7 +19,7 @@
#endif
Timer procTimer;
-HttpClient downloadClient;
+HttpClient httpClient;
/* Debug SSL functions */
void displaySessionId(SSL *ssl)
@@ -114,8 +114,8 @@ void connectOk(IPAddress ip, IPAddress mask, IPAddress gateway)
HttpHeaders requestHeaders;
requestHeaders["User-Agent"] = "WebClient/Sming";
- downloadClient.send(
- downloadClient.request("https://www.attachix.com/assets/css/local.css")
+ httpClient.send(
+ httpClient.request("https://www.attachix.com/assets/css/local.css")
->setHeaders(requestHeaders)
->setSslOptions(SSL_SERVER_VERIFY_LATER)
/*
@@ -132,21 +132,39 @@ void connectOk(IPAddress ip, IPAddress mask, IPAddress gateway)
);
- downloadClient.send(
- downloadClient.request("https://www.attachix.com/services/")
+ httpClient.send(
+ httpClient.request("https://www.attachix.com/services/")
->setMethod(HTTP_HEAD)
->setHeaders(requestHeaders)
->onRequestComplete(onDownload)
);
+#ifndef DISABLE_SPIFFS
+ /*
+ * The code below demonstrates how to upload a file efficiently
+ * to a remote server in a secure way.
+ *
+ */
+ FileStream* fileStream = new FileStream("data.txt");
+
+ HttpHeaders fileHeaders;
+ fileHeaders["Content-Type"] = "application/octet-stream";
+
+ httpClient.send(
+ httpClient.request("https://www.attachix.com/uploads/")
+ ->setMethod(HTTP_PUT)
+ ->setHeaders(fileHeaders)
+ ->setBody(fileStream)
+ );
+#endif
- downloadClient.send(
- downloadClient.request("https://www.attachix.com/business/")
+ httpClient.send(
+ httpClient.request("https://www.attachix.com/business/")
->setMethod(HTTP_HEAD)
->onRequestComplete(onDownload)
);
- downloadClient.sendRequest(HTTP_HEAD, "https://www.attachix.com/intl/en/policies/privacy/", requestHeaders, onDownload);
+ httpClient.sendRequest(HTTP_HEAD, "https://www.attachix.com/intl/en/policies/privacy/", requestHeaders, onDownload);
// The code above should make ONE tcp connection, ONE SSL handshake and then all requests should be pipelined to the
// remote server taking care to speed the fetching of a page as fast as possible.
@@ -174,6 +192,11 @@ void init()
Serial.systemDebugOutput(true); // Allow debug print to serial
Serial.println("Ready for SSL tests");
+#ifndef DISABLE_SPIFFS
+ debugf("trying to mount spiffs at 0x%08x, length %d", RBOOT_SPIFFS_0, SPIFF_SIZE);
+ spiffs_mount_manual(RBOOT_SPIFFS_0, SPIFF_SIZE);
+#endif
+
// Setup the WIFI connection
WifiStation.enable(true);
WifiStation.config(WIFI_SSID, WIFI_PWD); // Put you SSID and Password here
From 4fedd39ba1a960f996d6d59589110f787014beae Mon Sep 17 00:00:00 2001
From: slaff
Date: Thu, 12 Oct 2017 10:02:46 +0200
Subject: [PATCH 18/50] Added support for wildcard content-types for the body
parsers. (#1254)
Added dummy body parser that stores all content into memory.
---
.../SmingCore/Network/Http/HttpBodyParser.cpp | 21 ++++++++++++++++++
Sming/SmingCore/Network/Http/HttpBodyParser.h | 11 ++++++++++
Sming/SmingCore/Network/Http/HttpRequest.cpp | 8 ++++---
.../Network/Http/HttpServerConnection.cpp | 22 +++++++++++++++++--
4 files changed, 57 insertions(+), 5 deletions(-)
diff --git a/Sming/SmingCore/Network/Http/HttpBodyParser.cpp b/Sming/SmingCore/Network/Http/HttpBodyParser.cpp
index ee13b77541..93719c737e 100644
--- a/Sming/SmingCore/Network/Http/HttpBodyParser.cpp
+++ b/Sming/SmingCore/Network/Http/HttpBodyParser.cpp
@@ -95,3 +95,24 @@ void formUrlParser(HttpRequest& request, const char *at, int length)
data = data.substring(pos + 1);
}
}
+
+void bodyToStringParser(HttpRequest& request, const char *at, int length)
+{
+ String* data = static_cast(request.args);
+
+ if(length == -1) {
+ delete data;
+ data = new String();
+ request.args = (void *)data;
+ return;
+ }
+
+ if(length == -2) {
+ request.setBody(*data);
+ delete data;
+ request.args = NULL;
+ return;
+ }
+
+ *data += String(at, length);
+}
diff --git a/Sming/SmingCore/Network/Http/HttpBodyParser.h b/Sming/SmingCore/Network/Http/HttpBodyParser.h
index 98ebb881fd..1c72b8da43 100644
--- a/Sming/SmingCore/Network/Http/HttpBodyParser.h
+++ b/Sming/SmingCore/Network/Http/HttpBodyParser.h
@@ -38,6 +38,17 @@ extern "C" {
*/
void formUrlParser(HttpRequest& request, const char *at, int length);
+/**
+ * @brief Stores the complete body into memory.
+ * The content later can be retrieved by calling request.getBody()
+ * @param HttpRequest&
+ * @param const *char
+ * @param int length Negative lengths are used to specify special cases
+ * -1 - start of incoming data
+ * -2 - end of incoming data
+ */
+void bodyToStringParser(HttpRequest& request, const char *at, int length);
+
#ifdef __cplusplus
}
#endif
diff --git a/Sming/SmingCore/Network/Http/HttpRequest.cpp b/Sming/SmingCore/Network/Http/HttpRequest.cpp
index 7dddbc8b93..c11de48432 100644
--- a/Sming/SmingCore/Network/Http/HttpRequest.cpp
+++ b/Sming/SmingCore/Network/Http/HttpRequest.cpp
@@ -50,9 +50,10 @@ HttpRequest& HttpRequest::operator = (const HttpRequest& rhs) {
}
HttpRequest::~HttpRequest() {
- if(queryParams != NULL) {
- delete queryParams;
- }
+ delete queryParams;
+ delete stream;
+ queryParams = NULL;
+ stream = NULL;
}
HttpRequest* HttpRequest::setURL(URL uri) {
@@ -156,6 +157,7 @@ String HttpRequest::getBody()
char buf[1024];
for(int i=0; i< stream->length(); i += 1024) {
int available = memory->readMemoryBlock(buf, 1024);
+ memory->seek(max(available, 0));
ret += String(buf, available);
if(available < 1024) {
break;
diff --git a/Sming/SmingCore/Network/Http/HttpServerConnection.cpp b/Sming/SmingCore/Network/Http/HttpServerConnection.cpp
index f9309ffddc..4dc2c14185 100644
--- a/Sming/SmingCore/Network/Http/HttpServerConnection.cpp
+++ b/Sming/SmingCore/Network/Http/HttpServerConnection.cpp
@@ -199,8 +199,26 @@ int HttpServerConnection::staticOnHeadersComplete(http_parser* parser)
contentType = contentType.substring(0, endPos);
}
- if(connection->bodyParsers->contains(contentType)) {
- connection->bodyParser = (*connection->bodyParsers)[contentType];
+ String majorType = contentType.substring(0, contentType.indexOf('/'));
+ majorType += "/*";
+
+ // Content-Type for exact type: application/json
+ // Wildcard type for application: application/*
+ // Wildcard type for the rest*
+
+ Vector types;
+ types.add(contentType);
+ types.add(majorType);
+ types.add("*");
+
+ for(int i=0; i< types.count(); i++) {
+ if(connection->bodyParsers->contains(types.at(i))) {
+ connection->bodyParser = (*connection->bodyParsers)[types.at(i)];
+ break;
+ }
+ }
+
+ if(connection->bodyParser) {
connection->bodyParser(connection->request, NULL, -1);
}
}
From b4fc3d2cc2040022efdd5b2516371504febf747d Mon Sep 17 00:00:00 2001
From: Piotr Dobrowolski
Date: Sat, 30 Sep 2017 09:54:24 +0200
Subject: [PATCH 19/50] Makefile: add make dependencies support
This allows for automatic rebuilds when header files are changed.
---
Sming/Makefile-project.mk | 14 ++++++++++++--
Sming/Makefile-rboot.mk | 14 ++++++++++++--
2 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/Sming/Makefile-project.mk b/Sming/Makefile-project.mk
index 63b870faf2..b75f059596 100644
--- a/Sming/Makefile-project.mk
+++ b/Sming/Makefile-project.mk
@@ -364,12 +364,20 @@ vpath %.c $(SRC_DIR)
vpath %.cpp $(SRC_DIR)
define compile-objects
-$1/%.o: %.c
+$1/%.o: %.c $1/%.c.d
$(vecho) "CC $$<"
$(Q) $(CC) $(INCDIR) $(MODULE_INCDIR) $(EXTRA_INCDIR) $(SDK_INCDIR) $(CFLAGS) -c $$< -o $$@
-$1/%.o: %.cpp
+$1/%.o: %.cpp $1/%.cpp.d
$(vecho) "C+ $$<"
$(Q) $(CXX) $(INCDIR) $(MODULE_INCDIR) $(EXTRA_INCDIR) $(SDK_INCDIR) $(CXXFLAGS) -c $$< -o $$@
+$1/%.c.d: %.c
+ $(vecho) "DEP $$<"
+ $(Q) $(CC) $(INCDIR) $(MODULE_INCDIR) $(EXTRA_INCDIR) $(SDK_INCDIR) $(CFLAGS) -MM -MT $1/$$*.o $$< -o $$@
+$1/%.cpp.d: %.cpp
+ $(vecho) "DEP $$<"
+ $(Q) $(CXX) $(INCDIR) $(MODULE_INCDIR) $(EXTRA_INCDIR) $(SDK_INCDIR) $(CXXFLAGS) -MM -MT $1/$$*.o $$< -o $$@
+
+.PRECIOUS: $1/%.c.d $1/%.cpp.d
endef
.PHONY: all checkdirs spiff_update spiff_clean clean
@@ -515,3 +523,5 @@ clean:
$(Q) rm -rf $(FW_BASE)
$(foreach bdir,$(BUILD_DIR),$(eval $(call compile-objects,$(bdir))))
+$(foreach bdir,$(BUILD_DIR),$(eval include $(wildcard $(bdir)/*.c.d)))
+$(foreach bdir,$(BUILD_DIR),$(eval include $(wildcard $(bdir)/*.cpp.d)))
diff --git a/Sming/Makefile-rboot.mk b/Sming/Makefile-rboot.mk
index a75b30f0ce..df6b5d3552 100644
--- a/Sming/Makefile-rboot.mk
+++ b/Sming/Makefile-rboot.mk
@@ -429,12 +429,20 @@ vpath %.c $(SRC_DIR)
vpath %.cpp $(SRC_DIR)
define compile-objects
-$1/%.o: %.c
+$1/%.o: %.c $1/%.c.d
$(vecho) "CC $$<"
$(Q) $(CC) $(INCDIR) $(MODULE_INCDIR) $(EXTRA_INCDIR) $(SDK_INCDIR) $(CFLAGS) -c $$< -o $$@
-$1/%.o: %.cpp
+$1/%.o: %.cpp $1/%.cpp.d
$(vecho) "C+ $$<"
$(Q) $(CXX) $(INCDIR) $(MODULE_INCDIR) $(EXTRA_INCDIR) $(SDK_INCDIR) $(CXXFLAGS) -c $$< -o $$@
+$1/%.c.d: %.c
+ $(vecho) "DEP $$<"
+ $(Q) $(CC) $(INCDIR) $(MODULE_INCDIR) $(EXTRA_INCDIR) $(SDK_INCDIR) $(CFLAGS) -MM -MT $1/$$*.o $$< -o $$@
+$1/%.cpp.d: %.cpp
+ $(vecho) "DEP $$<"
+ $(Q) $(CXX) $(INCDIR) $(MODULE_INCDIR) $(EXTRA_INCDIR) $(SDK_INCDIR) $(CXXFLAGS) -MM -MT $1/$$*.o $$< -o $$@
+
+.PRECIOUS: $1/%.c.d $1/%.cpp.d
endef
.PHONY: all checkdirs spiff_update spiff_clean clean
@@ -559,3 +567,5 @@ clean:
$(Q) rm -rf $(FW_BASE)
$(foreach bdir,$(BUILD_DIR),$(eval $(call compile-objects,$(bdir))))
+$(foreach bdir,$(BUILD_DIR),$(eval include $(wildcard $(bdir)/*.c.d)))
+$(foreach bdir,$(BUILD_DIR),$(eval include $(wildcard $(bdir)/*.cpp.d)))
From fd55e14558a0b0c92124fd9d5320eedf8f507b18 Mon Sep 17 00:00:00 2001
From: Slavey Karadzhov
Date: Thu, 12 Oct 2017 13:10:17 +0200
Subject: [PATCH 20/50] Makefile: Added dep support for the compilation of
Sming library.
---
Sming/Makefile | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/Sming/Makefile b/Sming/Makefile
index b5fba81462..9119cfe618 100644
--- a/Sming/Makefile
+++ b/Sming/Makefile
@@ -342,12 +342,18 @@ $1/%.o: %.S
$(vecho) "AS $$<"
$(Q) $(AS) $(INCDIR) $(MODULE_INCDIR) $(EXTRA_INCDIR) $(SDK_INCDIR) $(CFLAGS) -c $$< -o $$@
endif
-$1/%.o: %.c
+$1/%.o: %.c $1/%.c.d
$(vecho) "CC $$<"
$(Q) $(CC) $(INCDIR) $(MODULE_INCDIR) $(EXTRA_INCDIR) $(SDK_INCDIR) $(CFLAGS) -c $$< -o $$@
-$1/%.o: %.cpp
+$1/%.o: %.cpp $1/%.cpp.d
$(vecho) "C+ $$<"
$(Q) $(CXX) $(INCDIR) $(MODULE_INCDIR) $(EXTRA_INCDIR) $(SDK_INCDIR) $(CXXFLAGS) -c $$< -o $$@
+$1/%.c.d: %.c
+ $(Q) $(CC) $(INCDIR) $(MODULE_INCDIR) $(EXTRA_INCDIR) $(SDK_INCDIR) $(CFLAGS) -MM -MT $1/$$*.o $$< -o $$@
+$1/%.cpp.d: %.cpp
+ $(Q) $(CXX) $(INCDIR) $(MODULE_INCDIR) $(EXTRA_INCDIR) $(SDK_INCDIR) $(CXXFLAGS) -MM -MT $1/$$*.o $$< -o $$@
+
+.PRECIOUS: $1/%.c.d $1/%.cpp.d
endef
.PHONY: all checkdirs clean spiffy test samples-clean samples $(SAMPLES_DIRS) docs api wiki
@@ -484,4 +490,6 @@ dist-clean: clean samples-clean third-party-clean
$(Q) $(GIT) checkout $(USER_LIBDIR)
$(foreach bdir,$(BUILD_DIR),$(eval $(call compile-objects,$(bdir))))
+$(foreach bdir,$(BUILD_DIR),$(eval include $(wildcard $(bdir)/*.c.d)))
+$(foreach bdir,$(BUILD_DIR),$(eval include $(wildcard $(bdir)/*.cpp.d)))
From e4eaa3c6d70b9f029c4de6ed0315d5663b843d4e Mon Sep 17 00:00:00 2001
From: slaff
Date: Fri, 13 Oct 2017 16:51:56 +0200
Subject: [PATCH 21/50] Backported that commit
https://github.com/igrr/axtls-8266/commit/24af415e4a5ecdb32b76b5802f52b71367953b75
back here. (#1255)
---
Sming/third-party/.patches/axtls-8266.patch | 43 +++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/Sming/third-party/.patches/axtls-8266.patch b/Sming/third-party/.patches/axtls-8266.patch
index 45a0e3c35b..128b5612af 100644
--- a/Sming/third-party/.patches/axtls-8266.patch
+++ b/Sming/third-party/.patches/axtls-8266.patch
@@ -503,3 +503,46 @@ index 4972119..f6f44f8 100644
{
if (tp)
{
+diff --git a/crypto/rsa.c b/crypto/rsa.c
+index ab74b4d..5651a69 100644
+--- a/crypto/rsa.c
++++ b/crypto/rsa.c
+@@ -73,6 +73,7 @@ void RSA_priv_key_new(RSA_CTX **ctx,
+ bi_set_mod(bi_ctx, rsa_ctx->p, BIGINT_P_OFFSET);
+ bi_set_mod(bi_ctx, rsa_ctx->q, BIGINT_Q_OFFSET);
+ #endif
++ bi_clear_cache(bi_ctx);
+ }
+
+ void RSA_pub_key_new(RSA_CTX **ctx,
+@@ -94,6 +95,7 @@ void RSA_pub_key_new(RSA_CTX **ctx,
+ bi_set_mod(bi_ctx, rsa_ctx->m, BIGINT_M_OFFSET);
+ rsa_ctx->e = bi_import(bi_ctx, pub_exp, pub_len);
+ bi_permanent(rsa_ctx->e);
++ bi_clear_cache(bi_ctx);
+ }
+
+ /**
+diff --git a/ssl/x509.c b/ssl/x509.c
+index 35bd728..f76fa5e 100644
+--- a/ssl/x509.c
++++ b/ssl/x509.c
+@@ -247,6 +247,9 @@ int x509_new(const uint8_t *cert, int *len, X509_CTX **ctx)
+ if (asn1_skip_obj(cert, &offset, ASN1_SEQUENCE) ||
+ asn1_signature(cert, &offset, x509_ctx))
+ goto end_cert;
++
++ /* Saves a few bytes of memory */
++ bi_clear_cache(bi_ctx);
+ #endif
+ ret = X509_OK;
+ end_cert:
+@@ -485,6 +488,8 @@ int x509_verify(const CA_CERT_CTX *ca_cert_ctx, const X509_CTX *cert)
+ ret = X509_VFY_ERROR_BAD_SIGNATURE;
+ }
+
++ bi_clear_cache(ctx);
++
+ if (ret)
+ goto end_verify;
+
From ea1bd326d2a59b638c90ac01e6f73ce1d7896a26 Mon Sep 17 00:00:00 2001
From: slaff
Date: Fri, 13 Oct 2017 16:52:22 +0200
Subject: [PATCH 22/50] The demonstration with the file upload will crash if no
file is found in the SPIFFS file system. (#1258)
---
samples/Basic_WebClient/files/data.txt | 110 +++++++++++++++++++++++++
1 file changed, 110 insertions(+)
create mode 100644 samples/Basic_WebClient/files/data.txt
diff --git a/samples/Basic_WebClient/files/data.txt b/samples/Basic_WebClient/files/data.txt
new file mode 100644
index 0000000000..aefaad859c
--- /dev/null
+++ b/samples/Basic_WebClient/files/data.txt
@@ -0,0 +1,110 @@
+MIUSOV, as a man of breeding and delicacy, could not but feel some inward qualms, when he reached the Father Superior's with Ivan: he felt ashamed of having lost his temper. He felt that he ought to have disdained that despicable wretch, Fyodor Pavlovitch, too much to have been upset by him in Father Zossima's cell, and so to have forgotten himself. "The monks were not to blame, in any case," he reflected, on the steps. "And if they're decent people here (and the Father Superior, I understand, is a nobleman) why not be friendly and courteous with them? I won't argue, I'll fall in with everything, I'll win them by politeness, and... and... show them that I've nothing to do with that Aesop, that buffoon, that Pierrot, and have merely been taken in over this affair, just as they have."
+He determined to drop his litigation with the monastery, and relinquish his claims to the wood-cutting and fishery rights at once. He was the more ready to do this because the rights had become much less valuable, and he had indeed the vaguest idea where the wood and river in question were.
+
+These excellent intentions were strengthened when he entered the Father Superior's dining-room, though, strictly speaking, it was not a dining-room, for the Father Superior had only two rooms altogether; they were, however, much larger and more comfortable than Father Zossima's. But there was no great luxury about the furnishing of these rooms either. The furniture was of mahogany, covered with leather, in the old-fashioned style of 1820 the floor was not even stained, but everything was shining with cleanliness, and there were many choice flowers in the windows; the most sumptuous thing in the room at the moment was, of course, the beautifully decorated table. The cloth was clean, the service shone; there were three kinds of well-baked bread, two bottles of wine, two of excellent mead, and a large glass jug of kvas- both the latter made in the monastery, and famous in the neighbourhood. There was no vodka. Rakitin related afterwards that there were five dishes: fish-soup made of sterlets, served with little fish patties; then boiled fish served in a special way; then salmon cutlets, ice pudding and compote, and finally, blanc-mange. Rakitin found out about all these good things, for he could not resist peeping into the kitchen, where he already had a footing. He had a footing everywhere, and got information about everything. He was of an uneasy and envious temper. He was well aware of his own considerable abilities, and nervously exaggerated them in his self-conceit. He knew he would play a prominent part of some sort, but Alyosha, who was attached to him, was distressed to see that his friend Rakitin was dishonourable, and quite unconscious of being so himself, considering, on the contrary, that because he would not steal money left on the table he was a man of the highest integrity. Neither Alyosha nor anyone else could have influenced him in that.
+
+Rakitin, of course, was a person of too little consequence to be invited to the dinner, to which Father Iosif, Father Paissy, and one other monk were the only inmates of the monastery invited. They were already waiting when Miusov, Kalganov, and Ivan arrived. The other guest, Maximov, stood a little aside, waiting also. The Father Superior stepped into the middle of the room to receive his guests. He was a tall, thin, but still vigorous old man, with black hair streaked with grey, and a long, grave, ascetic face. He bowed to his guests in silence. But this time they approached to receive his blessing. Miusov even tried to kiss his hand, but the Father Superior drew it back in time to avoid the salute. But Ivan and Kalganov went through the ceremony in the most simple-hearted and complete manner, kissing his hand as peasants do.
+
+"We must apologise most humbly, your reverence," began Miusov, simpering affably, and speaking in a dignified and respectful tone. "Pardon us for having come alone without the gentleman you invited, Fyodor Pavlovitch. He felt obliged to decline the honour of your hospitality, and not without reason. In the reverend Father Zossima's cell he was carried away by the unhappy dissension with his son, and let fall words which were quite out of keeping... in fact, quite unseemly... as"- he glanced at the monks- "your reverence is, no doubt, already aware. And therefore, recognising that he had been to blame, he felt sincere regret and shame, and begged me, and his son Ivan Fyodorovitch, to convey to you his apologies and regrets. In brief, he hopes and desires to make amends later. He asks your blessing, and begs you to forget what has taken place."
+
+As he uttered the last word of his tirade, Miusov completely recovered his self-complacency, and all traces of his former irritation disappeared. He fully and sincerely loved humanity again.
+
+The Father Superior listened to him with dignity, and, with a slight bend of the head, replied:
+
+"I sincerely deplore his absence. Perhaps at our table he might have learnt to like us, and we him. Pray be seated, gentlemen."
+
+He stood before the holy image, and began to say grace, aloud. All bent their heads reverently, and Maximov clasped his hands before him, with peculiar fervour.
+
+It was at this moment that Fyodor Pavlovitch played his last prank. It must be noted that he really had meant to go home, and really had felt the impossibility of going to dine with the Father Superior as though nothing had happened, after his disgraceful behaviour in the elder's cell. Not that he was so very much ashamed of himself- quite the contrary perhaps. But still he felt it would be unseemly to go to dinner. Yet his creaking carriage had hardly been brought to the steps of the hotel, and he had hardly got into it, when he suddenly stopped short. He remembered his own words at the elder's: "I always feel when I meet people that I am lower than all, and that they all take me for a buffoon; so I say let me play the buffoon, for you are, every one of you, stupider and lower than I." He longed to revenge himself on everyone for his own unseemliness. He suddenly recalled how he had once in the past been asked, "Why do you hate so and so, so much?" And he had answered them, with his shameless impudence, "I'll tell you. He has done me no harm. But I played him a dirty trick, and ever since I have hated him."
+
+Remembering that now, he smiled quietly and malignantly, hesitating for a moment. His eyes gleamed, and his lips positively quivered.
+
+"Well, since I have begun, I may as well go on," he decided. His predominant sensation at that moment might be expressed in the following words, "Well, there is no rehabilitating myself now. So let me shame them for all I am worth. I will show them I don't care what they think- that's all!"
+
+He told the coachman to wait, while with rapid steps he returned to the monastery and straight to the Father Superior's. He had no clear idea what he would do, but he knew that he could not control himself, and that a touch might drive him to the utmost limits of obscenity, but only to obscenity, to nothing criminal, nothing for which he could be legally punished. In the last resort, he could always restrain himself, and had marvelled indeed at himself, on that score, sometimes. He appeared in the Father Superior's dining-room, at the moment when the prayer was over, and all were moving to the table. Standing in the doorway, he scanned the company, and laughing his prolonged, impudent, malicious chuckle, looked them all boldly in the face. "They thought I had gone, and here I am again," he cried to the whole room.
+
+For one moment everyone stared at him without a word; and at once everyone felt that something revolting, grotesque, positively scandalous, was about to happen. Miusov passed immediately from the most benevolent frame of mind to the most savage. All the feelings that had subsided and died down in his heart revived instantly.
+
+"No! this I cannot endure!" he cried. "I absolutely cannot! and... I certainly cannot!"
+
+The blood rushed to his head. He positively stammered; but he was beyond thinking of style, and he seized his hat.
+
+"What is it he cannot?" cried Fyodor Pavlovitch, "that he absolutely cannot and certainly cannot? Your reverence, am I to come in or not? Will you receive me as your guest?"
+
+"You are welcome with all my heart," answered the Superior. "Gentlemen!" he added, "I venture to beg you most earnestly to lay aside your dissensions, and to be united in love and family harmony- with prayer to the Lord at our humble table."
+
+"No, no, it is impossible!" cried Miusov, beside himself.
+
+"Well, if it is impossible for Pyotr Alexandrovitch, it is impossible for me, and I won't stop. That is why I came. I will keep with Pyotr Alexandrovitch everywhere now. If you will go away, Pyotr Alexandrovitch, I will go away too, if you remain, I will remain. You stung him by what you said about family harmony, Father Superior, he does not admit he is my relation. That's right, isn't it, von Sohn? Here's von Sohn. How are you, von Sohn?"
+
+"Do you mean me?" muttered Maximov, puzzled.
+
+"Of course I mean you," cried Fyodor Pavlovitch. "Who else? The Father Superior could not be von Sohn."
+
+"But I am not von Sohn either. I am Maximov."
+
+"No, you are von Sohn. Your reverence, do you know who von Sohn was? It was a famous murder case. He was killed in a house of harlotry- I believe that is what such places are called among you- he was killed and robbed, and in spite of his venerable age, he was nailed up in a box and sent from Petersburg to Moscow in the luggage van, and while they were nailing him up, the harlots sang songs and played the harp, that is to say, the piano. So this is that very von Solin. He has risen from the dead, hasn't he, von Sohn?"
+
+"What is happening? What's this?" voices were heard in the group of monks.
+
+"Let us go," cried Miusov, addressing Kalganov.
+
+"No, excuse me," Fyodor Pavlovitch broke in shrilly, taking another step into the room. "Allow me to finish. There in the cell you blamed me for behaving disrespectfully just because I spoke of eating gudgeon, Pyotr Alexandrovitch. Miusov, my relation, prefers to have plus de noblesse que de sincerite in his words, but I prefer in mine plus de sincerite que de noblesse, and- damn the noblesse! That's right, isn't it, von Sohn? Allow me, Father Superior, though I am a buffoon and play the buffoon, yet I am the soul of honour, and I want to speak my mind. Yes, I am the soul of honour, while in Pyotr Alexandrovitch there is wounded vanity and nothing else. I came here perhaps to have a look and speak my mind. My son, Alexey, is here, being saved. I am his father; I care for his welfare, and it is my duty to care. While I've been playing the fool, I have been listening and having a look on the sly; and now I want to give you the last act of the performance. You know how things are with us? As a thing falls, so it lies. As a thing once has fallen, so it must lie for ever. Not a bit of it! I want to get up again. Holy Father, I am indignant with you. Confession is a great sacrament, before which I am ready to bow down reverently; but there in the cell, they all kneel down and confess aloud. Can it be right to confess aloud? It was ordained by the holy Fathers to confess in secret: then only your confession will be a mystery, and so it was of old. But how can I explain to him before everyone that I did this and that... well, you understand what- sometimes it would not be proper to talk about it- so it is really a scandal! No, Fathers, one might be carried along with you to the Flagellants, I dare say.... at the first opportunity I shall write to the Synod, and I shall take my son, Alexey, home."
+
+We must note here that Fyodor Pavlovitch knew where to look for the weak spot. There had been at one time malicious rumours which had even reached the Archbishop (not only regarding our monastery, but in others where the institution of elders existed) that too much respect was paid to the elders, even to the detriment of the authority of the Superior, that the elders abused the sacrament of confession and so on and so on- absurd charges which had died away of themselves everywhere. But the spirit of folly, which had caught up Fyodor Pavlovitch and was bearing him on the current of his own nerves into lower and lower depths of ignominy, prompted him with this old slander. Fyodor Pavlovitch did not understand a word of it, and he could not even put it sensibly, for on this occasion no one had been kneeling and confessing aloud in the elder's cell, so that he could not have seen anything of the kind. He was only speaking from confused memory of old slanders. But as soon as he had uttered his foolish tirade, he felt he had been talking absurd nonsense, and at once longed to prove to his audience, and above all to himself, that he had not been talking nonsense. And, though he knew perfectly well that with each word he would be adding more and more absurdity, he could not restrain himself, and plunged forward blindly.
+
+"How disgraceful!" cried Pyotr Alexandrovitch.
+
+"Pardon me!" said the Father Superior. "It was said of old, 'Many have begun to speak against me and have uttered evil sayings about me. And hearing it I have said to myself: it is the correction of the Lord and He has sent it to heal my vain soul.' And so we humbly thank you, honoured guest!" and he made Fyodor Pavlovitch a low bow.
+
+"Tut- tut- tut- sanctimoniousness and stock phrases! Old phrases and old gestures. The old lies and formal prostrations. We know all about them. A kiss on the lips and a dagger in the heart, as in Schiller's Robbers. I don't like falsehood, Fathers, I want the truth. But the truth is not to be found in eating gudgeon and that I proclaim aloud! Father monks, why do you fast? Why do you expect reward in heaven for that? Why, for reward like that I will come and fast too! No, saintly monk, you try being virtuous in the world, do good to society, without shutting yourself up in a monastery at other people's expense, and without expecting a reward up aloft for it- you'll find that a bit harder. I can talk sense, too, Father Superior. What have they got here?" He went up to the table. "Old port wine, mead brewed by the Eliseyev Brothers. Fie, fie, fathers! That is something beyond gudgeon. Look at the bottles the fathers have brought out, he he he! And who has provided it all? The Russian peasant, the labourer, brings here the farthing earned by his horny hand, wringing it from his family and the tax-gatherer! You bleed the people, you know, holy Fathers."
+
+"This is too disgraceful!" said Father Iosif.
+
+Father Paissy kept obstinately silent. Miusov rushed from the room, and Kalgonov after him.
+
+"Well, Father, I will follow Pyotr Alexandrovitch! I am not coming to see you again. You may beg me on your knees, I shan't come. I sent you a thousand roubles, so you have begun to keep your eye on me. He he he! No, I'll say no more. I am taking my revenge for my youth, for all the humiliation I endured." He thumped the table with his fist in a paroxysm of simulated feeling. "This monastery has played a great part in my life! It has cost me many bitter tears. You used to set my wife, the crazy one, against me. You cursed me with bell and book, you spread stories about me all over the place. Enough, fathers! This is the age of Liberalism, the age of steamers and railways. Neither a thousand, nor a hundred roubles, no, nor a hundred farthings will you get out of me!"
+
+It must be noted again that our monastery never had played any great part in his life, and he never had shed a bitter tear owing to it. But he was so carried away by his simulated emotion, that he was for one moment almost believing it himself. He was so touched he was almost weeping. But at that very instant, he felt that it was time to draw back.
+
+The Father Superior bowed his head at his malicious lie, and again spoke impressively:
+
+"It is written again, 'Bear circumspectly and gladly dishonour that cometh upon thee by no act of thine own, be not confounded and hate not him who hath dishonoured thee.' And so will we."
+
+"Tut, tut, tut! Bethinking thyself and the rest of the rigmarole. Bethink yourselves Fathers, I will go. But I will take my son, Alexey, away from here for ever, on my parental authority. Ivan Fyodorovitch, my most dutiful son, permit me to order you to follow me. Von Sohn, what have you to stay for? Come and see me now in the town. It is fun there. It is only one short verst; instead of lenten oil, I will give you sucking-pig and kasha. We will have dinner with some brandy and liqueur to it.... I've cloudberry wine. Hey, von Sohn, don't lose your chance." He went out, shouting and gesticulating.
+
+It was at that moment Rakitin saw him and pointed him out to Alyosha.
+
+"Alexey!" his father shouted, from far off, catching sight of him. "You come home to me to-day, for good, and bring your pillow and mattress, and leave no trace behind."
+
+Alyosha stood rooted to the spot, watching the scene in silence. Meanwhile, Fyodor Pavlovitch had got into the carriage, and Ivan was about to follow him in grim silence without even turning to say good-bye to Alyosha. But at this point another almost incredible scene of grotesque buffoonery gave the finishing touch to the episode. Maximov suddenly appeared by the side of the carriage. He ran up, panting, afraid of being too late. Rakitin and Alyosha saw him running. He was in such a hurry that in his impatience he put his foot on the step on which Ivan's left foot was still resting, and clutching the carriage he kept trying to jump in. "I am going with you! " he kept shouting, laughing a thin mirthful laugh with a look of reckless glee in his face. "Take me, too."
+
+"There!" cried Fyodor Pavlovitch, delighted. "Did I not say he was von Sohn. It is von Sohn himself, risen from the dead. Why, how did you tear yourself away? What did you von Sohn there? And how could you get away from the dinner? You must be a brazen-faced fellow! I am that myself, but I am surprised at you, brother! Jump in, jump in! Let him pass, Ivan. It will be fun. He can lie somewhere at our feet. Will you lie at our feet, von Sohn? Or perch on the box with the coachman. Skip on to the box, von Sohn!"
+
+But Ivan, who had by now taken his seat, without a word gave Maximov a violent punch in the breast and sent him flying. It was quite by chance he did not fall.
+
+"Drive on!" Ivan shouted angrily to the coachman.
+
+"Why, what are you doing, what are you about? Why did you do that?" Fyodor Pavlovitch protested.
+
+But the carriage had already driven away. Ivan made no reply.
+
+"Well, you are a fellow," Fyodor Pavlovitch said again.
+
+After a pause of two minutes, looking askance at his son, "Why, it was you got up all this monastery business. You urged it, you approved of it. Why are you angry now?"
+
+"You've talked rot enough. You might rest a bit now," Ivan snapped sullenly.
+
+Fyodor Pavlovitch was silent again for two minutes.
+
+"A drop of brandy would be nice now," he observed sententiously, but Ivan made no response.
+
+"You shall have some, too, when we get home."
+
+Ivan was still silent.
+
+Fyodor Pavlovitch waited another two minutes.
+
+"But I shall take Alyosha away from the monastery, though you will dislike it so much, most honoured Karl von Moor."
+
+Ivan shrugged his shoulders contemptuously, and turning away stared at the road. And they did not speak again all the way home.
From c224962ff390aa2d2fbae8814943b8c09eaa43f6 Mon Sep 17 00:00:00 2001
From: slaff
Date: Sat, 14 Oct 2017 10:35:03 +0200
Subject: [PATCH 23/50] Arduino compatibility improvements. (#1213)
* Updated the Adafruit SSD1306 library.
Added better Arduino compatibility.
* Re-added SH1106 support.
* Fix for wrong GPIO reg type (issue #397)
* Started fetching some Arduino libraries via git submodules.
Updated Adafruit_ST7735 library to its latest version.
Updated Adafruit_SSD1306 library to its latest version.
* Re-applied support for SH1106_128_64 - 1.3" OLED display version.
---
.gitmodules | 8 +
.../Libraries/.patches/Adafruit_SSD1306.patch | 96 +++
Sming/Libraries/.patches/Readme.md | 1 +
.../Adafruit_PCD8544/Adafruit_PCD8544.h | 4 +-
Sming/Libraries/Adafruit_SSD1306 | 1 +
.../Adafruit_SSD1306/Adafruit_SSD1306.cpp | 796 ------------------
.../Adafruit_SSD1306/Adafruit_SSD1306.h | 180 ----
Sming/Libraries/Adafruit_SSD1306/README.txt | 24 -
.../ssd1306_128x32_i2c/ssd1306_128x32_i2c.ino | 357 --------
.../ssd1306_128x32_spi/ssd1306_128x32_spi.ino | 368 --------
.../ssd1306_128x64_i2c/ssd1306_128x64_i2c.ino | 356 --------
.../ssd1306_128x64_spi/ssd1306_128x64_spi.ino | 368 --------
Sming/Libraries/Adafruit_SSD1306/license.txt | 26 -
Sming/Libraries/Adafruit_ST7735 | 1 +
.../Adafruit_ST7735/Adafruit_ST7735.cpp | 742 ----------------
.../Adafruit_ST7735/Adafruit_ST7735.h | 187 ----
Sming/Libraries/Adafruit_ST7735/README.txt | 26 -
.../examples/graphicstest/graphicstest.ino | 300 -------
.../examples/rotationtest/rotationtest.ino | 285 -------
.../examples/shieldtest/shieldtest.ino | 256 ------
.../soft_spitftbitmap/soft_spitftbitmap.ino | 219 -----
.../examples/spitftbitmap/spitftbitmap.ino | 215 -----
.../Adafruit_ST7735/library.properties | 9 -
.../CapacitiveSensor/CapacitiveSensor.h | 2 +-
Sming/Libraries/TFT_ILI9163C/TFT_ILI9163C.h | 4 +-
Sming/Makefile | 24 +-
Sming/Makefile-project.mk | 5 +-
Sming/Makefile-rboot.mk | 5 +-
Sming/SmingCore/ArduinoCompat.cpp | 21 +
Sming/SmingCore/ArduinoCompat.h | 29 +
Sming/SmingCore/pgmspace.h | 2 +
Sming/SmingCore/pins_arduino.h | 23 +-
Sming/Wiring/Arduino.h | 1 +
33 files changed, 202 insertions(+), 4739 deletions(-)
create mode 100644 Sming/Libraries/.patches/Adafruit_SSD1306.patch
create mode 100644 Sming/Libraries/.patches/Readme.md
create mode 160000 Sming/Libraries/Adafruit_SSD1306
delete mode 100644 Sming/Libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp
delete mode 100644 Sming/Libraries/Adafruit_SSD1306/Adafruit_SSD1306.h
delete mode 100644 Sming/Libraries/Adafruit_SSD1306/README.txt
delete mode 100644 Sming/Libraries/Adafruit_SSD1306/examples/ssd1306_128x32_i2c/ssd1306_128x32_i2c.ino
delete mode 100644 Sming/Libraries/Adafruit_SSD1306/examples/ssd1306_128x32_spi/ssd1306_128x32_spi.ino
delete mode 100644 Sming/Libraries/Adafruit_SSD1306/examples/ssd1306_128x64_i2c/ssd1306_128x64_i2c.ino
delete mode 100644 Sming/Libraries/Adafruit_SSD1306/examples/ssd1306_128x64_spi/ssd1306_128x64_spi.ino
delete mode 100644 Sming/Libraries/Adafruit_SSD1306/license.txt
create mode 160000 Sming/Libraries/Adafruit_ST7735
delete mode 100644 Sming/Libraries/Adafruit_ST7735/Adafruit_ST7735.cpp
delete mode 100644 Sming/Libraries/Adafruit_ST7735/Adafruit_ST7735.h
delete mode 100644 Sming/Libraries/Adafruit_ST7735/README.txt
delete mode 100644 Sming/Libraries/Adafruit_ST7735/examples/graphicstest/graphicstest.ino
delete mode 100644 Sming/Libraries/Adafruit_ST7735/examples/rotationtest/rotationtest.ino
delete mode 100644 Sming/Libraries/Adafruit_ST7735/examples/shieldtest/shieldtest.ino
delete mode 100644 Sming/Libraries/Adafruit_ST7735/examples/soft_spitftbitmap/soft_spitftbitmap.ino
delete mode 100644 Sming/Libraries/Adafruit_ST7735/examples/spitftbitmap/spitftbitmap.ino
delete mode 100644 Sming/Libraries/Adafruit_ST7735/library.properties
create mode 100644 Sming/SmingCore/ArduinoCompat.cpp
create mode 100644 Sming/SmingCore/ArduinoCompat.h
create mode 100644 Sming/SmingCore/pgmspace.h
diff --git a/.gitmodules b/.gitmodules
index f5a9300542..054baa12d4 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -37,3 +37,11 @@
path = Sming/third-party/ws_parser
url = https://github.com/charliesome/ws_parser.git
ignore = dirty
+[submodule "Sming/Libraries/Adafruit_ST7735"]
+ path = Sming/Libraries/Adafruit_ST7735
+ url = https://github.com/adafruit/Adafruit-ST7735-Library.git
+ ignore = dirty
+[submodule "Sming/Libraries/Adafruit_SSD1306"]
+ path = Sming/Libraries/Adafruit_SSD1306
+ url = https://github.com/adafruit/Adafruit_SSD1306.git
+ ignore = dirty
diff --git a/Sming/Libraries/.patches/Adafruit_SSD1306.patch b/Sming/Libraries/.patches/Adafruit_SSD1306.patch
new file mode 100644
index 0000000000..c0baf653c3
--- /dev/null
+++ b/Sming/Libraries/.patches/Adafruit_SSD1306.patch
@@ -0,0 +1,96 @@
+diff --git a/Adafruit_SSD1306.cpp b/Adafruit_SSD1306.cpp
+index 570a335..40f4784 100644
+--- a/Adafruit_SSD1306.cpp
++++ b/Adafruit_SSD1306.cpp
+@@ -252,7 +252,7 @@ void Adafruit_SSD1306::begin(uint8_t vccstate, uint8_t i2caddr, bool reset) {
+ ssd1306_command(SSD1306_SETCONTRAST); // 0x81
+ ssd1306_command(0x8F);
+
+-#elif defined SSD1306_128_64
++#elif defined SSD1306_128_64 || defined SH1106_128_64
+ ssd1306_command(SSD1306_SETCOMPINS); // 0xDA
+ ssd1306_command(0x12);
+ ssd1306_command(SSD1306_SETCONTRAST); // 0x81
+@@ -417,6 +417,28 @@ void Adafruit_SSD1306::dim(boolean dim) {
+ }
+
+ void Adafruit_SSD1306::display(void) {
++#if defined SH1106_128_64
++ for (int index = 0; index < 8; index++) {
++ ssd1306_command(SH1106_SETSTARTPAGE + index);
++ /* for some reason display is shifted by 2 columns
++ * on 1.3" displays from ebay
++ */
++ ssd1306_command(SSD1306_SETLOWCOLUMN + 2); // low column start address
++ ssd1306_command(SSD1306_SETHIGHCOLUMN); // high column start address
++
++ for (int pixel = 0; pixel < SSD1306_LCDWIDTH; pixel++) {
++ Wire.beginTransmission(_i2caddr);
++ WIRE_WRITE(0x40);
++ // input buffer doesn't accept all bytes at once
++ for (uint8_t x=0; x<16; x++) {
++ WIRE_WRITE(buffer[index * SSD1306_LCDWIDTH + pixel]);
++ ++pixel;
++ }
++ --pixel;
++ Wire.endTransmission();
++ }
++ }
++#else
+ ssd1306_command(SSD1306_COLUMNADDR);
+ ssd1306_command(0); // Column start address (0 = reset)
+ ssd1306_command(SSD1306_LCDWIDTH-1); // Column end address (127 = reset)
+@@ -482,6 +504,7 @@ void Adafruit_SSD1306::display(void) {
+ TWBR = twbrbackup;
+ #endif
+ }
++#endif /* defined SH1106_128_64 */
+ }
+
+ // clear everything
+diff --git a/Adafruit_SSD1306.h b/Adafruit_SSD1306.h
+index 1162f87..4226f3e 100644
+--- a/Adafruit_SSD1306.h
++++ b/Adafruit_SSD1306.h
+@@ -69,20 +69,28 @@ All text above, and the splash screen must be included in any redistribution
+
+ SSD1306_96_16
+
++ SH1106_128_64 - 1.3" OLED display version
++
+ -----------------------------------------------------------------------*/
+-// #define SSD1306_128_64
+- #define SSD1306_128_32
++// #define SH1106_128_64
++ #define SSD1306_128_64
++// #define SSD1306_128_32
+ // #define SSD1306_96_16
+ /*=========================================================================*/
+
++#if defined SSD1306_128_64 && defined SH1106_128_64
++ #error "Select either SH1106 or SSD1306 display type in SSD1306.h"
++#endif
++
++
+ #if defined SSD1306_128_64 && defined SSD1306_128_32
+ #error "Only one SSD1306 display can be specified at once in SSD1306.h"
+ #endif
+-#if !defined SSD1306_128_64 && !defined SSD1306_128_32 && !defined SSD1306_96_16
++#if !defined SSD1306_128_64 && !defined SSD1306_128_32 && !defined SSD1306_96_16 && !defined SH1106_128_64
+ #error "At least one SSD1306 display must be specified in SSD1306.h"
+ #endif
+
+-#if defined SSD1306_128_64
++#if defined SSD1306_128_64 || defined SH1106_128_64
+ #define SSD1306_LCDWIDTH 128
+ #define SSD1306_LCDHEIGHT 64
+ #endif
+@@ -132,6 +140,8 @@ All text above, and the splash screen must be included in any redistribution
+ #define SSD1306_EXTERNALVCC 0x1
+ #define SSD1306_SWITCHCAPVCC 0x2
+
++#define SH1106_SETSTARTPAGE 0xB0
++
+ // Scrolling #defines
+ #define SSD1306_ACTIVATE_SCROLL 0x2F
+ #define SSD1306_DEACTIVATE_SCROLL 0x2E
diff --git a/Sming/Libraries/.patches/Readme.md b/Sming/Libraries/.patches/Readme.md
new file mode 100644
index 0000000000..555d2f6422
--- /dev/null
+++ b/Sming/Libraries/.patches/Readme.md
@@ -0,0 +1 @@
+This directory contains patches to upstream Arudino libraries.
diff --git a/Sming/Libraries/Adafruit_PCD8544/Adafruit_PCD8544.h b/Sming/Libraries/Adafruit_PCD8544/Adafruit_PCD8544.h
index 1199b0fa87..d573fde4e1 100644
--- a/Sming/Libraries/Adafruit_PCD8544/Adafruit_PCD8544.h
+++ b/Sming/Libraries/Adafruit_PCD8544/Adafruit_PCD8544.h
@@ -32,8 +32,8 @@ All text above, and the splash screen must be included in any redistribution
typedef volatile RwReg PortReg;
typedef uint32_t PortMask;
#else
- typedef volatile uint8_t PortReg;
- typedef uint8_t PortMask;
+ typedef volatile GPIO_REG_TYPE PortReg;
+ typedef GPIO_REG_TYPE PortMask;
#endif
#define BLACK 1
diff --git a/Sming/Libraries/Adafruit_SSD1306 b/Sming/Libraries/Adafruit_SSD1306
new file mode 160000
index 0000000000..ddfec78fa1
--- /dev/null
+++ b/Sming/Libraries/Adafruit_SSD1306
@@ -0,0 +1 @@
+Subproject commit ddfec78fa15f0ff8dfc8a76524077ba6bb5fc6f3
diff --git a/Sming/Libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp b/Sming/Libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp
deleted file mode 100644
index 6d0d109b83..0000000000
--- a/Sming/Libraries/Adafruit_SSD1306/Adafruit_SSD1306.cpp
+++ /dev/null
@@ -1,796 +0,0 @@
-/*********************************************************************
-This is a library for our Monochrome OLEDs based on SSD1306 drivers
-
- Pick one up today in the adafruit shop!
- ------> http://www.adafruit.com/category/63_98
-
-These displays use SPI to communicate, 4 or 5 pins are required to
-interface
-
-Adafruit invests time and resources providing this open source code,
-please support Adafruit and open-source hardware by purchasing
-products from Adafruit!
-
-Written by Limor Fried/Ladyada for Adafruit Industries.
-BSD license, check license.txt for more information
-All text above, and the splash screen below must be included in any redistribution
-*********************************************************************/
-
-//#include
-//#ifndef __SAM3X8E__
-// #include
-//#endif
-#include "Adafruit_SSD1306.h"
-
-#include
-
-#include "../../SmingCore/Wire.h"
-#include "../Adafruit_GFX/Adafruit_GFX.h"
-
-// the memory buffer for the LCD
-
-static uint8_t buffer[SSD1306_LCDHEIGHT * SSD1306_LCDWIDTH / 8] = {
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
-0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x80, 0x80, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xF8, 0xE0, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80,
-0x80, 0x80, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0xFF,
-#if (SSD1306_LCDHEIGHT * SSD1306_LCDWIDTH > 96*16)
-0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00,
-0x80, 0xFF, 0xFF, 0x80, 0x80, 0x00, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x8C, 0x8E, 0x84, 0x00, 0x00, 0x80, 0xF8,
-0xF8, 0xF8, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xE0, 0xE0, 0xC0, 0x80,
-0x00, 0xE0, 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFF, 0xC7, 0x01, 0x01,
-0x01, 0x01, 0x83, 0xFF, 0xFF, 0x00, 0x00, 0x7C, 0xFE, 0xC7, 0x01, 0x01, 0x01, 0x01, 0x83, 0xFF,
-0xFF, 0xFF, 0x00, 0x38, 0xFE, 0xC7, 0x83, 0x01, 0x01, 0x01, 0x83, 0xC7, 0xFF, 0xFF, 0x00, 0x00,
-0x01, 0xFF, 0xFF, 0x01, 0x01, 0x00, 0xFF, 0xFF, 0x07, 0x01, 0x01, 0x01, 0x00, 0x00, 0x7F, 0xFF,
-0x80, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x7F, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x01, 0xFF,
-0xFF, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x03, 0x0F, 0x3F, 0x7F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0xC7, 0xC7, 0x8F,
-0x8F, 0x9F, 0xBF, 0xFF, 0xFF, 0xC3, 0xC0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFC, 0xFC,
-0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xF8, 0xF8, 0xF0, 0xF0, 0xE0, 0xC0, 0x00, 0x01, 0x03, 0x03, 0x03,
-0x03, 0x03, 0x01, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01,
-0x03, 0x01, 0x00, 0x00, 0x00, 0x01, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x03, 0x03, 0x00, 0x00,
-0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
-0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x01, 0x03, 0x01, 0x00, 0x00, 0x00, 0x03,
-0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-#if (SSD1306_LCDHEIGHT == 64)
-0x00, 0x00, 0x00, 0x80, 0xC0, 0xE0, 0xF0, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x1F, 0x0F,
-0x87, 0xC7, 0xF7, 0xFF, 0xFF, 0x1F, 0x1F, 0x3D, 0xFC, 0xF8, 0xF8, 0xF8, 0xF8, 0x7C, 0x7D, 0xFF,
-0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x0F, 0x07, 0x00, 0x30, 0x30, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0xFE, 0xFE, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xC0, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0xC0, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x7F, 0x3F, 0x1F,
-0x0F, 0x07, 0x1F, 0x7F, 0xFF, 0xFF, 0xF8, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xF8, 0xE0,
-0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xFE, 0x00, 0x00,
-0x00, 0xFC, 0xFE, 0xFC, 0x0C, 0x06, 0x06, 0x0E, 0xFC, 0xF8, 0x00, 0x00, 0xF0, 0xF8, 0x1C, 0x0E,
-0x06, 0x06, 0x06, 0x0C, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0xFC,
-0xFE, 0xFC, 0x00, 0x18, 0x3C, 0x7E, 0x66, 0xE6, 0xCE, 0x84, 0x00, 0x00, 0x06, 0xFF, 0xFF, 0x06,
-0x06, 0xFC, 0xFE, 0xFC, 0x0C, 0x06, 0x06, 0x06, 0x00, 0x00, 0xFE, 0xFE, 0x00, 0x00, 0xC0, 0xF8,
-0xFC, 0x4E, 0x46, 0x46, 0x46, 0x4E, 0x7C, 0x78, 0x40, 0x18, 0x3C, 0x76, 0xE6, 0xCE, 0xCC, 0x80,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x01, 0x07, 0x0F, 0x1F, 0x1F, 0x3F, 0x3F, 0x3F, 0x3F, 0x1F, 0x0F, 0x03,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00,
-0x00, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x03, 0x07, 0x0E, 0x0C,
-0x18, 0x18, 0x0C, 0x06, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x01, 0x0F, 0x0E, 0x0C, 0x18, 0x0C, 0x0F,
-0x07, 0x01, 0x00, 0x04, 0x0E, 0x0C, 0x18, 0x0C, 0x0F, 0x07, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00,
-0x00, 0x0F, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x07,
-0x07, 0x0C, 0x0C, 0x18, 0x1C, 0x0C, 0x06, 0x06, 0x00, 0x04, 0x0E, 0x0C, 0x18, 0x0C, 0x0F, 0x07,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-#endif
-#endif
-};
-
-
-
-// the most basic function, set a single pixel
-void Adafruit_SSD1306::drawPixel(int16_t x, int16_t y, uint16_t color) {
- if ((x < 0) || (x >= width()) || (y < 0) || (y >= height()))
- return;
-
- // check rotation, move pixel around if necessary
- switch (getRotation()) {
- case 1:
- swap(x, y);
- x = WIDTH - x - 1;
- break;
- case 2:
- x = WIDTH - x - 1;
- y = HEIGHT - y - 1;
- break;
- case 3:
- swap(x, y);
- y = HEIGHT - y - 1;
- break;
- }
-
- // x is which column
- switch (color)
- {
- case WHITE: buffer[x+ (y/8)*SSD1306_LCDWIDTH] |= (1 << (y&7)); break;
- case BLACK: buffer[x+ (y/8)*SSD1306_LCDWIDTH] &= ~(1 << (y&7)); break;
- case INVERSE: buffer[x+ (y/8)*SSD1306_LCDWIDTH] ^= (1 << (y&7)); break;
- }
-
-}
-
-Adafruit_SSD1306::Adafruit_SSD1306(int8_t SID, int8_t SCLK, int8_t DC, int8_t RST, int8_t CS) : Adafruit_GFX(SSD1306_LCDWIDTH, SSD1306_LCDHEIGHT) {
- cs = CS;
- rst = RST;
- dc = DC;
- sclk = SCLK;
- sid = SID;
- hwSPI = false;
-}
-
-// constructor for hardware SPI - we indicate DataCommand, ChipSelect, Reset
-Adafruit_SSD1306::Adafruit_SSD1306(int8_t DC, int8_t RST, int8_t CS) : Adafruit_GFX(SSD1306_LCDWIDTH, SSD1306_LCDHEIGHT) {
- dc = DC;
- rst = RST;
- cs = CS;
- hwSPI = true;
-}
-
-// initializer for I2C - we only indicate the reset pin!
-Adafruit_SSD1306::Adafruit_SSD1306(int8_t reset) :
-Adafruit_GFX(SSD1306_LCDWIDTH, SSD1306_LCDHEIGHT) {
- sclk = dc = cs = sid = -1;
- rst = reset;
-}
-
-
-void Adafruit_SSD1306::begin(uint8_t vccstate, uint8_t i2caddr, bool reset) {
- _vccstate = vccstate;
- _i2caddr = i2caddr;
-
- // set pin directions
- if (sid != -1){
- pinMode(dc, OUTPUT);
- pinMode(cs, OUTPUT);
- csport = portOutputRegister(digitalPinToPort(cs));
- cspinmask = digitalPinToBitMask(cs);
- dcport = portOutputRegister(digitalPinToPort(dc));
- dcpinmask = digitalPinToBitMask(dc);
- if (!hwSPI){
- // set pins for software-SPI
- pinMode(sid, OUTPUT);
- pinMode(sclk, OUTPUT);
- clkport = portOutputRegister(digitalPinToPort(sclk));
- clkpinmask = digitalPinToBitMask(sclk);
- mosiport = portOutputRegister(digitalPinToPort(sid));
- mosipinmask = digitalPinToBitMask(sid);
- }
- if (hwSPI){
- SPI.begin ();
-#if defined(__SAM3X8E__)
- SPI.setClockDivider (9); // 9.3 MHz
-#elif defined(__ESP8266_EX__)
- ;// SPI clock divider not implemented yet!
-#else
- SPI.setClockDivider (SPI_CLOCK_DIV2); // 8 MHz
-#endif
- }
- }
- else
- {
- // I2C Init
- Wire.begin();
-#ifdef __SAM3X8E__
- // Force 400 KHz I2C, rawr! (Uses pins 20, 21 for SDA, SCL)
- TWI1->TWI_CWGR = 0;
- TWI1->TWI_CWGR = ((VARIANT_MCK / (2 * 400000)) - 4) * 0x101;
-#endif
- }
-
- if (reset) {
- // Setup reset pin direction (used by both SPI and I2C)
- pinMode(rst, OUTPUT);
- digitalWrite(rst, HIGH);
- // VDD (3.3V) goes high at start, lets just chill for a ms
- delay(1);
- // bring reset low
- digitalWrite(rst, LOW);
- // wait 10ms
- delay(10);
- // bring out of reset
- digitalWrite(rst, HIGH);
- // turn on VCC (9V?)
- }
-
- #if defined SSD1306_128_32
- // Init sequence for 128x32 OLED module
- ssd1306_command(SSD1306_DISPLAYOFF); // 0xAE
- ssd1306_command(SSD1306_SETDISPLAYCLOCKDIV); // 0xD5
- ssd1306_command(0x80); // the suggested ratio 0x80
- ssd1306_command(SSD1306_SETMULTIPLEX); // 0xA8
- ssd1306_command(0x1F);
- ssd1306_command(SSD1306_SETDISPLAYOFFSET); // 0xD3
- ssd1306_command(0x0); // no offset
- ssd1306_command(SSD1306_SETSTARTLINE | 0x0); // line #0
- ssd1306_command(SSD1306_CHARGEPUMP); // 0x8D
- if (vccstate == SSD1306_EXTERNALVCC)
- { ssd1306_command(0x10); }
- else
- { ssd1306_command(0x14); }
- ssd1306_command(SSD1306_MEMORYMODE); // 0x20
- ssd1306_command(0x00); // 0x0 act like ks0108
- ssd1306_command(SSD1306_SEGREMAP | 0x1);
- ssd1306_command(SSD1306_COMSCANDEC);
- ssd1306_command(SSD1306_SETCOMPINS); // 0xDA
- ssd1306_command(0x02);
- ssd1306_command(SSD1306_SETCONTRAST); // 0x81
- ssd1306_command(0x8F);
- ssd1306_command(SSD1306_SETPRECHARGE); // 0xd9
- if (vccstate == SSD1306_EXTERNALVCC)
- { ssd1306_command(0x22); }
- else
- { ssd1306_command(0xF1); }
- ssd1306_command(SSD1306_SETVCOMDETECT); // 0xDB
- ssd1306_command(0x40);
- ssd1306_command(SSD1306_DISPLAYALLON_RESUME); // 0xA4
- ssd1306_command(SSD1306_NORMALDISPLAY); // 0xA6
- #endif
-
- #if defined SSD1306_128_64 || defined SH1106_128_64
- // Init sequence for 128x64 OLED module
- ssd1306_command(SSD1306_DISPLAYOFF); // 0xAE
- ssd1306_command(SSD1306_SETDISPLAYCLOCKDIV); // 0xD5
- ssd1306_command(0x80); // the suggested ratio 0x80
- ssd1306_command(SSD1306_SETMULTIPLEX); // 0xA8
- ssd1306_command(0x3F);
- ssd1306_command(SSD1306_SETDISPLAYOFFSET); // 0xD3
- ssd1306_command(0x0); // no offset
- ssd1306_command(SSD1306_SETSTARTLINE | 0x0); // line #0
- ssd1306_command(SSD1306_CHARGEPUMP); // 0x8D
- if (vccstate == SSD1306_EXTERNALVCC)
- { ssd1306_command(0x10); }
- else
- { ssd1306_command(0x14); }
- ssd1306_command(SSD1306_MEMORYMODE); // 0x20
- ssd1306_command(0x00); // 0x0 act like ks0108
- ssd1306_command(SSD1306_SEGREMAP | 0x1);
- ssd1306_command(SSD1306_COMSCANDEC);
- ssd1306_command(SSD1306_SETCOMPINS); // 0xDA
- ssd1306_command(0x12);
- ssd1306_command(SSD1306_SETCONTRAST); // 0x81
- if (vccstate == SSD1306_EXTERNALVCC)
- { ssd1306_command(0x9F); }
- else
- { ssd1306_command(0xCF); }
- ssd1306_command(SSD1306_SETPRECHARGE); // 0xd9
- if (vccstate == SSD1306_EXTERNALVCC)
- { ssd1306_command(0x22); }
- else
- { ssd1306_command(0xF1); }
- ssd1306_command(SSD1306_SETVCOMDETECT); // 0xDB
- ssd1306_command(0x40);
- ssd1306_command(SSD1306_DISPLAYALLON_RESUME); // 0xA4
- ssd1306_command(SSD1306_NORMALDISPLAY); // 0xA6
- #endif
-
- #if defined SSD1306_96_16
- // Init sequence for 96x16 OLED module
- ssd1306_command(SSD1306_DISPLAYOFF); // 0xAE
- ssd1306_command(SSD1306_SETDISPLAYCLOCKDIV); // 0xD5
- ssd1306_command(0x80); // the suggested ratio 0x80
- ssd1306_command(SSD1306_SETMULTIPLEX); // 0xA8
- ssd1306_command(0x0F);
- ssd1306_command(SSD1306_SETDISPLAYOFFSET); // 0xD3
- ssd1306_command(0x00); // no offset
- ssd1306_command(SSD1306_SETSTARTLINE | 0x0); // line #0
- ssd1306_command(SSD1306_CHARGEPUMP); // 0x8D
- if (vccstate == SSD1306_EXTERNALVCC)
- { ssd1306_command(0x10); }
- else
- { ssd1306_command(0x14); }
- ssd1306_command(SSD1306_MEMORYMODE); // 0x20
- ssd1306_command(0x00); // 0x0 act like ks0108
- ssd1306_command(SSD1306_SEGREMAP | 0x1);
- ssd1306_command(SSD1306_COMSCANDEC);
- ssd1306_command(SSD1306_SETCOMPINS); // 0xDA
- ssd1306_command(0x2); //ada x12
- ssd1306_command(SSD1306_SETCONTRAST); // 0x81
- if (vccstate == SSD1306_EXTERNALVCC)
- { ssd1306_command(0x10); }
- else
- { ssd1306_command(0xAF); }
- ssd1306_command(SSD1306_SETPRECHARGE); // 0xd9
- if (vccstate == SSD1306_EXTERNALVCC)
- { ssd1306_command(0x22); }
- else
- { ssd1306_command(0xF1); }
- ssd1306_command(SSD1306_SETVCOMDETECT); // 0xDB
- ssd1306_command(0x40);
- ssd1306_command(SSD1306_DISPLAYALLON_RESUME); // 0xA4
- ssd1306_command(SSD1306_NORMALDISPLAY); // 0xA6
- #endif
-
- ssd1306_command(SSD1306_DISPLAYON);//--turn on oled panel
-}
-
-
-void Adafruit_SSD1306::invertDisplay(uint8_t i) {
- if (i) {
- ssd1306_command(SSD1306_INVERTDISPLAY);
- } else {
- ssd1306_command(SSD1306_NORMALDISPLAY);
- }
-}
-
-void Adafruit_SSD1306::ssd1306_command(uint8_t c) {
- if (sid != -1)
- {
- // SPI
- //digitalWrite(cs, HIGH);
- *csport |= cspinmask;
- //digitalWrite(dc, LOW);
- *dcport &= ~dcpinmask;
- //digitalWrite(cs, LOW);
- *csport &= ~cspinmask;
- fastSPIwrite(c);
- //digitalWrite(cs, HIGH);
- *csport |= cspinmask;
- }
- else
- {
- // I2C
- uint8_t control = 0x00; // Co = 0, D/C = 0
- Wire.beginTransmission(_i2caddr);
- WIRE_WRITE(control);
- WIRE_WRITE(c);
- Wire.endTransmission();
- }
-}
-
-// startscrollright
-// Activate a right handed scroll for rows start through stop
-// Hint, the display is 16 rows tall. To scroll the whole display, run:
-// display.scrollright(0x00, 0x0F)
-void Adafruit_SSD1306::startscrollright(uint8_t start, uint8_t stop){
- ssd1306_command(SSD1306_RIGHT_HORIZONTAL_SCROLL);
- ssd1306_command(0X00);
- ssd1306_command(start);
- ssd1306_command(0X00);
- ssd1306_command(stop);
- ssd1306_command(0X00);
- ssd1306_command(0XFF);
- ssd1306_command(SSD1306_ACTIVATE_SCROLL);
-}
-
-// startscrollleft
-// Activate a right handed scroll for rows start through stop
-// Hint, the display is 16 rows tall. To scroll the whole display, run:
-// display.scrollright(0x00, 0x0F)
-void Adafruit_SSD1306::startscrollleft(uint8_t start, uint8_t stop){
- ssd1306_command(SSD1306_LEFT_HORIZONTAL_SCROLL);
- ssd1306_command(0X00);
- ssd1306_command(start);
- ssd1306_command(0X00);
- ssd1306_command(stop);
- ssd1306_command(0X00);
- ssd1306_command(0XFF);
- ssd1306_command(SSD1306_ACTIVATE_SCROLL);
-}
-
-// startscrolldiagright
-// Activate a diagonal scroll for rows start through stop
-// Hint, the display is 16 rows tall. To scroll the whole display, run:
-// display.scrollright(0x00, 0x0F)
-void Adafruit_SSD1306::startscrolldiagright(uint8_t start, uint8_t stop){
- ssd1306_command(SSD1306_SET_VERTICAL_SCROLL_AREA);
- ssd1306_command(0X00);
- ssd1306_command(SSD1306_LCDHEIGHT);
- ssd1306_command(SSD1306_VERTICAL_AND_RIGHT_HORIZONTAL_SCROLL);
- ssd1306_command(0X00);
- ssd1306_command(start);
- ssd1306_command(0X00);
- ssd1306_command(stop);
- ssd1306_command(0X01);
- ssd1306_command(SSD1306_ACTIVATE_SCROLL);
-}
-
-// startscrolldiagleft
-// Activate a diagonal scroll for rows start through stop
-// Hint, the display is 16 rows tall. To scroll the whole display, run:
-// display.scrollright(0x00, 0x0F)
-void Adafruit_SSD1306::startscrolldiagleft(uint8_t start, uint8_t stop){
- ssd1306_command(SSD1306_SET_VERTICAL_SCROLL_AREA);
- ssd1306_command(0X00);
- ssd1306_command(SSD1306_LCDHEIGHT);
- ssd1306_command(SSD1306_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL);
- ssd1306_command(0X00);
- ssd1306_command(start);
- ssd1306_command(0X00);
- ssd1306_command(stop);
- ssd1306_command(0X01);
- ssd1306_command(SSD1306_ACTIVATE_SCROLL);
-}
-
-void Adafruit_SSD1306::stopscroll(void){
- ssd1306_command(SSD1306_DEACTIVATE_SCROLL);
-}
-
-// Dim the display
-// dim = true: display is dimmed
-// dim = false: display is normal
-void Adafruit_SSD1306::dim(boolean dim) {
- uint8_t contrast;
-
- if (dim) {
- contrast = 0; // Dimmed display
- } else {
- if (_vccstate == SSD1306_EXTERNALVCC) {
- contrast = 0x9F;
- } else {
- contrast = 0xCF;
- }
- }
- // the range of contrast to too small to be really useful
- // it is useful to dim the display
- ssd1306_command(SSD1306_SETCONTRAST);
- ssd1306_command(contrast);
-}
-
-void Adafruit_SSD1306::ssd1306_data(uint8_t c) {
- if (sid != -1)
- {
- // SPI
- //digitalWrite(cs, HIGH);
- *csport |= cspinmask;
- //digitalWrite(dc, HIGH);
- *dcport |= dcpinmask;
- //digitalWrite(cs, LOW);
- *csport &= ~cspinmask;
- fastSPIwrite(c);
- //digitalWrite(cs, HIGH);
- *csport |= cspinmask;
- }
- else
- {
- // I2C
- uint8_t control = 0x40; // Co = 0, D/C = 1
- Wire.beginTransmission(_i2caddr);
- WIRE_WRITE(control);
- WIRE_WRITE(c);
- Wire.endTransmission();
- }
-}
-
-void Adafruit_SSD1306::display(void) {
-#if defined SH1106_128_64
- for (int index = 0; index < 8; index++) {
- ssd1306_command(SH1106_SETSTARTPAGE + index);
- /* for some reason display is shifted by 2 columns
- * on 1.3" displays from ebay
- */
- ssd1306_command(SSD1306_SETLOWCOLUMN + 2); // low column start address
- ssd1306_command(SSD1306_SETHIGHCOLUMN); // high column start address
-
- for (int pixel = 0; pixel < SSD1306_LCDWIDTH; pixel++) {
- Wire.beginTransmission(_i2caddr);
- WIRE_WRITE(0x40);
- // input buffer doesn't accept all bytes at once
- for (uint8_t x=0; x<16; x++) {
- WIRE_WRITE(buffer[index * SSD1306_LCDWIDTH + pixel]);
- ++pixel;
- }
- --pixel;
- Wire.endTransmission();
- }
- }
-#else
- ssd1306_command(SSD1306_COLUMNADDR);
- ssd1306_command(0); // Column start address (0 = reset)
- ssd1306_command(SSD1306_LCDWIDTH-1); // Column end address (127 = reset)
-
- ssd1306_command(SSD1306_PAGEADDR);
- ssd1306_command(0); // Page start address (0 = reset)
- #if SSD1306_LCDHEIGHT == 64
- ssd1306_command(7); // Page end address
- #endif
- #if SSD1306_LCDHEIGHT == 32
- ssd1306_command(3); // Page end address
- #endif
- #if SSD1306_LCDHEIGHT == 16
- ssd1306_command(1); // Page end address
- #endif
-
- if (sid != -1)
- {
- // SPI
- *csport |= cspinmask;
- *dcport |= dcpinmask;
- *csport &= ~cspinmask;
-
- for (uint16_t i=0; i<(SSD1306_LCDWIDTH*SSD1306_LCDHEIGHT/8); i++) {
- fastSPIwrite(buffer[i]);
- //ssd1306_data(buffer[i]);
- }
- *csport |= cspinmask;
- }
- else
- {
- // save I2C bitrate
-#if !defined(__SAM3X8E__) && !defined(__ESP8266_EX__)
- uint8_t twbrbackup = TWBR;
- TWBR = 12; // upgrade to 400KHz!
-#endif
-
- //Serial.println(TWBR, DEC);
- //Serial.println(TWSR & 0x3, DEC);
-
- // I2C
- for (uint16_t i=0; i<(SSD1306_LCDWIDTH*SSD1306_LCDHEIGHT/8); i++) {
- // send a bunch of data in one xmission
- Wire.beginTransmission(_i2caddr);
- WIRE_WRITE(0x40);
- for (uint8_t x=0; x<16; x++) {
- WIRE_WRITE(buffer[i]);
- i++;
- }
- i--;
- Wire.endTransmission();
- }
-#if !defined(__SAM3X8E__) && !defined(__ESP8266_EX__)
- TWBR = twbrbackup;
-#endif
- }
-#endif
-}
-
-// clear everything
-void Adafruit_SSD1306::clearDisplay(void) {
- memset(buffer, 0, (SSD1306_LCDWIDTH*SSD1306_LCDHEIGHT/8));
-}
-
-
-inline void Adafruit_SSD1306::fastSPIwrite(uint8_t d) {
-
- if(hwSPI) {
- (void)SPI.transfer(d);
- } else {
- for(uint8_t bit = 0x80; bit; bit >>= 1) {
- *clkport &= ~clkpinmask;
- if(d & bit) *mosiport |= mosipinmask;
- else *mosiport &= ~mosipinmask;
- *clkport |= clkpinmask;
- }
- }
- //*csport |= cspinmask;
-}
-
-void Adafruit_SSD1306::drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color) {
- boolean bSwap = false;
- switch(rotation) {
- case 0:
- // 0 degree rotation, do nothing
- break;
- case 1:
- // 90 degree rotation, swap x & y for rotation, then invert x
- bSwap = true;
- swap(x, y);
- x = WIDTH - x - 1;
- break;
- case 2:
- // 180 degree rotation, invert x and y - then shift y around for height.
- x = WIDTH - x - 1;
- y = HEIGHT - y - 1;
- x -= (w-1);
- break;
- case 3:
- // 270 degree rotation, swap x & y for rotation, then invert y and adjust y for w (not to become h)
- bSwap = true;
- swap(x, y);
- y = HEIGHT - y - 1;
- y -= (w-1);
- break;
- }
-
- if(bSwap) {
- drawFastVLineInternal(x, y, w, color);
- } else {
- drawFastHLineInternal(x, y, w, color);
- }
-}
-
-void Adafruit_SSD1306::drawFastHLineInternal(int16_t x, int16_t y, int16_t w, uint16_t color) {
- // Do bounds/limit checks
- if(y < 0 || y >= HEIGHT) { return; }
-
- // make sure we don't try to draw below 0
- if(x < 0) {
- w += x;
- x = 0;
- }
-
- // make sure we don't go off the edge of the display
- if( (x + w) > WIDTH) {
- w = (WIDTH - x);
- }
-
- // if our width is now negative, punt
- if(w <= 0) { return; }
-
- // set up the pointer for movement through the buffer
- register uint8_t *pBuf = buffer;
- // adjust the buffer pointer for the current row
- pBuf += ((y/8) * SSD1306_LCDWIDTH);
- // and offset x columns in
- pBuf += x;
-
- register uint8_t mask = 1 << (y&7);
-
- switch (color)
- {
- case WHITE: while(w--) { *pBuf++ |= mask; }; break;
- case BLACK: mask = ~mask; while(w--) { *pBuf++ &= mask; }; break;
- case INVERSE: while(w--) { *pBuf++ ^= mask; }; break;
- }
-}
-
-void Adafruit_SSD1306::drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color) {
- bool bSwap = false;
- switch(rotation) {
- case 0:
- break;
- case 1:
- // 90 degree rotation, swap x & y for rotation, then invert x and adjust x for h (now to become w)
- bSwap = true;
- swap(x, y);
- x = WIDTH - x - 1;
- x -= (h-1);
- break;
- case 2:
- // 180 degree rotation, invert x and y - then shift y around for height.
- x = WIDTH - x - 1;
- y = HEIGHT - y - 1;
- y -= (h-1);
- break;
- case 3:
- // 270 degree rotation, swap x & y for rotation, then invert y
- bSwap = true;
- swap(x, y);
- y = HEIGHT - y - 1;
- break;
- }
-
- if(bSwap) {
- drawFastHLineInternal(x, y, h, color);
- } else {
- drawFastVLineInternal(x, y, h, color);
- }
-}
-
-
-void Adafruit_SSD1306::drawFastVLineInternal(int16_t x, int16_t __y, int16_t __h, uint16_t color) {
-
- // do nothing if we're off the left or right side of the screen
- if(x < 0 || x >= WIDTH) { return; }
-
- // make sure we don't try to draw below 0
- if(__y < 0) {
- // __y is negative, this will subtract enough from __h to account for __y being 0
- __h += __y;
- __y = 0;
-
- }
-
- // make sure we don't go past the height of the display
- if( (__y + __h) > HEIGHT) {
- __h = (HEIGHT - __y);
- }
-
- // if our height is now negative, punt
- if(__h <= 0) {
- return;
- }
-
- // this display doesn't need ints for coordinates, use local byte registers for faster juggling
- register uint8_t y = __y;
- register uint8_t h = __h;
-
-
- // set up the pointer for fast movement through the buffer
- register uint8_t *pBuf = buffer;
- // adjust the buffer pointer for the current row
- pBuf += ((y/8) * SSD1306_LCDWIDTH);
- // and offset x columns in
- pBuf += x;
-
- // do the first partial byte, if necessary - this requires some masking
- register uint8_t mod = (y&7);
- if(mod) {
- // mask off the high n bits we want to set
- mod = 8-mod;
-
- // note - lookup table results in a nearly 10% performance improvement in fill* functions
- // register uint8_t mask = ~(0xFF >> (mod));
- static uint8_t premask[8] = {0x00, 0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE };
- register uint8_t mask = premask[mod];
-
- // adjust the mask if we're not going to reach the end of this byte
- if( h < mod) {
- mask &= (0XFF >> (mod-h));
- }
-
- switch (color)
- {
- case WHITE: *pBuf |= mask; break;
- case BLACK: *pBuf &= ~mask; break;
- case INVERSE: *pBuf ^= mask; break;
- }
-
- // fast exit if we're done here!
- if(h= 8) {
- if (color == INVERSE) { // separate copy of the code so we don't impact performance of the black/white write version with an extra comparison per loop
- do {
- *pBuf=~(*pBuf);
-
- // adjust the buffer forward 8 rows worth of data
- pBuf += SSD1306_LCDWIDTH;
-
- // adjust h & y (there's got to be a faster way for me to do this, but this should still help a fair bit for now)
- h -= 8;
- } while(h >= 8);
- }
- else {
- // store a local value to work with
- register uint8_t val = (color == WHITE) ? 255 : 0;
-
- do {
- // write our value in
- *pBuf = val;
-
- // adjust the buffer forward 8 rows worth of data
- pBuf += SSD1306_LCDWIDTH;
-
- // adjust h & y (there's got to be a faster way for me to do this, but this should still help a fair bit for now)
- h -= 8;
- } while(h >= 8);
- }
- }
-
- // now do the final partial byte, if necessary
- if(h) {
- mod = h & 7;
- // this time we want to mask the low bits of the byte, vs the high bits we did above
- // register uint8_t mask = (1 << mod) - 1;
- // note - lookup table results in a nearly 10% performance improvement in fill* functions
- static uint8_t postmask[8] = {0x00, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F };
- register uint8_t mask = postmask[mod];
- switch (color)
- {
- case WHITE: *pBuf |= mask; break;
- case BLACK: *pBuf &= ~mask; break;
- case INVERSE: *pBuf ^= mask; break;
- }
- }
-}
diff --git a/Sming/Libraries/Adafruit_SSD1306/Adafruit_SSD1306.h b/Sming/Libraries/Adafruit_SSD1306/Adafruit_SSD1306.h
deleted file mode 100644
index 524531ac1a..0000000000
--- a/Sming/Libraries/Adafruit_SSD1306/Adafruit_SSD1306.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/*********************************************************************
-This is a library for our Monochrome OLEDs based on SSD1306 drivers
-
- Pick one up today in the adafruit shop!
- ------> http://www.adafruit.com/category/63_98
-
-These displays use SPI to communicate, 4 or 5 pins are required to
-interface
-
-Adafruit invests time and resources providing this open source code,
-please support Adafruit and open-source hardware by purchasing
-products from Adafruit!
-
-Written by Limor Fried/Ladyada for Adafruit Industries.
-BSD license, check license.txt for more information
-All text above, and the splash screen must be included in any redistribution
-*********************************************************************/
-
-#if ARDUINO >= 100
- #include "Arduino.h"
- #define WIRE_WRITE Wire.write
-#else
- #include "WProgram.h"
- #define WIRE_WRITE Wire.send
-#endif
-
-#ifdef __SAM3X8E__
- typedef volatile RwReg PortReg;
- typedef uint32_t PortMask;
-#else
- typedef volatile uint8_t PortReg;
- typedef uint8_t PortMask;
-#endif
-
-#include "../../SmingCore/SPI.h"
-#include
-
-#define BLACK 0
-#define WHITE 1
-#define INVERSE 2
-
-#define SSD1306_I2C_ADDRESS 0x3C // 011110+SA0+RW - 0x3C or 0x3D
-// Address for 128x32 is 0x3C
-// Address for 128x64 is 0x3D (default) or 0x3C (if SA0 is grounded)
-
-/*=========================================================================
- SSD1306 Displays
- -----------------------------------------------------------------------
- The driver is used in multiple displays (128x64, 128x32, etc.).
- Select the appropriate display below to create an appropriately
- sized framebuffer, etc.
-
- SSD1306_128_64 128x64 pixel display
-
- SSD1306_128_32 128x32 pixel display
-
- SSD1306_96_16
-
- SH1106_128_64 - 1.3" OLED display version
-
- -----------------------------------------------------------------------*/
-// #define SH1106_128_64
- #define SSD1306_128_64
-// #define SSD1306_128_32
-// #define SSD1306_96_16
-/*=========================================================================*/
-
-#if defined SSD1306_128_64 && defined SH1106_128_64
- #error "Select either SH1106 or SSD1306 display type in SSD1306.h"
-#endif
-
-#if defined SSD1306_128_64 && defined SSD1306_128_32
- #error "Only one SSD1306 display can be specified at once in SSD1306.h"
-#endif
-#if !defined SSD1306_128_64 && !defined SSD1306_128_32 && \
- !defined SSD1306_96_16 && !defined SH1106_128_64
- #error "At least one SSD1306 display must be specified in SSD1306.h"
-#endif
-
-#if defined SSD1306_128_64 || defined SH1106_128_64
- #define SSD1306_LCDWIDTH 128
- #define SSD1306_LCDHEIGHT 64
-#endif
-#if defined SSD1306_128_32
- #define SSD1306_LCDWIDTH 128
- #define SSD1306_LCDHEIGHT 32
-#endif
-#if defined SSD1306_96_16
- #define SSD1306_LCDWIDTH 96
- #define SSD1306_LCDHEIGHT 16
-#endif
-
-#define SSD1306_SETCONTRAST 0x81
-#define SSD1306_DISPLAYALLON_RESUME 0xA4
-#define SSD1306_DISPLAYALLON 0xA5
-#define SSD1306_NORMALDISPLAY 0xA6
-#define SSD1306_INVERTDISPLAY 0xA7
-#define SSD1306_DISPLAYOFF 0xAE
-#define SSD1306_DISPLAYON 0xAF
-
-#define SSD1306_SETDISPLAYOFFSET 0xD3
-#define SSD1306_SETCOMPINS 0xDA
-
-#define SSD1306_SETVCOMDETECT 0xDB
-
-#define SSD1306_SETDISPLAYCLOCKDIV 0xD5
-#define SSD1306_SETPRECHARGE 0xD9
-
-#define SSD1306_SETMULTIPLEX 0xA8
-
-#define SSD1306_SETLOWCOLUMN 0x00
-#define SSD1306_SETHIGHCOLUMN 0x10
-
-#define SSD1306_SETSTARTLINE 0x40
-
-#define SSD1306_MEMORYMODE 0x20
-#define SSD1306_COLUMNADDR 0x21
-#define SSD1306_PAGEADDR 0x22
-
-#define SSD1306_COMSCANINC 0xC0
-#define SSD1306_COMSCANDEC 0xC8
-
-#define SSD1306_SEGREMAP 0xA0
-
-#define SSD1306_CHARGEPUMP 0x8D
-
-#define SSD1306_EXTERNALVCC 0x1
-#define SSD1306_SWITCHCAPVCC 0x2
-
-#define SH1106_SETSTARTPAGE 0xB0
-
-// Scrolling #defines
-#define SSD1306_ACTIVATE_SCROLL 0x2F
-#define SSD1306_DEACTIVATE_SCROLL 0x2E
-#define SSD1306_SET_VERTICAL_SCROLL_AREA 0xA3
-#define SSD1306_RIGHT_HORIZONTAL_SCROLL 0x26
-#define SSD1306_LEFT_HORIZONTAL_SCROLL 0x27
-#define SSD1306_VERTICAL_AND_RIGHT_HORIZONTAL_SCROLL 0x29
-#define SSD1306_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL 0x2A
-
-class Adafruit_SSD1306 : public Adafruit_GFX {
- public:
- Adafruit_SSD1306(int8_t SID, int8_t SCLK, int8_t DC, int8_t RST, int8_t CS);
- Adafruit_SSD1306(int8_t DC, int8_t RST, int8_t CS);
- Adafruit_SSD1306(int8_t RST);
-
- void begin(uint8_t switchvcc = SSD1306_SWITCHCAPVCC, uint8_t i2caddr = SSD1306_I2C_ADDRESS, bool reset=true);
- void ssd1306_command(uint8_t c);
- void ssd1306_data(uint8_t c);
-
- void clearDisplay(void);
- void invertDisplay(uint8_t i);
- void display();
-
- void startscrollright(uint8_t start, uint8_t stop);
- void startscrollleft(uint8_t start, uint8_t stop);
-
- void startscrolldiagright(uint8_t start, uint8_t stop);
- void startscrolldiagleft(uint8_t start, uint8_t stop);
- void stopscroll(void);
-
- void dim(boolean dim);
-
- void drawPixel(int16_t x, int16_t y, uint16_t color);
-
- virtual void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
- virtual void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
-
- private:
- int8_t _i2caddr, _vccstate, sid, sclk, dc, rst, cs;
- void fastSPIwrite(uint8_t c);
-
- boolean hwSPI;
- PortReg *mosiport, *clkport, *csport, *dcport;
- PortMask mosipinmask, clkpinmask, cspinmask, dcpinmask;
-
- inline void drawFastVLineInternal(int16_t x, int16_t y, int16_t h, uint16_t color) __attribute__((always_inline));
- inline void drawFastHLineInternal(int16_t x, int16_t y, int16_t w, uint16_t color) __attribute__((always_inline));
-
-};
diff --git a/Sming/Libraries/Adafruit_SSD1306/README.txt b/Sming/Libraries/Adafruit_SSD1306/README.txt
deleted file mode 100644
index 420cc153cc..0000000000
--- a/Sming/Libraries/Adafruit_SSD1306/README.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-This is a library for our Monochrome OLEDs based on SSD1306 drivers
-
- Pick one up today in the adafruit shop!
- ------> http://www.adafruit.com/category/63_98
-
-These displays use SPI to communicate, 4 or 5 pins are required to
-interface
-
-Adafruit invests time and resources providing this open source code,
-please support Adafruit and open-source hardware by purchasing
-products from Adafruit!
-
-Written by Limor Fried/Ladyada for Adafruit Industries.
-Scrolling code contributed by Michael Gregg
-BSD license, check license.txt for more information
-All text above must be included in any redistribution
-
-To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder Adafruit_SSD1306. Check that the Adafruit_SSD1306 folder contains Adafruit_SSD1306.cpp and Adafruit_SSD1306.h
-
-Place the Adafruit_SSD1306 library folder your /libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE.
-
-You will also have to download the Adafruit GFX Graphics core which does all the circles, text, rectangles, etc. You can get it from
-https://github.com/adafruit/Adafruit-GFX-Library
-and download/install that library as well
\ No newline at end of file
diff --git a/Sming/Libraries/Adafruit_SSD1306/examples/ssd1306_128x32_i2c/ssd1306_128x32_i2c.ino b/Sming/Libraries/Adafruit_SSD1306/examples/ssd1306_128x32_i2c/ssd1306_128x32_i2c.ino
deleted file mode 100644
index e82ebc10e3..0000000000
--- a/Sming/Libraries/Adafruit_SSD1306/examples/ssd1306_128x32_i2c/ssd1306_128x32_i2c.ino
+++ /dev/null
@@ -1,357 +0,0 @@
-/*********************************************************************
-This is an example for our Monochrome OLEDs based on SSD1306 drivers
-
- Pick one up today in the adafruit shop!
- ------> http://www.adafruit.com/category/63_98
-
-This example is for a 128x32 size display using I2C to communicate
-3 pins are required to interface (2 I2C and one reset)
-
-Adafruit invests time and resources providing this open source code,
-please support Adafruit and open-source hardware by purchasing
-products from Adafruit!
-
-Written by Limor Fried/Ladyada for Adafruit Industries.
-BSD license, check license.txt for more information
-All text above, and the splash screen must be included in any redistribution
-*********************************************************************/
-
-#include
-#include
-#include
-#include
-
-#define OLED_RESET 4
-Adafruit_SSD1306 display(OLED_RESET);
-
-#define NUMFLAKES 10
-#define XPOS 0
-#define YPOS 1
-#define DELTAY 2
-
-
-#define LOGO16_GLCD_HEIGHT 16
-#define LOGO16_GLCD_WIDTH 16
-static const unsigned char PROGMEM logo16_glcd_bmp[] =
-{ B00000000, B11000000,
- B00000001, B11000000,
- B00000001, B11000000,
- B00000011, B11100000,
- B11110011, B11100000,
- B11111110, B11111000,
- B01111110, B11111111,
- B00110011, B10011111,
- B00011111, B11111100,
- B00001101, B01110000,
- B00011011, B10100000,
- B00111111, B11100000,
- B00111111, B11110000,
- B01111100, B11110000,
- B01110000, B01110000,
- B00000000, B00110000 };
-
-#if (SSD1306_LCDHEIGHT != 32)
-#error("Height incorrect, please fix Adafruit_SSD1306.h!");
-#endif
-
-void setup() {
- Serial.begin(9600);
-
- // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
- display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3C (for the 128x32)
- // init done
-
- // Show image buffer on the display hardware.
- // Since the buffer is intialized with an Adafruit splashscreen
- // internally, this will display the splashscreen.
- display.display();
- delay(2000);
-
- // Clear the buffer.
- display.clearDisplay();
-
- // draw a single pixel
- display.drawPixel(10, 10, WHITE);
- // Show the display buffer on the hardware.
- // NOTE: You _must_ call display after making any drawing commands
- // to make them visible on the display hardware!
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw many lines
- testdrawline();
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw rectangles
- testdrawrect();
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw multiple rectangles
- testfillrect();
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw mulitple circles
- testdrawcircle();
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw a white circle, 10 pixel radius
- display.fillCircle(display.width()/2, display.height()/2, 10, WHITE);
- display.display();
- delay(2000);
- display.clearDisplay();
-
- testdrawroundrect();
- delay(2000);
- display.clearDisplay();
-
- testfillroundrect();
- delay(2000);
- display.clearDisplay();
-
- testdrawtriangle();
- delay(2000);
- display.clearDisplay();
-
- testfilltriangle();
- delay(2000);
- display.clearDisplay();
-
- // draw the first ~12 characters in the font
- testdrawchar();
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw scrolling text
- testscrolltext();
- delay(2000);
- display.clearDisplay();
-
- // text display tests
- display.setTextSize(1);
- display.setTextColor(WHITE);
- display.setCursor(0,0);
- display.println("Hello, world!");
- display.setTextColor(BLACK, WHITE); // 'inverted' text
- display.println(3.141592);
- display.setTextSize(2);
- display.setTextColor(WHITE);
- display.print("0x"); display.println(0xDEADBEEF, HEX);
- display.display();
- delay(2000);
-
- // miniature bitmap display
- display.clearDisplay();
- display.drawBitmap(30, 16, logo16_glcd_bmp, 16, 16, 1);
- display.display();
-
- // invert the display
- display.invertDisplay(true);
- delay(1000);
- display.invertDisplay(false);
- delay(1000);
-
- // draw a bitmap icon and 'animate' movement
- testdrawbitmap(logo16_glcd_bmp, LOGO16_GLCD_HEIGHT, LOGO16_GLCD_WIDTH);
-}
-
-
-void loop() {
-
-}
-
-
-void testdrawbitmap(const uint8_t *bitmap, uint8_t w, uint8_t h) {
- uint8_t icons[NUMFLAKES][3];
-
- // initialize
- for (uint8_t f=0; f< NUMFLAKES; f++) {
- icons[f][XPOS] = random(display.width());
- icons[f][YPOS] = 0;
- icons[f][DELTAY] = random(5) + 1;
-
- Serial.print("x: ");
- Serial.print(icons[f][XPOS], DEC);
- Serial.print(" y: ");
- Serial.print(icons[f][YPOS], DEC);
- Serial.print(" dy: ");
- Serial.println(icons[f][DELTAY], DEC);
- }
-
- while (1) {
- // draw each icon
- for (uint8_t f=0; f< NUMFLAKES; f++) {
- display.drawBitmap(icons[f][XPOS], icons[f][YPOS], logo16_glcd_bmp, w, h, WHITE);
- }
- display.display();
- delay(200);
-
- // then erase it + move it
- for (uint8_t f=0; f< NUMFLAKES; f++) {
- display.drawBitmap(icons[f][XPOS], icons[f][YPOS], logo16_glcd_bmp, w, h, BLACK);
- // move it
- icons[f][YPOS] += icons[f][DELTAY];
- // if its gone, reinit
- if (icons[f][YPOS] > display.height()) {
- icons[f][XPOS] = random(display.width());
- icons[f][YPOS] = 0;
- icons[f][DELTAY] = random(5) + 1;
- }
- }
- }
-}
-
-
-void testdrawchar(void) {
- display.setTextSize(1);
- display.setTextColor(WHITE);
- display.setCursor(0,0);
-
- for (uint8_t i=0; i < 168; i++) {
- if (i == '\n') continue;
- display.write(i);
- if ((i > 0) && (i % 21 == 0))
- display.println();
- }
- display.display();
-}
-
-void testdrawcircle(void) {
- for (int16_t i=0; i0; i-=5) {
- display.fillTriangle(display.width()/2, display.height()/2-i,
- display.width()/2-i, display.height()/2+i,
- display.width()/2+i, display.height()/2+i, WHITE);
- if (color == WHITE) color = BLACK;
- else color = WHITE;
- display.display();
- }
-}
-
-void testdrawroundrect(void) {
- for (int16_t i=0; i=0; i-=4) {
- display.drawLine(0, display.height()-1, display.width()-1, i, WHITE);
- display.display();
- }
- delay(250);
-
- display.clearDisplay();
- for (int16_t i=display.width()-1; i>=0; i-=4) {
- display.drawLine(display.width()-1, display.height()-1, i, 0, WHITE);
- display.display();
- }
- for (int16_t i=display.height()-1; i>=0; i-=4) {
- display.drawLine(display.width()-1, display.height()-1, 0, i, WHITE);
- display.display();
- }
- delay(250);
-
- display.clearDisplay();
- for (int16_t i=0; i http://www.adafruit.com/category/63_98
-
-This example is for a 128x32 size display using SPI to communicate
-4 or 5 pins are required to interface
-
-Adafruit invests time and resources providing this open source code,
-please support Adafruit and open-source hardware by purchasing
-products from Adafruit!
-
-Written by Limor Fried/Ladyada for Adafruit Industries.
-BSD license, check license.txt for more information
-All text above, and the splash screen must be included in any redistribution
-*********************************************************************/
-
-#include
-#include
-#include
-#include
-
-// If using software SPI (the default case):
-#define OLED_MOSI 9
-#define OLED_CLK 10
-#define OLED_DC 11
-#define OLED_CS 12
-#define OLED_RESET 13
-Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);
-
-/* Uncomment this block to use hardware SPI
-#define OLED_DC 6
-#define OLED_CS 7
-#define OLED_RESET 8
-Adafruit_SSD1306 display(OLED_DC, OLED_RESET, OLED_CS);
-*/
-
-#define NUMFLAKES 10
-#define XPOS 0
-#define YPOS 1
-#define DELTAY 2
-
-#define LOGO16_GLCD_HEIGHT 16
-#define LOGO16_GLCD_WIDTH 16
-static const unsigned char PROGMEM logo16_glcd_bmp[] =
-{ B00000000, B11000000,
- B00000001, B11000000,
- B00000001, B11000000,
- B00000011, B11100000,
- B11110011, B11100000,
- B11111110, B11111000,
- B01111110, B11111111,
- B00110011, B10011111,
- B00011111, B11111100,
- B00001101, B01110000,
- B00011011, B10100000,
- B00111111, B11100000,
- B00111111, B11110000,
- B01111100, B11110000,
- B01110000, B01110000,
- B00000000, B00110000 };
-
-#if (SSD1306_LCDHEIGHT != 32)
-#error("Height incorrect, please fix Adafruit_SSD1306.h!");
-#endif
-
-void setup() {
- Serial.begin(9600);
-
- // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
- display.begin(SSD1306_SWITCHCAPVCC);
- // init done
-
- // Show image buffer on the display hardware.
- // Since the buffer is intialized with an Adafruit splashscreen
- // internally, this will display the splashscreen.
- display.display();
- delay(2000);
-
- // Clear the buffer.
- display.clearDisplay();
-
- // draw a single pixel
- display.drawPixel(10, 10, WHITE);
- // Show the display buffer on the hardware.
- // NOTE: You _must_ call display after making any drawing commands
- // to make them visible on the display hardware!
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw many lines
- testdrawline();
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw rectangles
- testdrawrect();
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw multiple rectangles
- testfillrect();
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw mulitple circles
- testdrawcircle();
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw a white circle, 10 pixel radius
- display.fillCircle(display.width()/2, display.height()/2, 10, WHITE);
- display.display();
- delay(2000);
- display.clearDisplay();
-
- testdrawroundrect();
- delay(2000);
- display.clearDisplay();
-
- testfillroundrect();
- delay(2000);
- display.clearDisplay();
-
- testdrawtriangle();
- delay(2000);
- display.clearDisplay();
-
- testfilltriangle();
- delay(2000);
- display.clearDisplay();
-
- // draw the first ~12 characters in the font
- testdrawchar();
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw scrolling text
- testscrolltext();
- delay(2000);
- display.clearDisplay();
-
- // text display tests
- display.setTextSize(1);
- display.setTextColor(WHITE);
- display.setCursor(0,0);
- display.println("Hello, world!");
- display.setTextColor(BLACK, WHITE); // 'inverted' text
- display.println(3.141592);
- display.setTextSize(2);
- display.setTextColor(WHITE);
- display.print("0x"); display.println(0xDEADBEEF, HEX);
- display.display();
- delay(2000);
-
- // miniature bitmap display
- display.clearDisplay();
- display.drawBitmap(30, 16, logo16_glcd_bmp, 16, 16, 1);
- display.display();
-
- // invert the display
- display.invertDisplay(true);
- delay(1000);
- display.invertDisplay(false);
- delay(1000);
-
- // draw a bitmap icon and 'animate' movement
- testdrawbitmap(logo16_glcd_bmp, LOGO16_GLCD_HEIGHT, LOGO16_GLCD_WIDTH);
-}
-
-
-void loop() {
-
-}
-
-
-void testdrawbitmap(const uint8_t *bitmap, uint8_t w, uint8_t h) {
- uint8_t icons[NUMFLAKES][3];
-
- // initialize
- for (uint8_t f=0; f< NUMFLAKES; f++) {
- icons[f][XPOS] = random(display.width());
- icons[f][YPOS] = 0;
- icons[f][DELTAY] = random(5) + 1;
-
- Serial.print("x: ");
- Serial.print(icons[f][XPOS], DEC);
- Serial.print(" y: ");
- Serial.print(icons[f][YPOS], DEC);
- Serial.print(" dy: ");
- Serial.println(icons[f][DELTAY], DEC);
- }
-
- while (1) {
- // draw each icon
- for (uint8_t f=0; f< NUMFLAKES; f++) {
- display.drawBitmap(icons[f][XPOS], icons[f][YPOS], logo16_glcd_bmp, w, h, WHITE);
- }
- display.display();
- delay(200);
-
- // then erase it + move it
- for (uint8_t f=0; f< NUMFLAKES; f++) {
- display.drawBitmap(icons[f][XPOS], icons[f][YPOS], logo16_glcd_bmp, w, h, BLACK);
- // move it
- icons[f][YPOS] += icons[f][DELTAY];
- // if its gone, reinit
- if (icons[f][YPOS] > display.height()) {
- icons[f][XPOS] = random(display.width());
- icons[f][YPOS] = 0;
- icons[f][DELTAY] = random(5) + 1;
- }
- }
- }
-}
-
-
-void testdrawchar(void) {
- display.setTextSize(1);
- display.setTextColor(WHITE);
- display.setCursor(0,0);
-
- for (uint8_t i=0; i < 168; i++) {
- if (i == '\n') continue;
- display.write(i);
- if ((i > 0) && (i % 21 == 0))
- display.println();
- }
- display.display();
-}
-
-void testdrawcircle(void) {
- for (int16_t i=0; i0; i-=5) {
- display.fillTriangle(display.width()/2, display.height()/2-i,
- display.width()/2-i, display.height()/2+i,
- display.width()/2+i, display.height()/2+i, WHITE);
- if (color == WHITE) color = BLACK;
- else color = WHITE;
- display.display();
- }
-}
-
-void testdrawroundrect(void) {
- for (int16_t i=0; i=0; i-=4) {
- display.drawLine(0, display.height()-1, display.width()-1, i, WHITE);
- display.display();
- }
- delay(250);
-
- display.clearDisplay();
- for (int16_t i=display.width()-1; i>=0; i-=4) {
- display.drawLine(display.width()-1, display.height()-1, i, 0, WHITE);
- display.display();
- }
- for (int16_t i=display.height()-1; i>=0; i-=4) {
- display.drawLine(display.width()-1, display.height()-1, 0, i, WHITE);
- display.display();
- }
- delay(250);
-
- display.clearDisplay();
- for (int16_t i=0; i http://www.adafruit.com/category/63_98
-
-This example is for a 128x64 size display using I2C to communicate
-3 pins are required to interface (2 I2C and one reset)
-
-Adafruit invests time and resources providing this open source code,
-please support Adafruit and open-source hardware by purchasing
-products from Adafruit!
-
-Written by Limor Fried/Ladyada for Adafruit Industries.
-BSD license, check license.txt for more information
-All text above, and the splash screen must be included in any redistribution
-*********************************************************************/
-
-#include
-#include
-#include
-#include
-
-#define OLED_RESET 4
-Adafruit_SSD1306 display(OLED_RESET);
-
-#define NUMFLAKES 10
-#define XPOS 0
-#define YPOS 1
-#define DELTAY 2
-
-
-#define LOGO16_GLCD_HEIGHT 16
-#define LOGO16_GLCD_WIDTH 16
-static const unsigned char PROGMEM logo16_glcd_bmp[] =
-{ B00000000, B11000000,
- B00000001, B11000000,
- B00000001, B11000000,
- B00000011, B11100000,
- B11110011, B11100000,
- B11111110, B11111000,
- B01111110, B11111111,
- B00110011, B10011111,
- B00011111, B11111100,
- B00001101, B01110000,
- B00011011, B10100000,
- B00111111, B11100000,
- B00111111, B11110000,
- B01111100, B11110000,
- B01110000, B01110000,
- B00000000, B00110000 };
-
-#if (SSD1306_LCDHEIGHT != 64)
-#error("Height incorrect, please fix Adafruit_SSD1306.h!");
-#endif
-
-void setup() {
- Serial.begin(9600);
-
- // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
- display.begin(SSD1306_SWITCHCAPVCC, 0x3D); // initialize with the I2C addr 0x3D (for the 128x64)
- // init done
-
- // Show image buffer on the display hardware.
- // Since the buffer is intialized with an Adafruit splashscreen
- // internally, this will display the splashscreen.
- display.display();
- delay(2000);
-
- // Clear the buffer.
- display.clearDisplay();
-
- // draw a single pixel
- display.drawPixel(10, 10, WHITE);
- // Show the display buffer on the hardware.
- // NOTE: You _must_ call display after making any drawing commands
- // to make them visible on the display hardware!
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw many lines
- testdrawline();
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw rectangles
- testdrawrect();
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw multiple rectangles
- testfillrect();
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw mulitple circles
- testdrawcircle();
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw a white circle, 10 pixel radius
- display.fillCircle(display.width()/2, display.height()/2, 10, WHITE);
- display.display();
- delay(2000);
- display.clearDisplay();
-
- testdrawroundrect();
- delay(2000);
- display.clearDisplay();
-
- testfillroundrect();
- delay(2000);
- display.clearDisplay();
-
- testdrawtriangle();
- delay(2000);
- display.clearDisplay();
-
- testfilltriangle();
- delay(2000);
- display.clearDisplay();
-
- // draw the first ~12 characters in the font
- testdrawchar();
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw scrolling text
- testscrolltext();
- delay(2000);
- display.clearDisplay();
-
- // text display tests
- display.setTextSize(1);
- display.setTextColor(WHITE);
- display.setCursor(0,0);
- display.println("Hello, world!");
- display.setTextColor(BLACK, WHITE); // 'inverted' text
- display.println(3.141592);
- display.setTextSize(2);
- display.setTextColor(WHITE);
- display.print("0x"); display.println(0xDEADBEEF, HEX);
- display.display();
- delay(2000);
-
- // miniature bitmap display
- display.clearDisplay();
- display.drawBitmap(30, 16, logo16_glcd_bmp, 16, 16, 1);
- display.display();
-
- // invert the display
- display.invertDisplay(true);
- delay(1000);
- display.invertDisplay(false);
- delay(1000);
-
- // draw a bitmap icon and 'animate' movement
- testdrawbitmap(logo16_glcd_bmp, LOGO16_GLCD_HEIGHT, LOGO16_GLCD_WIDTH);
-}
-
-
-void loop() {
-
-}
-
-
-void testdrawbitmap(const uint8_t *bitmap, uint8_t w, uint8_t h) {
- uint8_t icons[NUMFLAKES][3];
-
- // initialize
- for (uint8_t f=0; f< NUMFLAKES; f++) {
- icons[f][XPOS] = random(display.width());
- icons[f][YPOS] = 0;
- icons[f][DELTAY] = random(5) + 1;
-
- Serial.print("x: ");
- Serial.print(icons[f][XPOS], DEC);
- Serial.print(" y: ");
- Serial.print(icons[f][YPOS], DEC);
- Serial.print(" dy: ");
- Serial.println(icons[f][DELTAY], DEC);
- }
-
- while (1) {
- // draw each icon
- for (uint8_t f=0; f< NUMFLAKES; f++) {
- display.drawBitmap(icons[f][XPOS], icons[f][YPOS], logo16_glcd_bmp, w, h, WHITE);
- }
- display.display();
- delay(200);
-
- // then erase it + move it
- for (uint8_t f=0; f< NUMFLAKES; f++) {
- display.drawBitmap(icons[f][XPOS], icons[f][YPOS], logo16_glcd_bmp, w, h, BLACK);
- // move it
- icons[f][YPOS] += icons[f][DELTAY];
- // if its gone, reinit
- if (icons[f][YPOS] > display.height()) {
- icons[f][XPOS] = random(display.width());
- icons[f][YPOS] = 0;
- icons[f][DELTAY] = random(5) + 1;
- }
- }
- }
-}
-
-
-void testdrawchar(void) {
- display.setTextSize(1);
- display.setTextColor(WHITE);
- display.setCursor(0,0);
-
- for (uint8_t i=0; i < 168; i++) {
- if (i == '\n') continue;
- display.write(i);
- if ((i > 0) && (i % 21 == 0))
- display.println();
- }
- display.display();
-}
-
-void testdrawcircle(void) {
- for (int16_t i=0; i0; i-=5) {
- display.fillTriangle(display.width()/2, display.height()/2-i,
- display.width()/2-i, display.height()/2+i,
- display.width()/2+i, display.height()/2+i, WHITE);
- if (color == WHITE) color = BLACK;
- else color = WHITE;
- display.display();
- }
-}
-
-void testdrawroundrect(void) {
- for (int16_t i=0; i=0; i-=4) {
- display.drawLine(0, display.height()-1, display.width()-1, i, WHITE);
- display.display();
- }
- delay(250);
-
- display.clearDisplay();
- for (int16_t i=display.width()-1; i>=0; i-=4) {
- display.drawLine(display.width()-1, display.height()-1, i, 0, WHITE);
- display.display();
- }
- for (int16_t i=display.height()-1; i>=0; i-=4) {
- display.drawLine(display.width()-1, display.height()-1, 0, i, WHITE);
- display.display();
- }
- delay(250);
-
- display.clearDisplay();
- for (int16_t i=0; i http://www.adafruit.com/category/63_98
-
-This example is for a 128x64 size display using SPI to communicate
-4 or 5 pins are required to interface
-
-Adafruit invests time and resources providing this open source code,
-please support Adafruit and open-source hardware by purchasing
-products from Adafruit!
-
-Written by Limor Fried/Ladyada for Adafruit Industries.
-BSD license, check license.txt for more information
-All text above, and the splash screen must be included in any redistribution
-*********************************************************************/
-
-#include
-#include
-#include
-#include
-
-// If using software SPI (the default case):
-#define OLED_MOSI 9
-#define OLED_CLK 10
-#define OLED_DC 11
-#define OLED_CS 12
-#define OLED_RESET 13
-Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);
-
-/* Uncomment this block to use hardware SPI
-#define OLED_DC 6
-#define OLED_CS 7
-#define OLED_RESET 8
-Adafruit_SSD1306 display(OLED_DC, OLED_RESET, OLED_CS);
-*/
-
-#define NUMFLAKES 10
-#define XPOS 0
-#define YPOS 1
-#define DELTAY 2
-
-#define LOGO16_GLCD_HEIGHT 16
-#define LOGO16_GLCD_WIDTH 16
-static const unsigned char PROGMEM logo16_glcd_bmp[] =
-{ B00000000, B11000000,
- B00000001, B11000000,
- B00000001, B11000000,
- B00000011, B11100000,
- B11110011, B11100000,
- B11111110, B11111000,
- B01111110, B11111111,
- B00110011, B10011111,
- B00011111, B11111100,
- B00001101, B01110000,
- B00011011, B10100000,
- B00111111, B11100000,
- B00111111, B11110000,
- B01111100, B11110000,
- B01110000, B01110000,
- B00000000, B00110000 };
-
-#if (SSD1306_LCDHEIGHT != 64)
-#error("Height incorrect, please fix Adafruit_SSD1306.h!");
-#endif
-
-void setup() {
- Serial.begin(9600);
-
- // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
- display.begin(SSD1306_SWITCHCAPVCC);
- // init done
-
- // Show image buffer on the display hardware.
- // Since the buffer is intialized with an Adafruit splashscreen
- // internally, this will display the splashscreen.
- display.display();
- delay(2000);
-
- // Clear the buffer.
- display.clearDisplay();
-
- // draw a single pixel
- display.drawPixel(10, 10, WHITE);
- // Show the display buffer on the hardware.
- // NOTE: You _must_ call display after making any drawing commands
- // to make them visible on the display hardware!
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw many lines
- testdrawline();
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw rectangles
- testdrawrect();
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw multiple rectangles
- testfillrect();
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw mulitple circles
- testdrawcircle();
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw a white circle, 10 pixel radius
- display.fillCircle(display.width()/2, display.height()/2, 10, WHITE);
- display.display();
- delay(2000);
- display.clearDisplay();
-
- testdrawroundrect();
- delay(2000);
- display.clearDisplay();
-
- testfillroundrect();
- delay(2000);
- display.clearDisplay();
-
- testdrawtriangle();
- delay(2000);
- display.clearDisplay();
-
- testfilltriangle();
- delay(2000);
- display.clearDisplay();
-
- // draw the first ~12 characters in the font
- testdrawchar();
- display.display();
- delay(2000);
- display.clearDisplay();
-
- // draw scrolling text
- testscrolltext();
- delay(2000);
- display.clearDisplay();
-
- // text display tests
- display.setTextSize(1);
- display.setTextColor(WHITE);
- display.setCursor(0,0);
- display.println("Hello, world!");
- display.setTextColor(BLACK, WHITE); // 'inverted' text
- display.println(3.141592);
- display.setTextSize(2);
- display.setTextColor(WHITE);
- display.print("0x"); display.println(0xDEADBEEF, HEX);
- display.display();
- delay(2000);
-
- // miniature bitmap display
- display.clearDisplay();
- display.drawBitmap(30, 16, logo16_glcd_bmp, 16, 16, 1);
- display.display();
-
- // invert the display
- display.invertDisplay(true);
- delay(1000);
- display.invertDisplay(false);
- delay(1000);
-
- // draw a bitmap icon and 'animate' movement
- testdrawbitmap(logo16_glcd_bmp, LOGO16_GLCD_HEIGHT, LOGO16_GLCD_WIDTH);
-}
-
-
-void loop() {
-
-}
-
-
-void testdrawbitmap(const uint8_t *bitmap, uint8_t w, uint8_t h) {
- uint8_t icons[NUMFLAKES][3];
-
- // initialize
- for (uint8_t f=0; f< NUMFLAKES; f++) {
- icons[f][XPOS] = random(display.width());
- icons[f][YPOS] = 0;
- icons[f][DELTAY] = random(5) + 1;
-
- Serial.print("x: ");
- Serial.print(icons[f][XPOS], DEC);
- Serial.print(" y: ");
- Serial.print(icons[f][YPOS], DEC);
- Serial.print(" dy: ");
- Serial.println(icons[f][DELTAY], DEC);
- }
-
- while (1) {
- // draw each icon
- for (uint8_t f=0; f< NUMFLAKES; f++) {
- display.drawBitmap(icons[f][XPOS], icons[f][YPOS], logo16_glcd_bmp, w, h, WHITE);
- }
- display.display();
- delay(200);
-
- // then erase it + move it
- for (uint8_t f=0; f< NUMFLAKES; f++) {
- display.drawBitmap(icons[f][XPOS], icons[f][YPOS], logo16_glcd_bmp, w, h, BLACK);
- // move it
- icons[f][YPOS] += icons[f][DELTAY];
- // if its gone, reinit
- if (icons[f][YPOS] > display.height()) {
- icons[f][XPOS] = random(display.width());
- icons[f][YPOS] = 0;
- icons[f][DELTAY] = random(5) + 1;
- }
- }
- }
-}
-
-
-void testdrawchar(void) {
- display.setTextSize(1);
- display.setTextColor(WHITE);
- display.setCursor(0,0);
-
- for (uint8_t i=0; i < 168; i++) {
- if (i == '\n') continue;
- display.write(i);
- if ((i > 0) && (i % 21 == 0))
- display.println();
- }
- display.display();
-}
-
-void testdrawcircle(void) {
- for (int16_t i=0; i0; i-=5) {
- display.fillTriangle(display.width()/2, display.height()/2-i,
- display.width()/2-i, display.height()/2+i,
- display.width()/2+i, display.height()/2+i, WHITE);
- if (color == WHITE) color = BLACK;
- else color = WHITE;
- display.display();
- }
-}
-
-void testdrawroundrect(void) {
- for (int16_t i=0; i=0; i-=4) {
- display.drawLine(0, display.height()-1, display.width()-1, i, WHITE);
- display.display();
- }
- delay(250);
-
- display.clearDisplay();
- for (int16_t i=display.width()-1; i>=0; i-=4) {
- display.drawLine(display.width()-1, display.height()-1, i, 0, WHITE);
- display.display();
- }
- for (int16_t i=display.height()-1; i>=0; i-=4) {
- display.drawLine(display.width()-1, display.height()-1, 0, i, WHITE);
- display.display();
- }
- delay(250);
-
- display.clearDisplay();
- for (int16_t i=0; i http://www.adafruit.com/products/358
-The 1.8" TFT shield
- ----> https://www.adafruit.com/product/802
-The 1.44" TFT breakout
- ----> https://www.adafruit.com/product/2088
-as well as Adafruit raw 1.8" TFT display
- ----> http://www.adafruit.com/products/618
-
- Check out the links above for our tutorials and wiring diagrams
- These displays use SPI to communicate, 4 or 5 pins are required to
- interface (RST is optional)
- Adafruit invests time and resources providing this open source code,
- please support Adafruit and open-source hardware by purchasing
- products from Adafruit!
-
- Written by Limor Fried/Ladyada for Adafruit Industries.
- MIT license, all text above must be included in any redistribution
- ****************************************************/
-
-#include "Adafruit_ST7735.h"
-#include
-#include "pins_arduino.h"
-#include "wiring_private.h"
-#include
-
-
-inline uint16_t swapcolor(uint16_t x) {
- return (x << 11) | (x & 0x07E0) | (x >> 11);
-}
-
-#if defined (SPI_HAS_TRANSACTION)
- static SPISettings mySPISettings;
-#elif defined (__AVR__)
- static uint8_t SPCRbackup;
- static uint8_t mySPCR;
-#endif
-
-
-
-// Constructor when using software SPI. All output pins are configurable.
-Adafruit_ST7735::Adafruit_ST7735(int8_t cs, int8_t rs, int8_t sid, int8_t sclk, int8_t rst)
- : Adafruit_GFX(ST7735_TFTWIDTH, ST7735_TFTHEIGHT_18)
-{
- _cs = cs;
- _rs = rs;
- _sid = sid;
- _sclk = sclk;
- _rst = rst;
- hwSPI = false;
-}
-
-
-// Constructor when using hardware SPI. Faster, but must use SPI pins
-// specific to each board type (e.g. 11,13 for Uno, 51,52 for Mega, etc.)
-Adafruit_ST7735::Adafruit_ST7735(int8_t cs, int8_t rs, int8_t rst)
- : Adafruit_GFX(ST7735_TFTWIDTH, ST7735_TFTHEIGHT_18) {
- _cs = cs;
- _rs = rs;
- _rst = rst;
- hwSPI = true;
- _sid = _sclk = 0;
-}
-
-#if defined(CORE_TEENSY) && !defined(__AVR__)
-#define __AVR__
-#endif
-
-inline void Adafruit_ST7735::spiwrite(uint8_t c) {
-
- //Serial.println(c, HEX);
-
- if (hwSPI) {
-#if defined (SPI_HAS_TRANSACTION)
- SPI.transfer(c);
-#elif defined (__AVR__)
- SPCRbackup = SPCR;
- SPCR = mySPCR;
- SPI.transfer(c);
- SPCR = SPCRbackup;
-// SPDR = c;
-// while(!(SPSR & _BV(SPIF)));
-#elif defined (__arm__)
- SPI.setClockDivider(21); //4MHz
- SPI.setDataMode(SPI_MODE0);
- SPI.transfer(c);
-#elif defined (__ESP8266_EX__)
- SPI.transfer(c);
-#endif
- } else {
- // Fast SPI bitbang swiped from LPD8806 library
- for(uint8_t bit = 0x80; bit; bit >>= 1) {
- if(c & bit) *dataport |= datapinmask;
- else *dataport &= ~datapinmask;
- *clkport |= clkpinmask;
- *clkport &= ~clkpinmask;
- }
- }
-}
-
-
-void Adafruit_ST7735::writecommand(uint8_t c) {
-#if defined (SPI_HAS_TRANSACTION)
- SPI.beginTransaction(mySPISettings);
-#endif
- *rsport &= ~rspinmask;
- *csport &= ~cspinmask;
-
- //Serial.print("C ");
- spiwrite(c);
-
- *csport |= cspinmask;
-#if defined (SPI_HAS_TRANSACTION)
- SPI.endTransaction();
-#endif
-}
-
-
-void Adafruit_ST7735::writedata(uint8_t c) {
-#if defined (SPI_HAS_TRANSACTION)
- SPI.beginTransaction(mySPISettings);
-#endif
- *rsport |= rspinmask;
- *csport &= ~cspinmask;
-
- //Serial.print("D ");
- spiwrite(c);
-
- *csport |= cspinmask;
-#if defined (SPI_HAS_TRANSACTION)
- SPI.endTransaction();
-#endif
-}
-
-// Rather than a bazillion writecommand() and writedata() calls, screen
-// initialization commands and arguments are organized in these tables
-// stored in PROGMEM. The table may look bulky, but that's mostly the
-// formatting -- storage-wise this is hundreds of bytes more compact
-// than the equivalent code. Companion function follows.
-#define DELAY 0x80
-static const uint8_t PROGMEM
- Bcmd[] = { // Initialization commands for 7735B screens
- 18, // 18 commands in list:
- ST7735_SWRESET, DELAY, // 1: Software reset, no args, w/delay
- 50, // 50 ms delay
- ST7735_SLPOUT , DELAY, // 2: Out of sleep mode, no args, w/delay
- 255, // 255 = 500 ms delay
- ST7735_COLMOD , 1+DELAY, // 3: Set color mode, 1 arg + delay:
- 0x05, // 16-bit color
- 10, // 10 ms delay
- ST7735_FRMCTR1, 3+DELAY, // 4: Frame rate control, 3 args + delay:
- 0x00, // fastest refresh
- 0x06, // 6 lines front porch
- 0x03, // 3 lines back porch
- 10, // 10 ms delay
- ST7735_MADCTL , 1 , // 5: Memory access ctrl (directions), 1 arg:
- 0x08, // Row addr/col addr, bottom to top refresh
- ST7735_DISSET5, 2 , // 6: Display settings #5, 2 args, no delay:
- 0x15, // 1 clk cycle nonoverlap, 2 cycle gate
- // rise, 3 cycle osc equalize
- 0x02, // Fix on VTL
- ST7735_INVCTR , 1 , // 7: Display inversion control, 1 arg:
- 0x0, // Line inversion
- ST7735_PWCTR1 , 2+DELAY, // 8: Power control, 2 args + delay:
- 0x02, // GVDD = 4.7V
- 0x70, // 1.0uA
- 10, // 10 ms delay
- ST7735_PWCTR2 , 1 , // 9: Power control, 1 arg, no delay:
- 0x05, // VGH = 14.7V, VGL = -7.35V
- ST7735_PWCTR3 , 2 , // 10: Power control, 2 args, no delay:
- 0x01, // Opamp current small
- 0x02, // Boost frequency
- ST7735_VMCTR1 , 2+DELAY, // 11: Power control, 2 args + delay:
- 0x3C, // VCOMH = 4V
- 0x38, // VCOML = -1.1V
- 10, // 10 ms delay
- ST7735_PWCTR6 , 2 , // 12: Power control, 2 args, no delay:
- 0x11, 0x15,
- ST7735_GMCTRP1,16 , // 13: Magical unicorn dust, 16 args, no delay:
- 0x09, 0x16, 0x09, 0x20, // (seriously though, not sure what
- 0x21, 0x1B, 0x13, 0x19, // these config values represent)
- 0x17, 0x15, 0x1E, 0x2B,
- 0x04, 0x05, 0x02, 0x0E,
- ST7735_GMCTRN1,16+DELAY, // 14: Sparkles and rainbows, 16 args + delay:
- 0x0B, 0x14, 0x08, 0x1E, // (ditto)
- 0x22, 0x1D, 0x18, 0x1E,
- 0x1B, 0x1A, 0x24, 0x2B,
- 0x06, 0x06, 0x02, 0x0F,
- 10, // 10 ms delay
- ST7735_CASET , 4 , // 15: Column addr set, 4 args, no delay:
- 0x00, 0x02, // XSTART = 2
- 0x00, 0x81, // XEND = 129
- ST7735_RASET , 4 , // 16: Row addr set, 4 args, no delay:
- 0x00, 0x02, // XSTART = 1
- 0x00, 0x81, // XEND = 160
- ST7735_NORON , DELAY, // 17: Normal display on, no args, w/delay
- 10, // 10 ms delay
- ST7735_DISPON , DELAY, // 18: Main screen turn on, no args, w/delay
- 255 }, // 255 = 500 ms delay
-
- Rcmd1[] = { // Init for 7735R, part 1 (red or green tab)
- 15, // 15 commands in list:
- ST7735_SWRESET, DELAY, // 1: Software reset, 0 args, w/delay
- 150, // 150 ms delay
- ST7735_SLPOUT , DELAY, // 2: Out of sleep mode, 0 args, w/delay
- 255, // 500 ms delay
- ST7735_FRMCTR1, 3 , // 3: Frame rate ctrl - normal mode, 3 args:
- 0x01, 0x2C, 0x2D, // Rate = fosc/(1x2+40) * (LINE+2C+2D)
- ST7735_FRMCTR2, 3 , // 4: Frame rate control - idle mode, 3 args:
- 0x01, 0x2C, 0x2D, // Rate = fosc/(1x2+40) * (LINE+2C+2D)
- ST7735_FRMCTR3, 6 , // 5: Frame rate ctrl - partial mode, 6 args:
- 0x01, 0x2C, 0x2D, // Dot inversion mode
- 0x01, 0x2C, 0x2D, // Line inversion mode
- ST7735_INVCTR , 1 , // 6: Display inversion ctrl, 1 arg, no delay:
- 0x07, // No inversion
- ST7735_PWCTR1 , 3 , // 7: Power control, 3 args, no delay:
- 0xA2,
- 0x02, // -4.6V
- 0x84, // AUTO mode
- ST7735_PWCTR2 , 1 , // 8: Power control, 1 arg, no delay:
- 0xC5, // VGH25 = 2.4C VGSEL = -10 VGH = 3 * AVDD
- ST7735_PWCTR3 , 2 , // 9: Power control, 2 args, no delay:
- 0x0A, // Opamp current small
- 0x00, // Boost frequency
- ST7735_PWCTR4 , 2 , // 10: Power control, 2 args, no delay:
- 0x8A, // BCLK/2, Opamp current small & Medium low
- 0x2A,
- ST7735_PWCTR5 , 2 , // 11: Power control, 2 args, no delay:
- 0x8A, 0xEE,
- ST7735_VMCTR1 , 1 , // 12: Power control, 1 arg, no delay:
- 0x0E,
- ST7735_INVOFF , 0 , // 13: Don't invert display, no args, no delay
- ST7735_MADCTL , 1 , // 14: Memory access control (directions), 1 arg:
- 0xC8, // row addr/col addr, bottom to top refresh
- ST7735_COLMOD , 1 , // 15: set color mode, 1 arg, no delay:
- 0x05 }, // 16-bit color
-
- Rcmd2green[] = { // Init for 7735R, part 2 (green tab only)
- 2, // 2 commands in list:
- ST7735_CASET , 4 , // 1: Column addr set, 4 args, no delay:
- 0x00, 0x02, // XSTART = 0
- 0x00, 0x7F+0x02, // XEND = 127
- ST7735_RASET , 4 , // 2: Row addr set, 4 args, no delay:
- 0x00, 0x01, // XSTART = 0
- 0x00, 0x9F+0x01 }, // XEND = 159
- Rcmd2red[] = { // Init for 7735R, part 2 (red tab only)
- 2, // 2 commands in list:
- ST7735_CASET , 4 , // 1: Column addr set, 4 args, no delay:
- 0x00, 0x00, // XSTART = 0
- 0x00, 0x7F, // XEND = 127
- ST7735_RASET , 4 , // 2: Row addr set, 4 args, no delay:
- 0x00, 0x00, // XSTART = 0
- 0x00, 0x9F }, // XEND = 159
-
- Rcmd2green144[] = { // Init for 7735R, part 2 (green 1.44 tab)
- 2, // 2 commands in list:
- ST7735_CASET , 4 , // 1: Column addr set, 4 args, no delay:
- 0x00, 0x00, // XSTART = 0
- 0x00, 0x7F, // XEND = 127
- ST7735_RASET , 4 , // 2: Row addr set, 4 args, no delay:
- 0x00, 0x00, // XSTART = 0
- 0x00, 0x7F }, // XEND = 127
-
- Rcmd3[] = { // Init for 7735R, part 3 (red or green tab)
- 4, // 4 commands in list:
- ST7735_GMCTRP1, 16 , // 1: Magical unicorn dust, 16 args, no delay:
- 0x02, 0x1c, 0x07, 0x12,
- 0x37, 0x32, 0x29, 0x2d,
- 0x29, 0x25, 0x2B, 0x39,
- 0x00, 0x01, 0x03, 0x10,
- ST7735_GMCTRN1, 16 , // 2: Sparkles and rainbows, 16 args, no delay:
- 0x03, 0x1d, 0x07, 0x06,
- 0x2E, 0x2C, 0x29, 0x2D,
- 0x2E, 0x2E, 0x37, 0x3F,
- 0x00, 0x00, 0x02, 0x10,
- ST7735_NORON , DELAY, // 3: Normal display on, no args, w/delay
- 10, // 10 ms delay
- ST7735_DISPON , DELAY, // 4: Main screen turn on, no args w/delay
- 100 }; // 100 ms delay
-
-
-// Companion code to the above tables. Reads and issues
-// a series of LCD commands stored in PROGMEM byte array.
-void Adafruit_ST7735::commandList(const uint8_t *addr) {
-
- uint8_t numCommands, numArgs;
- uint16_t ms;
-
- numCommands = pgm_read_byte(addr++); // Number of commands to follow
- while(numCommands--) { // For each command...
- writecommand(pgm_read_byte(addr++)); // Read, issue command
- numArgs = pgm_read_byte(addr++); // Number of args to follow
- ms = numArgs & DELAY; // If hibit set, delay follows args
- numArgs &= ~DELAY; // Mask out delay bit
- while(numArgs--) { // For each argument...
- writedata(pgm_read_byte(addr++)); // Read, issue argument
- }
-
- if(ms) {
- ms = pgm_read_byte(addr++); // Read post-command delay time (ms)
- if(ms == 255) ms = 500; // If 255, delay for 500 ms
- delay(ms);
- }
- }
-}
-
-
-// Initialization code common to both 'B' and 'R' type displays
-void Adafruit_ST7735::commonInit(const uint8_t *cmdList) {
- colstart = rowstart = 0; // May be overridden in init func
-
- pinMode(_rs, OUTPUT);
- pinMode(_cs, OUTPUT);
- csport = portOutputRegister(digitalPinToPort(_cs));
- rsport = portOutputRegister(digitalPinToPort(_rs));
- cspinmask = digitalPinToBitMask(_cs);
- rspinmask = digitalPinToBitMask(_rs);
-
- if(hwSPI) { // Using hardware SPI
-#if defined (SPI_HAS_TRANSACTION)
- SPI.begin();
- mySPISettings = SPISettings(10000000, MSBFIRST, SPI_MODE0);
-#elif defined (__AVR__)
- SPCRbackup = SPCR;
- SPI.begin();
- SPI.setClockDivider(SPI_CLOCK_DIV4);
- SPI.setDataMode(SPI_MODE0);
- mySPCR = SPCR; // save our preferred state
- //Serial.print("mySPCR = 0x"); Serial.println(SPCR, HEX);
- SPCR = SPCRbackup; // then restore
-#elif defined (__SAM3X8E__)
- SPI.begin();
- SPI.setClockDivider(21); //4MHz
- SPI.setDataMode(SPI_MODE0);
-#elif defined (__ESP8266_EX__)
- SPI.begin();
-
-#endif
- } else {
- pinMode(_sclk, OUTPUT);
- pinMode(_sid , OUTPUT);
- clkport = portOutputRegister(digitalPinToPort(_sclk));
- dataport = portOutputRegister(digitalPinToPort(_sid));
- clkpinmask = digitalPinToBitMask(_sclk);
- datapinmask = digitalPinToBitMask(_sid);
- *clkport &= ~clkpinmask;
- *dataport &= ~datapinmask;
- }
-
- // toggle RST low to reset; CS low so it'll listen to us
- *csport &= ~cspinmask;
- if (_rst) {
- pinMode(_rst, OUTPUT);
- digitalWrite(_rst, HIGH);
- delay(500);
- digitalWrite(_rst, LOW);
- delay(500);
- digitalWrite(_rst, HIGH);
- delay(500);
- }
-
- if(cmdList) commandList(cmdList);
-}
-
-
-// Initialization for ST7735B screens
-void Adafruit_ST7735::initB(void) {
- commonInit(Bcmd);
-}
-
-
-// Initialization for ST7735R screens (green or red tabs)
-void Adafruit_ST7735::initR(uint8_t options) {
- commonInit(Rcmd1);
- if(options == INITR_GREENTAB) {
- commandList(Rcmd2green);
- colstart = 2;
- rowstart = 1;
- } else if(options == INITR_144GREENTAB) {
- _height = ST7735_TFTHEIGHT_144;
- commandList(Rcmd2green144);
- colstart = 2;
- rowstart = 3;
- } else {
- // colstart, rowstart left at default '0' values
- commandList(Rcmd2red);
- }
- commandList(Rcmd3);
-
- // if black, change MADCTL color filter
- if (options == INITR_BLACKTAB) {
- writecommand(ST7735_MADCTL);
- writedata(0xC0);
- }
-
- tabcolor = options;
-}
-
-
-void Adafruit_ST7735::setAddrWindow(uint8_t x0, uint8_t y0, uint8_t x1,
- uint8_t y1) {
-
- writecommand(ST7735_CASET); // Column addr set
- writedata(0x00);
- writedata(x0+colstart); // XSTART
- writedata(0x00);
- writedata(x1+colstart); // XEND
-
- writecommand(ST7735_RASET); // Row addr set
- writedata(0x00);
- writedata(y0+rowstart); // YSTART
- writedata(0x00);
- writedata(y1+rowstart); // YEND
-
- writecommand(ST7735_RAMWR); // write to RAM
-}
-
-
-void Adafruit_ST7735::pushColor(uint16_t color) {
-#if defined (SPI_HAS_TRANSACTION)
- SPI.beginTransaction(mySPISettings);
-#endif
- *rsport |= rspinmask;
- *csport &= ~cspinmask;
-
- spiwrite(color >> 8);
- spiwrite(color);
-
- *csport |= cspinmask;
-#if defined (SPI_HAS_TRANSACTION)
- SPI.endTransaction();
-#endif
-}
-
-void Adafruit_ST7735::drawPixel(int16_t x, int16_t y, uint16_t color) {
-
- if((x < 0) ||(x >= _width) || (y < 0) || (y >= _height)) return;
-
- setAddrWindow(x,y,x+1,y+1);
-
-#if defined (SPI_HAS_TRANSACTION)
- SPI.beginTransaction(mySPISettings);
-#endif
- *rsport |= rspinmask;
- *csport &= ~cspinmask;
-
- spiwrite(color >> 8);
- spiwrite(color);
-
- *csport |= cspinmask;
-#if defined (SPI_HAS_TRANSACTION)
- SPI.endTransaction();
-#endif
-}
-
-
-void Adafruit_ST7735::drawFastVLine(int16_t x, int16_t y, int16_t h,
- uint16_t color) {
-
- // Rudimentary clipping
- if((x >= _width) || (y >= _height)) return;
- if((y+h-1) >= _height) h = _height-y;
- setAddrWindow(x, y, x, y+h-1);
-
- uint8_t hi = color >> 8, lo = color;
-
-#if defined (SPI_HAS_TRANSACTION)
- SPI.beginTransaction(mySPISettings);
-#endif
- *rsport |= rspinmask;
- *csport &= ~cspinmask;
- while (h--) {
- spiwrite(hi);
- spiwrite(lo);
- }
- *csport |= cspinmask;
-#if defined (SPI_HAS_TRANSACTION)
- SPI.endTransaction();
-#endif
-}
-
-
-void Adafruit_ST7735::drawFastHLine(int16_t x, int16_t y, int16_t w,
- uint16_t color) {
-
- // Rudimentary clipping
- if((x >= _width) || (y >= _height)) return;
- if((x+w-1) >= _width) w = _width-x;
- setAddrWindow(x, y, x+w-1, y);
-
- uint8_t hi = color >> 8, lo = color;
-
-#if defined (SPI_HAS_TRANSACTION)
- SPI.beginTransaction(mySPISettings);
-#endif
- *rsport |= rspinmask;
- *csport &= ~cspinmask;
- while (w--) {
- spiwrite(hi);
- spiwrite(lo);
- }
- *csport |= cspinmask;
-#if defined (SPI_HAS_TRANSACTION)
- SPI.endTransaction();
-#endif
-}
-
-
-
-void Adafruit_ST7735::fillScreen(uint16_t color) {
- fillRect(0, 0, _width, _height, color);
-}
-
-
-
-// fill a rectangle
-void Adafruit_ST7735::fillRect(int16_t x, int16_t y, int16_t w, int16_t h,
- uint16_t color) {
-
- // rudimentary clipping (drawChar w/big text requires this)
- if((x >= _width) || (y >= _height)) return;
- if((x + w - 1) >= _width) w = _width - x;
- if((y + h - 1) >= _height) h = _height - y;
-
- setAddrWindow(x, y, x+w-1, y+h-1);
-
- uint8_t hi = color >> 8, lo = color;
-
-#if defined (SPI_HAS_TRANSACTION)
- SPI.beginTransaction(mySPISettings);
-#endif
- *rsport |= rspinmask;
- *csport &= ~cspinmask;
- for(y=h; y>0; y--) {
- for(x=w; x>0; x--) {
- spiwrite(hi);
- spiwrite(lo);
- }
- }
-
- *csport |= cspinmask;
-#if defined (SPI_HAS_TRANSACTION)
- SPI.endTransaction();
-#endif
-}
-
-
-// Pass 8-bit (each) R,G,B, get back 16-bit packed color
-uint16_t Adafruit_ST7735::Color565(uint8_t r, uint8_t g, uint8_t b) {
- return ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3);
-}
-
-
-#define MADCTL_MY 0x80
-#define MADCTL_MX 0x40
-#define MADCTL_MV 0x20
-#define MADCTL_ML 0x10
-#define MADCTL_RGB 0x00
-#define MADCTL_BGR 0x08
-#define MADCTL_MH 0x04
-
-void Adafruit_ST7735::setRotation(uint8_t m) {
-
- writecommand(ST7735_MADCTL);
- rotation = m % 4; // can't be higher than 3
- switch (rotation) {
- case 0:
- if (tabcolor == INITR_BLACKTAB) {
- writedata(MADCTL_MX | MADCTL_MY | MADCTL_RGB);
- } else {
- writedata(MADCTL_MX | MADCTL_MY | MADCTL_BGR);
- }
- _width = ST7735_TFTWIDTH;
-
- if (tabcolor == INITR_144GREENTAB)
- _height = ST7735_TFTHEIGHT_144;
- else
- _height = ST7735_TFTHEIGHT_18;
-
- break;
- case 1:
- if (tabcolor == INITR_BLACKTAB) {
- writedata(MADCTL_MY | MADCTL_MV | MADCTL_RGB);
- } else {
- writedata(MADCTL_MY | MADCTL_MV | MADCTL_BGR);
- }
-
- if (tabcolor == INITR_144GREENTAB)
- _width = ST7735_TFTHEIGHT_144;
- else
- _width = ST7735_TFTHEIGHT_18;
-
- _height = ST7735_TFTWIDTH;
- break;
- case 2:
- if (tabcolor == INITR_BLACKTAB) {
- writedata(MADCTL_RGB);
- } else {
- writedata(MADCTL_BGR);
- }
- _width = ST7735_TFTWIDTH;
- if (tabcolor == INITR_144GREENTAB)
- _height = ST7735_TFTHEIGHT_144;
- else
- _height = ST7735_TFTHEIGHT_18;
-
- break;
- case 3:
- if (tabcolor == INITR_BLACKTAB) {
- writedata(MADCTL_MX | MADCTL_MV | MADCTL_RGB);
- } else {
- writedata(MADCTL_MX | MADCTL_MV | MADCTL_BGR);
- }
- if (tabcolor == INITR_144GREENTAB)
- _width = ST7735_TFTHEIGHT_144;
- else
- _width = ST7735_TFTHEIGHT_18;
-
- _height = ST7735_TFTWIDTH;
- break;
- }
-}
-
-
-void Adafruit_ST7735::invertDisplay(boolean i) {
- writecommand(i ? ST7735_INVON : ST7735_INVOFF);
-}
-
-
-////////// stuff not actively being used, but kept for posterity
-/*
-
- uint8_t Adafruit_ST7735::spiread(void) {
- uint8_t r = 0;
- if (_sid > 0) {
- r = shiftIn(_sid, _sclk, MSBFIRST);
- } else {
- //SID_DDR &= ~_BV(SID);
- //int8_t i;
- //for (i=7; i>=0; i--) {
- // SCLK_PORT &= ~_BV(SCLK);
- // r <<= 1;
- // r |= (SID_PIN >> SID) & 0x1;
- // SCLK_PORT |= _BV(SCLK);
- //}
- //SID_DDR |= _BV(SID);
-
- }
- return r;
- }
-
-
- void Adafruit_ST7735::dummyclock(void) {
-
- if (_sid > 0) {
- digitalWrite(_sclk, LOW);
- digitalWrite(_sclk, HIGH);
- } else {
- // SCLK_PORT &= ~_BV(SCLK);
- //SCLK_PORT |= _BV(SCLK);
- }
- }
- uint8_t Adafruit_ST7735::readdata(void) {
- *portOutputRegister(rsport) |= rspin;
-
- *portOutputRegister(csport) &= ~ cspin;
-
- uint8_t r = spiread();
-
- *portOutputRegister(csport) |= cspin;
-
- return r;
-
- }
-
- uint8_t Adafruit_ST7735::readcommand8(uint8_t c) {
- digitalWrite(_rs, LOW);
-
- *portOutputRegister(csport) &= ~ cspin;
-
- spiwrite(c);
-
- digitalWrite(_rs, HIGH);
- pinMode(_sid, INPUT); // input!
- digitalWrite(_sid, LOW); // low
- spiread();
- uint8_t r = spiread();
-
-
- *portOutputRegister(csport) |= cspin;
-
-
- pinMode(_sid, OUTPUT); // back to output
- return r;
- }
-
-
- uint16_t Adafruit_ST7735::readcommand16(uint8_t c) {
- digitalWrite(_rs, LOW);
- if (_cs)
- digitalWrite(_cs, LOW);
-
- spiwrite(c);
- pinMode(_sid, INPUT); // input!
- uint16_t r = spiread();
- r <<= 8;
- r |= spiread();
- if (_cs)
- digitalWrite(_cs, HIGH);
-
- pinMode(_sid, OUTPUT); // back to output
- return r;
- }
-
- uint32_t Adafruit_ST7735::readcommand32(uint8_t c) {
- digitalWrite(_rs, LOW);
- if (_cs)
- digitalWrite(_cs, LOW);
- spiwrite(c);
- pinMode(_sid, INPUT); // input!
-
- dummyclock();
- dummyclock();
-
- uint32_t r = spiread();
- r <<= 8;
- r |= spiread();
- r <<= 8;
- r |= spiread();
- r <<= 8;
- r |= spiread();
- if (_cs)
- digitalWrite(_cs, HIGH);
-
- pinMode(_sid, OUTPUT); // back to output
- return r;
- }
-
- */
diff --git a/Sming/Libraries/Adafruit_ST7735/Adafruit_ST7735.h b/Sming/Libraries/Adafruit_ST7735/Adafruit_ST7735.h
deleted file mode 100644
index 10e69a890e..0000000000
--- a/Sming/Libraries/Adafruit_ST7735/Adafruit_ST7735.h
+++ /dev/null
@@ -1,187 +0,0 @@
-/***************************************************
- This is a library for the Adafruit 1.8" SPI display.
-
-This library works with the Adafruit 1.8" TFT Breakout w/SD card
- ----> http://www.adafruit.com/products/358
-The 1.8" TFT shield
- ----> https://www.adafruit.com/product/802
-The 1.44" TFT breakout
- ----> https://www.adafruit.com/product/2088
-as well as Adafruit raw 1.8" TFT display
- ----> http://www.adafruit.com/products/618
-
- Check out the links above for our tutorials and wiring diagrams
- These displays use SPI to communicate, 4 or 5 pins are required to
- interface (RST is optional)
- Adafruit invests time and resources providing this open source code,
- please support Adafruit and open-source hardware by purchasing
- products from Adafruit!
-
- Written by Limor Fried/Ladyada for Adafruit Industries.
- MIT license, all text above must be included in any redistribution
- ****************************************************/
-/********************************
- * ported for Sming by H.Boettcher.
- * hbottc@gmail.com
- ********************************/
-
-#ifndef _ADAFRUIT_ST7735H_
-#define _ADAFRUIT_ST7735H_
-
-#if ARDUINO >= 100
- #include "Arduino.h"
- #include "Print.h"
-#else
- #include "WProgram.h"
-#endif
-
-#include "../Adafruit_GFX/Adafruit_GFX.h"
-
-#if defined(__SAM3X8E__)
- #include
- #define PROGMEM
- #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
- #define pgm_read_word(addr) (*(const unsigned short *)(addr))
- typedef unsigned char prog_uchar;
-#elif defined(__AVR__)
- #include
-#elif defined(ESP8266)
- #include
-#endif
-
-#if defined(__SAM3X8E__)
- #undef __FlashStringHelper::F(string_literal)
- #define F(string_literal) string_literal
-#endif
-
-// some flags for initR() :(
-#define INITR_GREENTAB 0x0
-#define INITR_REDTAB 0x1
-#define INITR_BLACKTAB 0x2
-
-#define INITR_18GREENTAB INITR_GREENTAB
-#define INITR_18REDTAB INITR_REDTAB
-#define INITR_18BLACKTAB INITR_BLACKTAB
-#define INITR_144GREENTAB 0x1
-
-#define ST7735_TFTWIDTH 128
-// for 1.44" display
-#define ST7735_TFTHEIGHT_144 128
-// for 1.8" display
-#define ST7735_TFTHEIGHT_18 160
-
-#define ST7735_NOP 0x00
-#define ST7735_SWRESET 0x01
-#define ST7735_RDDID 0x04
-#define ST7735_RDDST 0x09
-
-#define ST7735_SLPIN 0x10
-#define ST7735_SLPOUT 0x11
-#define ST7735_PTLON 0x12
-#define ST7735_NORON 0x13
-
-#define ST7735_INVOFF 0x20
-#define ST7735_INVON 0x21
-#define ST7735_DISPOFF 0x28
-#define ST7735_DISPON 0x29
-#define ST7735_CASET 0x2A
-#define ST7735_RASET 0x2B
-#define ST7735_RAMWR 0x2C
-#define ST7735_RAMRD 0x2E
-
-#define ST7735_PTLAR 0x30
-#define ST7735_COLMOD 0x3A
-#define ST7735_MADCTL 0x36
-
-#define ST7735_FRMCTR1 0xB1
-#define ST7735_FRMCTR2 0xB2
-#define ST7735_FRMCTR3 0xB3
-#define ST7735_INVCTR 0xB4
-#define ST7735_DISSET5 0xB6
-
-#define ST7735_PWCTR1 0xC0
-#define ST7735_PWCTR2 0xC1
-#define ST7735_PWCTR3 0xC2
-#define ST7735_PWCTR4 0xC3
-#define ST7735_PWCTR5 0xC4
-#define ST7735_VMCTR1 0xC5
-
-#define ST7735_RDID1 0xDA
-#define ST7735_RDID2 0xDB
-#define ST7735_RDID3 0xDC
-#define ST7735_RDID4 0xDD
-
-#define ST7735_PWCTR6 0xFC
-
-#define ST7735_GMCTRP1 0xE0
-#define ST7735_GMCTRN1 0xE1
-
-// Color definitions
-#define ST7735_BLACK 0x0000
-#define ST7735_BLUE 0x001F
-#define ST7735_RED 0xF800
-#define ST7735_GREEN 0x07E0
-#define ST7735_CYAN 0x07FF
-#define ST7735_MAGENTA 0xF81F
-#define ST7735_YELLOW 0xFFE0
-#define ST7735_WHITE 0xFFFF
-
-
-class Adafruit_ST7735 : public Adafruit_GFX {
-
- public:
-
- Adafruit_ST7735(int8_t CS, int8_t RS, int8_t SID, int8_t SCLK, int8_t RST = -1);
- Adafruit_ST7735(int8_t CS, int8_t RS, int8_t RST = -1);
-
- void initB(void), // for ST7735B displays
- initR(uint8_t options = INITR_GREENTAB), // for ST7735R
- setAddrWindow(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1),
- pushColor(uint16_t color),
- fillScreen(uint16_t color),
- drawPixel(int16_t x, int16_t y, uint16_t color),
- drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color),
- drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color),
- fillRect(int16_t x, int16_t y, int16_t w, int16_t h,
- uint16_t color),
- setRotation(uint8_t r),
- invertDisplay(boolean i);
- uint16_t Color565(uint8_t r, uint8_t g, uint8_t b);
-
- /* These are not for current use, 8-bit protocol only!
- uint8_t readdata(void),
- readcommand8(uint8_t);
- uint16_t readcommand16(uint8_t);
- uint32_t readcommand32(uint8_t);
- void dummyclock(void);
- */
-
- private:
- uint8_t tabcolor;
-
- void spiwrite(uint8_t),
- writecommand(uint8_t c),
- writedata(uint8_t d),
- commandList(const uint8_t *addr),
- commonInit(const uint8_t *cmdList);
-//uint8_t spiread(void);
-
- boolean hwSPI;
-
-#if defined(__AVR__) || defined(CORE_TEENSY) || defined (__ESP8266_EX__)
- volatile uint8_t *dataport, *clkport, *csport, *rsport;
- uint8_t _cs, _rs, _rst, _sid, _sclk,
- datapinmask, clkpinmask, cspinmask, rspinmask,
- colstart, rowstart; // some displays need this changed
-#elif defined(__arm__)
- volatile RwReg *dataport, *clkport, *csport, *rsport;
- uint32_t _cs, _rs, _sid, _sclk,
- datapinmask, clkpinmask, cspinmask, rspinmask,
- colstart, rowstart; // some displays need this changed
- int32_t _rst; // Must use signed type since a -1 sentinel is assigned.
-#endif
-
-
-};
-
-#endif
diff --git a/Sming/Libraries/Adafruit_ST7735/README.txt b/Sming/Libraries/Adafruit_ST7735/README.txt
deleted file mode 100644
index e7881f6739..0000000000
--- a/Sming/Libraries/Adafruit_ST7735/README.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-This is a library for the Adafruit 1.8" SPI display.
-This library works with the Adafruit 1.8" TFT Breakout w/SD card
- ----> http://www.adafruit.com/products/358
-The 1.8" TFT shield
- ----> https://www.adafruit.com/product/802
-The 1.44" TFT breakout
- ----> https://www.adafruit.com/product/2088
-as well as Adafruit raw 1.8" TFT display
- ----> http://www.adafruit.com/products/618
-
-
-Check out the links above for our tutorials and wiring diagrams.
-These displays use SPI to communicate, 4 or 5 pins are required
-to interface (RST is optional).
-Adafruit invests time and resources providing this open source code,
-please support Adafruit and open-source hardware by purchasing
-products from Adafruit!
-
-Written by Limor Fried/Ladyada for Adafruit Industries.
-MIT license, all text above must be included in any redistribution
-
-To download. click the DOWNLOADS button in the top right corner, rename the uncompressed folder Adafruit_ST7735. Check that the Adafruit_ST7735 folder contains Adafruit_ST7735.cpp and Adafruit_ST7735.
-
-Place the Adafruit_ST7735 library folder your /libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the IDE
-
-Also requires the Adafruit_GFX library for Arduino.
diff --git a/Sming/Libraries/Adafruit_ST7735/examples/graphicstest/graphicstest.ino b/Sming/Libraries/Adafruit_ST7735/examples/graphicstest/graphicstest.ino
deleted file mode 100644
index 11a0cf5b1d..0000000000
--- a/Sming/Libraries/Adafruit_ST7735/examples/graphicstest/graphicstest.ino
+++ /dev/null
@@ -1,300 +0,0 @@
-/***************************************************
- This is a library for the Adafruit 1.8" SPI display.
-
-This library works with the Adafruit 1.8" TFT Breakout w/SD card
- ----> http://www.adafruit.com/products/358
-The 1.8" TFT shield
- ----> https://www.adafruit.com/product/802
-The 1.44" TFT breakout
- ----> https://www.adafruit.com/product/2088
-as well as Adafruit raw 1.8" TFT display
- ----> http://www.adafruit.com/products/618
-
- Check out the links above for our tutorials and wiring diagrams
- These displays use SPI to communicate, 4 or 5 pins are required to
- interface (RST is optional)
- Adafruit invests time and resources providing this open source code,
- please support Adafruit and open-source hardware by purchasing
- products from Adafruit!
-
- Written by Limor Fried/Ladyada for Adafruit Industries.
- MIT license, all text above must be included in any redistribution
- ****************************************************/
-
-#include // Core graphics library
-#include // Hardware-specific library
-#include
-
-
-// For the breakout, you can use any 2 or 3 pins
-// These pins will also work for the 1.8" TFT shield
-#define TFT_CS 10
-#define TFT_RST 9 // you can also connect this to the Arduino reset
- // in which case, set this #define pin to 0!
-#define TFT_DC 8
-
-// Option 1 (recommended): must use the hardware SPI pins
-// (for UNO thats sclk = 13 and sid = 11) and pin 10 must be
-// an output. This is much faster - also required if you want
-// to use the microSD card (see the image drawing example)
-Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
-
-// Option 2: use any pins but a little slower!
-#define TFT_SCLK 13 // set these to be whatever pins you like!
-#define TFT_MOSI 11 // set these to be whatever pins you like!
-//Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);
-
-
-float p = 3.1415926;
-
-void setup(void) {
- Serial.begin(9600);
- Serial.print("Hello! ST7735 TFT Test");
-
- // Use this initializer if you're using a 1.8" TFT
- tft.initR(INITR_BLACKTAB); // initialize a ST7735S chip, black tab
-
- // Use this initializer (uncomment) if you're using a 1.44" TFT
- //tft.initR(INITR_144GREENTAB); // initialize a ST7735S chip, black tab
-
- Serial.println("Initialized");
-
- uint16_t time = millis();
- tft.fillScreen(ST7735_BLACK);
- time = millis() - time;
-
- Serial.println(time, DEC);
- delay(500);
-
- // large block of text
- tft.fillScreen(ST7735_BLACK);
- testdrawtext("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet ultrices massa eu hendrerit. Ut sed nisi lorem. In vestibulum purus a tortor imperdiet posuere. ", ST7735_WHITE);
- delay(1000);
-
- // tft print function!
- tftPrintTest();
- delay(4000);
-
- // a single pixel
- tft.drawPixel(tft.width()/2, tft.height()/2, ST7735_GREEN);
- delay(500);
-
- // line draw test
- testlines(ST7735_YELLOW);
- delay(500);
-
- // optimized lines
- testfastlines(ST7735_RED, ST7735_BLUE);
- delay(500);
-
- testdrawrects(ST7735_GREEN);
- delay(500);
-
- testfillrects(ST7735_YELLOW, ST7735_MAGENTA);
- delay(500);
-
- tft.fillScreen(ST7735_BLACK);
- testfillcircles(10, ST7735_BLUE);
- testdrawcircles(10, ST7735_WHITE);
- delay(500);
-
- testroundrects();
- delay(500);
-
- testtriangles();
- delay(500);
-
- mediabuttons();
- delay(500);
-
- Serial.println("done");
- delay(1000);
-}
-
-void loop() {
- tft.invertDisplay(true);
- delay(500);
- tft.invertDisplay(false);
- delay(500);
-}
-
-void testlines(uint16_t color) {
- tft.fillScreen(ST7735_BLACK);
- for (int16_t x=0; x < tft.width(); x+=6) {
- tft.drawLine(0, 0, x, tft.height()-1, color);
- }
- for (int16_t y=0; y < tft.height(); y+=6) {
- tft.drawLine(0, 0, tft.width()-1, y, color);
- }
-
- tft.fillScreen(ST7735_BLACK);
- for (int16_t x=0; x < tft.width(); x+=6) {
- tft.drawLine(tft.width()-1, 0, x, tft.height()-1, color);
- }
- for (int16_t y=0; y < tft.height(); y+=6) {
- tft.drawLine(tft.width()-1, 0, 0, y, color);
- }
-
- tft.fillScreen(ST7735_BLACK);
- for (int16_t x=0; x < tft.width(); x+=6) {
- tft.drawLine(0, tft.height()-1, x, 0, color);
- }
- for (int16_t y=0; y < tft.height(); y+=6) {
- tft.drawLine(0, tft.height()-1, tft.width()-1, y, color);
- }
-
- tft.fillScreen(ST7735_BLACK);
- for (int16_t x=0; x < tft.width(); x+=6) {
- tft.drawLine(tft.width()-1, tft.height()-1, x, 0, color);
- }
- for (int16_t y=0; y < tft.height(); y+=6) {
- tft.drawLine(tft.width()-1, tft.height()-1, 0, y, color);
- }
-}
-
-void testdrawtext(char *text, uint16_t color) {
- tft.setCursor(0, 0);
- tft.setTextColor(color);
- tft.setTextWrap(true);
- tft.print(text);
-}
-
-void testfastlines(uint16_t color1, uint16_t color2) {
- tft.fillScreen(ST7735_BLACK);
- for (int16_t y=0; y < tft.height(); y+=5) {
- tft.drawFastHLine(0, y, tft.width(), color1);
- }
- for (int16_t x=0; x < tft.width(); x+=5) {
- tft.drawFastVLine(x, 0, tft.height(), color2);
- }
-}
-
-void testdrawrects(uint16_t color) {
- tft.fillScreen(ST7735_BLACK);
- for (int16_t x=0; x < tft.width(); x+=6) {
- tft.drawRect(tft.width()/2 -x/2, tft.height()/2 -x/2 , x, x, color);
- }
-}
-
-void testfillrects(uint16_t color1, uint16_t color2) {
- tft.fillScreen(ST7735_BLACK);
- for (int16_t x=tft.width()-1; x > 6; x-=6) {
- tft.fillRect(tft.width()/2 -x/2, tft.height()/2 -x/2 , x, x, color1);
- tft.drawRect(tft.width()/2 -x/2, tft.height()/2 -x/2 , x, x, color2);
- }
-}
-
-void testfillcircles(uint8_t radius, uint16_t color) {
- for (int16_t x=radius; x < tft.width(); x+=radius*2) {
- for (int16_t y=radius; y < tft.height(); y+=radius*2) {
- tft.fillCircle(x, y, radius, color);
- }
- }
-}
-
-void testdrawcircles(uint8_t radius, uint16_t color) {
- for (int16_t x=0; x < tft.width()+radius; x+=radius*2) {
- for (int16_t y=0; y < tft.height()+radius; y+=radius*2) {
- tft.drawCircle(x, y, radius, color);
- }
- }
-}
-
-void testtriangles() {
- tft.fillScreen(ST7735_BLACK);
- int color = 0xF800;
- int t;
- int w = tft.width()/2;
- int x = tft.height()-1;
- int y = 0;
- int z = tft.width();
- for(t = 0 ; t <= 15; t+=1) {
- tft.drawTriangle(w, y, y, x, z, x, color);
- x-=4;
- y+=4;
- z-=4;
- color+=100;
- }
-}
-
-void testroundrects() {
- tft.fillScreen(ST7735_BLACK);
- int color = 100;
- int i;
- int t;
- for(t = 0 ; t <= 4; t+=1) {
- int x = 0;
- int y = 0;
- int w = tft.width()-2;
- int h = tft.height()-2;
- for(i = 0 ; i <= 16; i+=1) {
- tft.drawRoundRect(x, y, w, h, 5, color);
- x+=2;
- y+=3;
- w-=4;
- h-=6;
- color+=1100;
- }
- color+=100;
- }
-}
-
-void tftPrintTest() {
- tft.setTextWrap(false);
- tft.fillScreen(ST7735_BLACK);
- tft.setCursor(0, 30);
- tft.setTextColor(ST7735_RED);
- tft.setTextSize(1);
- tft.println("Hello World!");
- tft.setTextColor(ST7735_YELLOW);
- tft.setTextSize(2);
- tft.println("Hello World!");
- tft.setTextColor(ST7735_GREEN);
- tft.setTextSize(3);
- tft.println("Hello World!");
- tft.setTextColor(ST7735_BLUE);
- tft.setTextSize(4);
- tft.print(1234.567);
- delay(1500);
- tft.setCursor(0, 0);
- tft.fillScreen(ST7735_BLACK);
- tft.setTextColor(ST7735_WHITE);
- tft.setTextSize(0);
- tft.println("Hello World!");
- tft.setTextSize(1);
- tft.setTextColor(ST7735_GREEN);
- tft.print(p, 6);
- tft.println(" Want pi?");
- tft.println(" ");
- tft.print(8675309, HEX); // print 8,675,309 out in HEX!
- tft.println(" Print HEX!");
- tft.println(" ");
- tft.setTextColor(ST7735_WHITE);
- tft.println("Sketch has been");
- tft.println("running for: ");
- tft.setTextColor(ST7735_MAGENTA);
- tft.print(millis() / 1000);
- tft.setTextColor(ST7735_WHITE);
- tft.print(" seconds.");
-}
-
-void mediabuttons() {
- // play
- tft.fillScreen(ST7735_BLACK);
- tft.fillRoundRect(25, 10, 78, 60, 8, ST7735_WHITE);
- tft.fillTriangle(42, 20, 42, 60, 90, 40, ST7735_RED);
- delay(500);
- // pause
- tft.fillRoundRect(25, 90, 78, 60, 8, ST7735_WHITE);
- tft.fillRoundRect(39, 98, 20, 45, 5, ST7735_GREEN);
- tft.fillRoundRect(69, 98, 20, 45, 5, ST7735_GREEN);
- delay(500);
- // play color
- tft.fillTriangle(42, 20, 42, 60, 90, 40, ST7735_BLUE);
- delay(50);
- // pause color
- tft.fillRoundRect(39, 98, 20, 45, 5, ST7735_RED);
- tft.fillRoundRect(69, 98, 20, 45, 5, ST7735_RED);
- // play color
- tft.fillTriangle(42, 20, 42, 60, 90, 40, ST7735_GREEN);
-}
diff --git a/Sming/Libraries/Adafruit_ST7735/examples/rotationtest/rotationtest.ino b/Sming/Libraries/Adafruit_ST7735/examples/rotationtest/rotationtest.ino
deleted file mode 100644
index 0357f59bd7..0000000000
--- a/Sming/Libraries/Adafruit_ST7735/examples/rotationtest/rotationtest.ino
+++ /dev/null
@@ -1,285 +0,0 @@
-/***************************************************
- This is a library for the Adafruit 1.8" SPI display.
-
-This library works with the Adafruit 1.8" TFT Breakout w/SD card
- ----> http://www.adafruit.com/products/358
-The 1.8" TFT shield
- ----> https://www.adafruit.com/product/802
-The 1.44" TFT breakout
- ----> https://www.adafruit.com/product/2088
-as well as Adafruit raw 1.8" TFT display
- ----> http://www.adafruit.com/products/618
-
- Check out the links above for our tutorials and wiring diagrams
- These displays use SPI to communicate, 4 or 5 pins are required to
- interface (RST is optional)
- Adafruit invests time and resources providing this open source code,
- please support Adafruit and open-source hardware by purchasing
- products from Adafruit!
-
- Written by Limor Fried/Ladyada for Adafruit Industries.
- MIT license, all text above must be included in any redistribution
- ****************************************************/
-
-#include // Core graphics library
-#include // Hardware-specific library
-#include
-
-
-// For the breakout, you can use any 2 or 3 pins
-// These pins will also work for the 1.8" TFT shield
-#define TFT_CS 10
-#define TFT_RST 9 // you can also connect this to the Arduino reset
- // in which case, set this #define pin to 0!
-#define TFT_DC 8
-
-// Option 1 (recommended): must use the hardware SPI pins
-// (for UNO thats sclk = 13 and sid = 11) and pin 10 must be
-// an output. This is much faster - also required if you want
-// to use the microSD card (see the image drawing example)
-Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
-
-// Option 2: use any pins but a little slower!
-#define TFT_SCLK 13 // set these to be whatever pins you like!
-#define TFT_MOSI 11 // set these to be whatever pins you like!
-//Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);
-
-void setup(void) {
- Serial.begin(9600);
- Serial.print("Hello! Adafruit ST7735 rotation test");
-
- // Use this initializer if you're using a 1.8" TFT
- tft.initR(INITR_BLACKTAB); // initialize a ST7735S chip, black tab
-
- // Use this initializer (uncomment) if you're using a 1.44" TFT
- //tft.initR(INITR_144GREENTAB); // initialize a ST7735S chip, black tab
-
- Serial.println("init");
-
- tft.setTextWrap(false); // Allow text to run off right edge
- tft.fillScreen(ST7735_BLACK);
-
- Serial.println("This is a test of the rotation capabilities of the TFT library!");
- Serial.println("Press (or type a character) to advance");
-}
-
-void loop(void) {
- rotateLine();
- rotateText();
- rotatePixel();
- rotateFastline();
- rotateDrawrect();
- rotateFillrect();
- rotateDrawcircle();
- rotateFillcircle();
- rotateTriangle();
- rotateFillTriangle();
- rotateRoundRect();
- rotateFillRoundRect();
- rotateChar();
- rotateString();
-}
-
-void rotateText() {
- for (uint8_t i=0; i<4; i++) {
- tft.fillScreen(ST7735_BLACK);
- Serial.println(tft.getRotation(), DEC);
-
- tft.setCursor(0, 30);
- tft.setTextColor(ST7735_RED);
- tft.setTextSize(1);
- tft.println("Hello World!");
- tft.setTextColor(ST7735_YELLOW);
- tft.setTextSize(2);
- tft.println("Hello World!");
- tft.setTextColor(ST7735_GREEN);
- tft.setTextSize(3);
- tft.println("Hello World!");
- tft.setTextColor(ST7735_BLUE);
- tft.setTextSize(4);
- tft.print(1234.567);
- while (!Serial.available());
- Serial.read(); Serial.read(); Serial.read();
-
- tft.setRotation(tft.getRotation()+1);
- }
-}
-
-void rotateFillcircle(void) {
- for (uint8_t i=0; i<4; i++) {
- tft.fillScreen(ST7735_BLACK);
- Serial.println(tft.getRotation(), DEC);
-
- tft.fillCircle(10, 30, 10, ST7735_YELLOW);
-
- while (!Serial.available());
- Serial.read(); Serial.read(); Serial.read();
-
- tft.setRotation(tft.getRotation()+1);
- }
-}
-
-void rotateDrawcircle(void) {
- for (uint8_t i=0; i<4; i++) {
- tft.fillScreen(ST7735_BLACK);
- Serial.println(tft.getRotation(), DEC);
-
- tft.drawCircle(10, 30, 10, ST7735_YELLOW);
-
- while (!Serial.available());
- Serial.read(); Serial.read(); Serial.read();
-
- tft.setRotation(tft.getRotation()+1);
- }
-}
-
-void rotateFillrect(void) {
- for (uint8_t i=0; i<4; i++) {
- tft.fillScreen(ST7735_BLACK);
- Serial.println(tft.getRotation(), DEC);
-
- tft.fillRect(10, 20, 10, 20, ST7735_GREEN);
-
- while (!Serial.available());
- Serial.read(); Serial.read(); Serial.read();
-
- tft.setRotation(tft.getRotation()+1);
- }
-}
-
-void rotateDrawrect(void) {
- for (uint8_t i=0; i<4; i++) {
- tft.fillScreen(ST7735_BLACK);
- Serial.println(tft.getRotation(), DEC);
-
- tft.drawRect(10, 20, 10, 20, ST7735_GREEN);
-
- while (!Serial.available());
- Serial.read(); Serial.read(); Serial.read();
-
- tft.setRotation(tft.getRotation()+1);
- }
-}
-
-void rotateFastline(void) {
- for (uint8_t i=0; i<4; i++) {
- tft.fillScreen(ST7735_BLACK);
- Serial.println(tft.getRotation(), DEC);
-
- tft.drawFastHLine(0, 20, tft.width(), ST7735_RED);
- tft.drawFastVLine(20, 0, tft.height(), ST7735_BLUE);
-
- while (!Serial.available());
- Serial.read(); Serial.read(); Serial.read();
-
- tft.setRotation(tft.getRotation()+1);
- }
-}
-
-void rotateLine(void) {
- for (uint8_t i=0; i<4; i++) {
- tft.fillScreen(ST7735_BLACK);
- Serial.println(tft.getRotation(), DEC);
-
- tft.drawLine(tft.width()/2, tft.height()/2, 0, 0, ST7735_RED);
- while (!Serial.available());
- Serial.read(); Serial.read(); Serial.read();
-
- tft.setRotation(tft.getRotation()+1);
- }
-}
-
-void rotatePixel(void) {
- for (uint8_t i=0; i<4; i++) {
- tft.fillScreen(ST7735_BLACK);
- Serial.println(tft.getRotation(), DEC);
-
- tft.drawPixel(10,20, ST7735_WHITE);
- while (!Serial.available());
- Serial.read(); Serial.read(); Serial.read();
-
- tft.setRotation(tft.getRotation()+1);
- }
-}
-
-void rotateTriangle(void) {
- for (uint8_t i=0; i<4; i++) {
- tft.fillScreen(ST7735_BLACK);
- Serial.println(tft.getRotation(), DEC);
-
- tft.drawTriangle(20, 10, 10, 30, 30, 30, ST7735_GREEN);
- while (!Serial.available());
- Serial.read(); Serial.read(); Serial.read();
-
- tft.setRotation(tft.getRotation()+1);
- }
-}
-
-void rotateFillTriangle(void) {
- for (uint8_t i=0; i<4; i++) {
- tft.fillScreen(ST7735_BLACK);
- Serial.println(tft.getRotation(), DEC);
-
- tft.fillTriangle(20, 10, 10, 30, 30, 30, ST7735_RED);
- while (!Serial.available());
- Serial.read(); Serial.read(); Serial.read();
-
- tft.setRotation(tft.getRotation()+1);
- }
-}
-
-void rotateRoundRect(void) {
- for (uint8_t i=0; i<4; i++) {
- tft.fillScreen(ST7735_BLACK);
- Serial.println(tft.getRotation(), DEC);
-
- tft.drawRoundRect(20, 10, 25, 15, 5, ST7735_BLUE);
- while (!Serial.available());
- Serial.read(); Serial.read(); Serial.read();
-
- tft.setRotation(tft.getRotation()+1);
- }
-}
-
-void rotateFillRoundRect(void) {
- for (uint8_t i=0; i<4; i++) {
- tft.fillScreen(ST7735_BLACK);
- Serial.println(tft.getRotation(), DEC);
-
- tft.fillRoundRect(20, 10, 25, 15, 5, ST7735_CYAN);
- while (!Serial.available());
- Serial.read(); Serial.read(); Serial.read();
-
- tft.setRotation(tft.getRotation()+1);
- }
-}
-
-void rotateChar(void) {
- for (uint8_t i=0; i<4; i++) {
- tft.fillScreen(ST7735_BLACK);
- Serial.println(tft.getRotation(), DEC);
-
- tft.drawChar(25, 15, 'A', ST7735_WHITE, ST7735_WHITE, 1);
- while (!Serial.available());
- Serial.read(); Serial.read(); Serial.read();
-
- tft.setRotation(tft.getRotation()+1);
- }
-}
-
-void rotateString(void) {
- for (uint8_t i=0; i<4; i++) {
- tft.fillScreen(ST7735_BLACK);
- Serial.println(tft.getRotation(), DEC);
-
- tft.setCursor(8, 25);
- tft.setTextSize(1);
- tft.setTextColor(ST7735_WHITE);
- tft.print("Adafruit Industries");
- while (!Serial.available());
- Serial.read(); Serial.read(); Serial.read();
-
- tft.setRotation(tft.getRotation()+1);
- }
-}
-
diff --git a/Sming/Libraries/Adafruit_ST7735/examples/shieldtest/shieldtest.ino b/Sming/Libraries/Adafruit_ST7735/examples/shieldtest/shieldtest.ino
deleted file mode 100644
index d88dbc6f21..0000000000
--- a/Sming/Libraries/Adafruit_ST7735/examples/shieldtest/shieldtest.ino
+++ /dev/null
@@ -1,256 +0,0 @@
-/***************************************************
- This is an example sketch for the Adafruit 1.8" TFT shield with joystick
- ----> http://www.adafruit.com/products/802
-
- Check out the links above for our tutorials and wiring diagrams
- These displays use SPI to communicate, 4 pins are required to
- interface
- One pin is also needed for the joystick, we use analog 3
- Adafruit invests time and resources providing this open source code,
- please support Adafruit and open-source hardware by purchasing
- products from Adafruit!
-
- Written by Limor Fried/Ladyada for Adafruit Industries.
- MIT license, all text above must be included in any redistribution
- ****************************************************/
-
-#include
-#include
-#include
-#include
-
-#if defined(__SAM3X8E__)
- #undef __FlashStringHelper::F(string_literal)
- #define F(string_literal) string_literal
-#endif
-
-// TFT display and SD card will share the hardware SPI interface.
-// Hardware SPI pins are specific to the Arduino board type and
-// cannot be remapped to alternate pins. For Arduino Uno,
-// Duemilanove, etc., pin 11 = MOSI, pin 12 = MISO, pin 13 = SCK.
-#define SD_CS 4 // Chip select line for SD card
-#define TFT_CS 10 // Chip select line for TFT display
-#define TFT_DC 8 // Data/command line for TFT
-#define TFT_RST -1 // Reset line for TFT (or connect to +5V)
-
-Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
-
-#define BUTTON_NONE 0
-#define BUTTON_DOWN 1
-#define BUTTON_RIGHT 2
-#define BUTTON_SELECT 3
-#define BUTTON_UP 4
-#define BUTTON_LEFT 5
-
-void setup(void) {
- Serial.begin(9600);
-
- // Initialize 1.8" TFT
- tft.initR(INITR_BLACKTAB); // initialize a ST7735S chip, black tab
-
- Serial.println("OK!");
- tft.fillScreen(ST7735_BLACK);
-}
-
-
-uint8_t readButton(void) {
- float a = analogRead(3);
-
- a *= 5.0;
- a /= 1024.0;
-
- Serial.print("Button read analog = ");
- Serial.println(a);
- if (a < 0.2) return BUTTON_DOWN;
- if (a < 1.0) return BUTTON_RIGHT;
- if (a < 1.5) return BUTTON_SELECT;
- if (a < 2.0) return BUTTON_UP;
- if (a < 3.2) return BUTTON_LEFT;
- else return BUTTON_NONE;
-}
-
-uint8_t buttonhistory = 0;
-
-void loop() {
- uint8_t b = readButton();
- tft.setTextSize(3);
- if (b == BUTTON_DOWN) {
- tft.setTextColor(ST7735_RED);
- tft.setCursor(0, 10);
- tft.print("Down ");
- buttonhistory |= 1;
- }
- if (b == BUTTON_LEFT) {
- tft.setTextColor(ST7735_YELLOW);
- tft.setCursor(0, 35);
- tft.print("Left ");
- buttonhistory |= 2;
- }
- if (b == BUTTON_UP) {
- tft.setTextColor(ST7735_GREEN);
- tft.setCursor(0, 60);
- tft.print("Up");
- buttonhistory |= 4;
- }
- if (b == BUTTON_RIGHT) {
- tft.setTextColor(ST7735_BLUE);
- tft.setCursor(0, 85);
- tft.print("Right");
- buttonhistory |= 8;
- }
- if ((b == BUTTON_SELECT) && (buttonhistory == 0xF)) {
- tft.setTextColor(ST7735_MAGENTA);
- tft.setCursor(0, 110);
- tft.print("SELECT");
- buttonhistory |= 8;
- delay(2000);
- Serial.print("Initializing SD card...");
- if (!SD.begin(SD_CS)) {
- Serial.println("failed!");
- return;
- }
- bmpDraw("parrot.bmp", 0, 0);
- while (1);
- }
- delay(100);
-}
-
-// This function opens a Windows Bitmap (BMP) file and
-// displays it at the given coordinates. It's sped up
-// by reading many pixels worth of data at a time
-// (rather than pixel by pixel). Increasing the buffer
-// size takes more of the Arduino's precious RAM but
-// makes loading a little faster. 20 pixels seems a
-// good balance.
-
-#define BUFFPIXEL 20
-
-void bmpDraw(char *filename, uint8_t x, uint8_t y) {
-
- File bmpFile;
- int bmpWidth, bmpHeight; // W+H in pixels
- uint8_t bmpDepth; // Bit depth (currently must be 24)
- uint32_t bmpImageoffset; // Start of image data in file
- uint32_t rowSize; // Not always = bmpWidth; may have padding
- uint8_t sdbuffer[3*BUFFPIXEL]; // pixel buffer (R+G+B per pixel)
- uint8_t buffidx = sizeof(sdbuffer); // Current position in sdbuffer
- boolean goodBmp = false; // Set to true on valid header parse
- boolean flip = true; // BMP is stored bottom-to-top
- int w, h, row, col;
- uint8_t r, g, b;
- uint32_t pos = 0, startTime = millis();
-
- if((x >= tft.width()) || (y >= tft.height())) return;
-
- Serial.println();
- Serial.print("Loading image '");
- Serial.print(filename);
- Serial.println('\'');
-
- // Open requested file on SD card
- if ((bmpFile = SD.open(filename)) == NULL) {
- Serial.print("File not found");
- return;
- }
-
- // Parse BMP header
- if(read16(bmpFile) == 0x4D42) { // BMP signature
- Serial.print("File size: "); Serial.println(read32(bmpFile));
- (void)read32(bmpFile); // Read & ignore creator bytes
- bmpImageoffset = read32(bmpFile); // Start of image data
- Serial.print("Image Offset: "); Serial.println(bmpImageoffset, DEC);
- // Read DIB header
- Serial.print("Header size: "); Serial.println(read32(bmpFile));
- bmpWidth = read32(bmpFile);
- bmpHeight = read32(bmpFile);
- if(read16(bmpFile) == 1) { // # planes -- must be '1'
- bmpDepth = read16(bmpFile); // bits per pixel
- Serial.print("Bit Depth: "); Serial.println(bmpDepth);
- if((bmpDepth == 24) && (read32(bmpFile) == 0)) { // 0 = uncompressed
-
- goodBmp = true; // Supported BMP format -- proceed!
- Serial.print("Image size: ");
- Serial.print(bmpWidth);
- Serial.print('x');
- Serial.println(bmpHeight);
-
- // BMP rows are padded (if needed) to 4-byte boundary
- rowSize = (bmpWidth * 3 + 3) & ~3;
-
- // If bmpHeight is negative, image is in top-down order.
- // This is not canon but has been observed in the wild.
- if(bmpHeight < 0) {
- bmpHeight = -bmpHeight;
- flip = false;
- }
-
- // Crop area to be loaded
- w = bmpWidth;
- h = bmpHeight;
- if((x+w-1) >= tft.width()) w = tft.width() - x;
- if((y+h-1) >= tft.height()) h = tft.height() - y;
-
- // Set TFT address window to clipped image bounds
- tft.setAddrWindow(x, y, x+w-1, y+h-1);
-
- for (row=0; row= sizeof(sdbuffer)) { // Indeed
- bmpFile.read(sdbuffer, sizeof(sdbuffer));
- buffidx = 0; // Set index to beginning
- }
-
- // Convert pixel from BMP to TFT format, push to display
- b = sdbuffer[buffidx++];
- g = sdbuffer[buffidx++];
- r = sdbuffer[buffidx++];
- tft.pushColor(tft.Color565(r,g,b));
- } // end pixel
- } // end scanline
- Serial.print("Loaded in ");
- Serial.print(millis() - startTime);
- Serial.println(" ms");
- } // end goodBmp
- }
- }
-
- bmpFile.close();
- if(!goodBmp) Serial.println("BMP format not recognized.");
-}
-
-// These read 16- and 32-bit types from the SD card file.
-// BMP data is stored little-endian, Arduino is little-endian too.
-// May need to reverse subscript order if porting elsewhere.
-
-uint16_t read16(File f) {
- uint16_t result;
- ((uint8_t *)&result)[0] = f.read(); // LSB
- ((uint8_t *)&result)[1] = f.read(); // MSB
- return result;
-}
-
-uint32_t read32(File f) {
- uint32_t result;
- ((uint8_t *)&result)[0] = f.read(); // LSB
- ((uint8_t *)&result)[1] = f.read();
- ((uint8_t *)&result)[2] = f.read();
- ((uint8_t *)&result)[3] = f.read(); // MSB
- return result;
-}
diff --git a/Sming/Libraries/Adafruit_ST7735/examples/soft_spitftbitmap/soft_spitftbitmap.ino b/Sming/Libraries/Adafruit_ST7735/examples/soft_spitftbitmap/soft_spitftbitmap.ino
deleted file mode 100644
index 89eb2e3b7e..0000000000
--- a/Sming/Libraries/Adafruit_ST7735/examples/soft_spitftbitmap/soft_spitftbitmap.ino
+++ /dev/null
@@ -1,219 +0,0 @@
-/***************************************************
- This is an example sketch for the Adafruit 1.8" SPI display.
- This library works with the Adafruit 1.8" TFT Breakout w/SD card
- ----> http://www.adafruit.com/products/358
- as well as Adafruit raw 1.8" TFT display
- ----> http://www.adafruit.com/products/618
-
- Check out the links above for our tutorials and wiring diagrams
- These displays use SPI to communicate, 4 or 5 pins are required to
- interface (RST is optional)
- Adafruit invests time and resources providing this open source code,
- please support Adafruit and open-source hardware by purchasing
- products from Adafruit!
-
- Written by Limor Fried/Ladyada for Adafruit Industries.
- MIT license, all text above must be included in any redistribution
- ****************************************************/
-
-#include // Core graphics library
-#include // Hardware-specific library
-#include
-#include
-
-#if defined(__SAM3X8E__)
- #undef __FlashStringHelper::F(string_literal)
- #define F(string_literal) string_literal
-#endif
-
-// TFT display and SD card will share the hardware SPI interface.
-// Hardware SPI pins are specific to the Arduino board type and
-// cannot be remapped to alternate pins. For Arduino Uno,
-// Duemilanove, etc., pin 11 = MOSI, pin 12 = MISO, pin 13 = SCK.
-#define SPI_SCK 13
-#define SPI_DI 12
-#define SPI_DO 11
-
-#define SD_CS 4 // Chip select line for SD card
-//#define TFT_CS 10 // Chip select line for TFT display
-//#define TFT_DC 9 // Data/command line for TFT
-//#define TFT_RST 8 // Reset line for TFT (or connect to +5V)
-
-//Use these pins for the shield!
-#define TFT_CS 10
-#define TFT_DC 8
-#define TFT_RST 0 // you can also connect this to the Arduino reset
-
-Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, SPI_DO, SPI_SCK, TFT_RST);
-
-void setup(void) {
- Serial.begin(9600);
-
- // Our supplier changed the 1.8" display slightly after Jan 10, 2012
- // so that the alignment of the TFT had to be shifted by a few pixels
- // this just means the init code is slightly different. Check the
- // color of the tab to see which init code to try. If the display is
- // cut off or has extra 'random' pixels on the top & left, try the
- // other option!
- // If you are seeing red and green color inversion, use Black Tab
-
- // If your TFT's plastic wrap has a Black Tab, use the following:
- tft.initR(INITR_BLACKTAB); // initialize a ST7735S chip, black tab
- // If your TFT's plastic wrap has a Red Tab, use the following:
- //tft.initR(INITR_REDTAB); // initialize a ST7735R chip, red tab
- // If your TFT's plastic wrap has a Green Tab, use the following:
- //tft.initR(INITR_GREENTAB); // initialize a ST7735R chip, green tab
-
- Serial.print("Initializing SD card...");
- if (!SD.begin(SD_CS, SPI_DO, SPI_DI, SPI_SCK)) {
- Serial.println("failed!");
- return;
- }
- Serial.println("OK!");
-
- bmpDraw("parrot.bmp", 0, 0);
-}
-
-void loop() {
-}
-
-// This function opens a Windows Bitmap (BMP) file and
-// displays it at the given coordinates. It's sped up
-// by reading many pixels worth of data at a time
-// (rather than pixel by pixel). Increasing the buffer
-// size takes more of the Arduino's precious RAM but
-// makes loading a little faster. 20 pixels seems a
-// good balance.
-
-#define BUFFPIXEL 20
-
-void bmpDraw(char *filename, uint8_t x, uint8_t y) {
-
- File bmpFile;
- int bmpWidth, bmpHeight; // W+H in pixels
- uint8_t bmpDepth; // Bit depth (currently must be 24)
- uint32_t bmpImageoffset; // Start of image data in file
- uint32_t rowSize; // Not always = bmpWidth; may have padding
- uint8_t sdbuffer[3*BUFFPIXEL]; // pixel buffer (R+G+B per pixel)
- uint8_t buffidx = sizeof(sdbuffer); // Current position in sdbuffer
- boolean goodBmp = false; // Set to true on valid header parse
- boolean flip = true; // BMP is stored bottom-to-top
- int w, h, row, col;
- uint8_t r, g, b;
- uint32_t pos = 0, startTime = millis();
-
- if((x >= tft.width()) || (y >= tft.height())) return;
-
- Serial.println();
- Serial.print("Loading image '");
- Serial.print(filename);
- Serial.println('\'');
-
- // Open requested file on SD card
- if ((bmpFile = SD.open(filename)) == NULL) {
- Serial.print("File not found");
- return;
- }
-
- // Parse BMP header
- if(read16(bmpFile) == 0x4D42) { // BMP signature
- Serial.print("File size: "); Serial.println(read32(bmpFile));
- (void)read32(bmpFile); // Read & ignore creator bytes
- bmpImageoffset = read32(bmpFile); // Start of image data
- Serial.print("Image Offset: "); Serial.println(bmpImageoffset, DEC);
- // Read DIB header
- Serial.print("Header size: "); Serial.println(read32(bmpFile));
- bmpWidth = read32(bmpFile);
- bmpHeight = read32(bmpFile);
- if(read16(bmpFile) == 1) { // # planes -- must be '1'
- bmpDepth = read16(bmpFile); // bits per pixel
- Serial.print("Bit Depth: "); Serial.println(bmpDepth);
- if((bmpDepth == 24) && (read32(bmpFile) == 0)) { // 0 = uncompressed
-
- goodBmp = true; // Supported BMP format -- proceed!
- Serial.print("Image size: ");
- Serial.print(bmpWidth);
- Serial.print('x');
- Serial.println(bmpHeight);
-
- // BMP rows are padded (if needed) to 4-byte boundary
- rowSize = (bmpWidth * 3 + 3) & ~3;
-
- // If bmpHeight is negative, image is in top-down order.
- // This is not canon but has been observed in the wild.
- if(bmpHeight < 0) {
- bmpHeight = -bmpHeight;
- flip = false;
- }
-
- // Crop area to be loaded
- w = bmpWidth;
- h = bmpHeight;
- if((x+w-1) >= tft.width()) w = tft.width() - x;
- if((y+h-1) >= tft.height()) h = tft.height() - y;
-
- // Set TFT address window to clipped image bounds
- tft.setAddrWindow(x, y, x+w-1, y+h-1);
-
- for (row=0; row= sizeof(sdbuffer)) { // Indeed
- bmpFile.read(sdbuffer, sizeof(sdbuffer));
- buffidx = 0; // Set index to beginning
- }
-
- // Convert pixel from BMP to TFT format, push to display
- b = sdbuffer[buffidx++];
- g = sdbuffer[buffidx++];
- r = sdbuffer[buffidx++];
- tft.pushColor(tft.Color565(r,g,b));
- } // end pixel
- } // end scanline
- Serial.print("Loaded in ");
- Serial.print(millis() - startTime);
- Serial.println(" ms");
- } // end goodBmp
- }
- }
-
- bmpFile.close();
- if(!goodBmp) Serial.println("BMP format not recognized.");
-}
-
-// These read 16- and 32-bit types from the SD card file.
-// BMP data is stored little-endian, Arduino is little-endian too.
-// May need to reverse subscript order if porting elsewhere.
-
-uint16_t read16(File f) {
- uint16_t result;
- ((uint8_t *)&result)[0] = f.read(); // LSB
- ((uint8_t *)&result)[1] = f.read(); // MSB
- return result;
-}
-
-uint32_t read32(File f) {
- uint32_t result;
- ((uint8_t *)&result)[0] = f.read(); // LSB
- ((uint8_t *)&result)[1] = f.read();
- ((uint8_t *)&result)[2] = f.read();
- ((uint8_t *)&result)[3] = f.read(); // MSB
- return result;
-}
-
diff --git a/Sming/Libraries/Adafruit_ST7735/examples/spitftbitmap/spitftbitmap.ino b/Sming/Libraries/Adafruit_ST7735/examples/spitftbitmap/spitftbitmap.ino
deleted file mode 100644
index 760a206a74..0000000000
--- a/Sming/Libraries/Adafruit_ST7735/examples/spitftbitmap/spitftbitmap.ino
+++ /dev/null
@@ -1,215 +0,0 @@
-/***************************************************
- This is a library for the Adafruit 1.8" SPI display.
-
-This library works with the Adafruit 1.8" TFT Breakout w/SD card
- ----> http://www.adafruit.com/products/358
-The 1.8" TFT shield
- ----> https://www.adafruit.com/product/802
-The 1.44" TFT breakout
- ----> https://www.adafruit.com/product/2088
-as well as Adafruit raw 1.8" TFT display
- ----> http://www.adafruit.com/products/618
-
- Check out the links above for our tutorials and wiring diagrams
- These displays use SPI to communicate, 4 or 5 pins are required to
- interface (RST is optional)
- Adafruit invests time and resources providing this open source code,
- please support Adafruit and open-source hardware by purchasing
- products from Adafruit!
-
- Written by Limor Fried/Ladyada for Adafruit Industries.
- MIT license, all text above must be included in any redistribution
- ****************************************************/
-
-#include // Core graphics library
-#include // Hardware-specific library
-#include
-#include
-
-// TFT display and SD card will share the hardware SPI interface.
-// Hardware SPI pins are specific to the Arduino board type and
-// cannot be remapped to alternate pins. For Arduino Uno,
-// Duemilanove, etc., pin 11 = MOSI, pin 12 = MISO, pin 13 = SCK.
-#define TFT_CS 10 // Chip select line for TFT display
-#define TFT_RST 9 // Reset line for TFT (or see below...)
-#define TFT_DC 8 // Data/command line for TFT
-
-#define SD_CS 4 // Chip select line for SD card
-
-//Use this reset pin for the shield!
-//#define TFT_RST 0 // you can also connect this to the Arduino reset!
-
-Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
-
-void setup(void) {
- Serial.begin(9600);
-
- // Use this initializer if you're using a 1.8" TFT
- tft.initR(INITR_BLACKTAB);
-
- // Use this initializer (uncomment) if you're using a 1.44" TFT
- //tft.initR(INITR_144GREENTAB);
-
- Serial.print("Initializing SD card...");
- if (!SD.begin(SD_CS)) {
- Serial.println("failed!");
- return;
- }
- Serial.println("OK!");
-
- // change the name here!
- bmpDraw("parrot.bmp", 0, 0);
- // wait 5 seconds
- delay(5000);
-}
-
-void loop() {
-// uncomment these lines to draw bitmaps in different locations/rotations!
-/*
- tft.fillScreen(ST7735_BLACK); // Clear display
- for(uint8_t i=0; i<4; i++) // Draw 4 parrots
- bmpDraw("parrot.bmp", tft.width() / 4 * i, tft.height() / 4 * i);
- delay(1000);
- tft.setRotation(tft.getRotation() + 1); // Inc rotation 90 degrees
-*/
-}
-
-// This function opens a Windows Bitmap (BMP) file and
-// displays it at the given coordinates. It's sped up
-// by reading many pixels worth of data at a time
-// (rather than pixel by pixel). Increasing the buffer
-// size takes more of the Arduino's precious RAM but
-// makes loading a little faster. 20 pixels seems a
-// good balance.
-
-#define BUFFPIXEL 20
-
-void bmpDraw(char *filename, uint8_t x, uint8_t y) {
-
- File bmpFile;
- int bmpWidth, bmpHeight; // W+H in pixels
- uint8_t bmpDepth; // Bit depth (currently must be 24)
- uint32_t bmpImageoffset; // Start of image data in file
- uint32_t rowSize; // Not always = bmpWidth; may have padding
- uint8_t sdbuffer[3*BUFFPIXEL]; // pixel buffer (R+G+B per pixel)
- uint8_t buffidx = sizeof(sdbuffer); // Current position in sdbuffer
- boolean goodBmp = false; // Set to true on valid header parse
- boolean flip = true; // BMP is stored bottom-to-top
- int w, h, row, col;
- uint8_t r, g, b;
- uint32_t pos = 0, startTime = millis();
-
- if((x >= tft.width()) || (y >= tft.height())) return;
-
- Serial.println();
- Serial.print("Loading image '");
- Serial.print(filename);
- Serial.println('\'');
-
- // Open requested file on SD card
- if ((bmpFile = SD.open(filename)) == NULL) {
- Serial.print("File not found");
- return;
- }
-
- // Parse BMP header
- if(read16(bmpFile) == 0x4D42) { // BMP signature
- Serial.print("File size: "); Serial.println(read32(bmpFile));
- (void)read32(bmpFile); // Read & ignore creator bytes
- bmpImageoffset = read32(bmpFile); // Start of image data
- Serial.print("Image Offset: "); Serial.println(bmpImageoffset, DEC);
- // Read DIB header
- Serial.print("Header size: "); Serial.println(read32(bmpFile));
- bmpWidth = read32(bmpFile);
- bmpHeight = read32(bmpFile);
- if(read16(bmpFile) == 1) { // # planes -- must be '1'
- bmpDepth = read16(bmpFile); // bits per pixel
- Serial.print("Bit Depth: "); Serial.println(bmpDepth);
- if((bmpDepth == 24) && (read32(bmpFile) == 0)) { // 0 = uncompressed
-
- goodBmp = true; // Supported BMP format -- proceed!
- Serial.print("Image size: ");
- Serial.print(bmpWidth);
- Serial.print('x');
- Serial.println(bmpHeight);
-
- // BMP rows are padded (if needed) to 4-byte boundary
- rowSize = (bmpWidth * 3 + 3) & ~3;
-
- // If bmpHeight is negative, image is in top-down order.
- // This is not canon but has been observed in the wild.
- if(bmpHeight < 0) {
- bmpHeight = -bmpHeight;
- flip = false;
- }
-
- // Crop area to be loaded
- w = bmpWidth;
- h = bmpHeight;
- if((x+w-1) >= tft.width()) w = tft.width() - x;
- if((y+h-1) >= tft.height()) h = tft.height() - y;
-
- // Set TFT address window to clipped image bounds
- tft.setAddrWindow(x, y, x+w-1, y+h-1);
-
- for (row=0; row= sizeof(sdbuffer)) { // Indeed
- bmpFile.read(sdbuffer, sizeof(sdbuffer));
- buffidx = 0; // Set index to beginning
- }
-
- // Convert pixel from BMP to TFT format, push to display
- b = sdbuffer[buffidx++];
- g = sdbuffer[buffidx++];
- r = sdbuffer[buffidx++];
- tft.pushColor(tft.Color565(r,g,b));
- } // end pixel
- } // end scanline
- Serial.print("Loaded in ");
- Serial.print(millis() - startTime);
- Serial.println(" ms");
- } // end goodBmp
- }
- }
-
- bmpFile.close();
- if(!goodBmp) Serial.println("BMP format not recognized.");
-}
-
-// These read 16- and 32-bit types from the SD card file.
-// BMP data is stored little-endian, Arduino is little-endian too.
-// May need to reverse subscript order if porting elsewhere.
-
-uint16_t read16(File f) {
- uint16_t result;
- ((uint8_t *)&result)[0] = f.read(); // LSB
- ((uint8_t *)&result)[1] = f.read(); // MSB
- return result;
-}
-
-uint32_t read32(File f) {
- uint32_t result;
- ((uint8_t *)&result)[0] = f.read(); // LSB
- ((uint8_t *)&result)[1] = f.read();
- ((uint8_t *)&result)[2] = f.read();
- ((uint8_t *)&result)[3] = f.read(); // MSB
- return result;
-}
\ No newline at end of file
diff --git a/Sming/Libraries/Adafruit_ST7735/library.properties b/Sming/Libraries/Adafruit_ST7735/library.properties
deleted file mode 100644
index a8d97af887..0000000000
--- a/Sming/Libraries/Adafruit_ST7735/library.properties
+++ /dev/null
@@ -1,9 +0,0 @@
-name=Adafruit ST7735 Library
-version=1.0.4
-author=Adafruit
-maintainer=Adafruit
-sentence=This is a library for the Adafruit 1.8" SPI displays.
-paragraph=This is a library for the Adafruit 1.8" SPI displays.
-category=Display
-url=https://github.com/adafruit/Adafruit-ST7735-Library
-architectures=*
diff --git a/Sming/Libraries/CapacitiveSensor/CapacitiveSensor.h b/Sming/Libraries/CapacitiveSensor/CapacitiveSensor.h
index e9a84802ff..b19a7b62c0 100644
--- a/Sming/Libraries/CapacitiveSensor/CapacitiveSensor.h
+++ b/Sming/Libraries/CapacitiveSensor/CapacitiveSensor.h
@@ -24,7 +24,7 @@
#define PIN_TO_BASEREG(pin) (portOutputRegister(digitalPinToPort(pin)))
#define PIN_TO_BITMASK(pin) (digitalPinToBitMask(pin))
-#define IO_REG_TYPE uint8_t
+#define IO_REG_TYPE GPIO_REG_TYPE
#define IO_REG_ASM
#define DIRECT_READ(base, mask) (((*((base)+GPIO_IN_ADDRESS)) & (mask)) ? 1 : 0)
#define DIRECT_MODE_INPUT(base, mask) ((*((base)+GPIO_ENABLE_ADDRESS)) &= ~(mask))
diff --git a/Sming/Libraries/TFT_ILI9163C/TFT_ILI9163C.h b/Sming/Libraries/TFT_ILI9163C/TFT_ILI9163C.h
index fc133ec401..036f530eee 100644
--- a/Sming/Libraries/TFT_ILI9163C/TFT_ILI9163C.h
+++ b/Sming/Libraries/TFT_ILI9163C/TFT_ILI9163C.h
@@ -295,9 +295,9 @@ class TFT_ILI9163C : public Adafruit_GFX {
#if defined(__ESP8266_EX__)
void spiwrite(uint8_t);
- volatile uint8_t *csport, *rsport;
+ volatile GPIO_REG_TYPE *csport, *rsport;
uint8_t _cs,_rs,_sid,_sclk,_rst;
- uint8_t cspinmask, rspinmask;
+ GPIO_REG_TYPE cspinmask, rspinmask;
#endif // #ifdef __ESP8266_EX__
};
#endif
diff --git a/Sming/Makefile b/Sming/Makefile
index 9119cfe618..1cfb9db6d2 100644
--- a/Sming/Makefile
+++ b/Sming/Makefile
@@ -148,9 +148,10 @@ endif
# name for the target project
TARGET = app
-
CUSTOM_TARGETS ?=
+ARDUINO_LIBRARIES = $(shell git submodule status Libraries | cut -c2- | cut -f2 -d ' ' | sed -r 's/Libraries\/(.*?)/Libraries\/\1\/library.properties/g' )
+
# which modules (subdirectories) of the project to include in compiling
MODULES = system system/helpers Wiring appinit \
$(sort $(dir $(wildcard SmingCore/*/ SmingCore/*/*/ SmingCore/*/*/*/))) \
@@ -227,7 +228,8 @@ endif
MFORCE32 := $(shell $(CC) --help=target | grep mforce-l32)
# compiler flags using during compilation of source files. Add '-pg' for debugging
-CFLAGS = -Wpointer-arith -Wundef -Werror -Wl,-EL -nostdlib -mlongcalls -mtext-section-literals -finline-functions -fdata-sections -ffunction-sections -D__ets__ -DICACHE_FLASH -DARDUINO=106 -DCOM_SPEED_SERIAL=$(COM_SPEED_SERIAL) -DENABLE_CMD_EXECUTOR=$(ENABLE_CMD_EXECUTOR)
+CFLAGS = -Wpointer-arith -Wundef -Werror -Wl,-EL -nostdlib -mlongcalls -mtext-section-literals -finline-functions -fdata-sections -ffunction-sections \
+ -D__ets__ -DICACHE_FLASH -DARDUINO=106 -DCOM_SPEED_SERIAL=$(COM_SPEED_SERIAL) -DENABLE_CMD_EXECUTOR=$(ENABLE_CMD_EXECUTOR) -DESP8266=1
ifeq ($(SMING_RELEASE),1)
# See: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
# for full list of optimization options
@@ -402,7 +404,7 @@ endif
$(Q) cp -r $(APP_AR) $(USER_LIBDIR)/$(LIBSMING).a
$(vecho) "Done"
-checkdirs: $(THIRD_PARTY_DATA) reload $(BUILD_DIR) $(FW_BASE) $(CUSTOM_TARGETS)
+checkdirs: $(ARDUINO_LIBRARIES) $(THIRD_PARTY_DATA) reload $(BUILD_DIR) $(FW_BASE) $(CUSTOM_TARGETS)
$(BUILD_DIR):
$(Q) mkdir -p $@
@@ -462,6 +464,16 @@ third-party/%:
# For now we solve this by "reloading" the makefile after fetching a module.
RELOAD_MKFILE=1
+Libraries/%:
+ $(vecho) "Fetching Arduino Library $(dir $@) ..."
+ $(Q) $(GIT) submodule update --init --recursive $(dir $@)
+ $(Q) touch $(patsubst Libraries/%/,Libraries/.patches/%.patch, $(dir $@))
+ $(Q) -cd $(dir $@); $(GIT) apply -v $(patsubst Libraries/%/,$(SMING_HOME)/Libraries/.patches/%.patch, $(dir $@)) --ignore-whitespace --whitespace=nowarn
+# if the new submodule brings source code files that need to be compiled inside Sming
+# then we need somehow to be able to "see" these new files.
+# For now we solve this by "reloading" the makefile after fetching a module.
+ RELOAD_MKFILE=1
+
reload:
$(Q) if [ $(RELOAD_MKFILE) -eq 1 ]; then \
$(MAKE) -C $(SMING_HOME) $(MAKECMDGOALS) RELOAD_MKFILE=0; \
@@ -482,8 +494,12 @@ third-party-clean:
rm -rf third-party/$$dir; \
done
$(Q) $(GIT) checkout third-party
+
+libraries-clean:
+ $(Q) rm -rf Libraries
+ $(Q) $(GIT) checkout Libraries
-dist-clean: clean samples-clean third-party-clean
+dist-clean: clean samples-clean third-party-clean libraries-clean
$(Q) for file in $(shell ls $(USER_LIBDIR)/lib*.a ); do \
rm $$file; \
done
diff --git a/Sming/Makefile-project.mk b/Sming/Makefile-project.mk
index b75f059596..52090080b9 100644
--- a/Sming/Makefile-project.mk
+++ b/Sming/Makefile-project.mk
@@ -178,7 +178,10 @@ ifeq ($(ENABLE_CUSTOM_LWIP), 1)
LWIP_INCDIR = $(SMING_HOME)/third-party/esp-open-lwip/include
endif
-EXTRA_INCDIR += $(SMING_HOME)/include $(SMING_HOME)/ $(LWIP_INCDIR) $(SMING_HOME)/system/include $(SMING_HOME)/Wiring $(SMING_HOME)/Libraries $(SMING_HOME)/SmingCore $(SMING_HOME)/Services/SpifFS $(SDK_BASE)/../include $(THIRD_PARTY_DIR)/rboot $(THIRD_PARTY_DIR)/rboot/appcode $(THIRD_PARTY_DIR)/spiffs/src
+EXTRA_INCDIR += $(SMING_HOME)/include $(SMING_HOME)/ $(LWIP_INCDIR) $(SMING_HOME)/system/include \
+ $(SMING_HOME)/Wiring $(SMING_HOME)/Libraries $(SMING_HOME)/Libraries/Adafruit_GFX \
+ $(SMING_HOME)/SmingCore $(SMING_HOME)/Services/SpifFS $(SDK_BASE)/../include \
+ $(THIRD_PARTY_DIR)/rboot $(THIRD_PARTY_DIR)/rboot/appcode $(THIRD_PARTY_DIR)/spiffs/src
ENABLE_CUSTOM_HEAP ?= 0
diff --git a/Sming/Makefile-rboot.mk b/Sming/Makefile-rboot.mk
index df6b5d3552..32ab0599c3 100644
--- a/Sming/Makefile-rboot.mk
+++ b/Sming/Makefile-rboot.mk
@@ -186,7 +186,10 @@ ifeq ($(ENABLE_CUSTOM_LWIP), 1)
LWIP_INCDIR = $(SMING_HOME)/third-party/esp-open-lwip/include
endif
-EXTRA_INCDIR += $(SMING_HOME)/include $(SMING_HOME)/ $(LWIP_INCDIR) $(SMING_HOME)/system/include $(SMING_HOME)/Wiring $(SMING_HOME)/Libraries $(SMING_HOME)/SmingCore $(SMING_HOME)/Services/SpifFS $(SDK_BASE)/../include $(THIRD_PARTY_DIR)/rboot $(THIRD_PARTY_DIR)/rboot/appcode $(THIRD_PARTY_DIR)/spiffs/src
+EXTRA_INCDIR += $(SMING_HOME)/include $(SMING_HOME)/ $(LWIP_INCDIR) $(SMING_HOME)/system/include \
+ $(SMING_HOME)/Wiring $(SMING_HOME)/Libraries $(SMING_HOME)/Libraries/Adafruit_GFX \
+ $(SMING_HOME)/SmingCore $(SMING_HOME)/Services/SpifFS $(SDK_BASE)/../include \
+ $(THIRD_PARTY_DIR)/rboot $(THIRD_PARTY_DIR)/rboot/appcode $(THIRD_PARTY_DIR)/spiffs/src
USER_LIBDIR = $(SMING_HOME)/compiler/lib/
diff --git a/Sming/SmingCore/ArduinoCompat.cpp b/Sming/SmingCore/ArduinoCompat.cpp
new file mode 100644
index 0000000000..9af706db18
--- /dev/null
+++ b/Sming/SmingCore/ArduinoCompat.cpp
@@ -0,0 +1,21 @@
+/****
+ * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
+ * Created 2015 by Skurydin Alexey
+ * http://github.com/anakod/Sming
+ * All files of the Sming Core are provided under the LGPL v3 license.
+ *
+ * Arduino Compatibility Layer
+ *
+ * @author: 2017 - Slavey Karadzhov
+ *
+ ****/
+
+#include "ArduinoCompat.h"
+
+/**
+ * @brief This method just feeds the software watchdog. It does not really switch the programming context as yield in Arduino does.
+ */
+void yield()
+{
+ system_soft_wdt_feed();
+}
diff --git a/Sming/SmingCore/ArduinoCompat.h b/Sming/SmingCore/ArduinoCompat.h
new file mode 100644
index 0000000000..02ce660e25
--- /dev/null
+++ b/Sming/SmingCore/ArduinoCompat.h
@@ -0,0 +1,29 @@
+/****
+ * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
+ * Created 2015 by Skurydin Alexey
+ * http://github.com/anakod/Sming
+ * All files of the Sming Core are provided under the LGPL v3 license.
+ *
+ * Arduino Compatibility Layer
+ *
+ * @author: 2017 - Slavey Karadzhov
+ *
+ ****/
+
+#ifndef SMINGCORE_ARDUINOCOMPAT_H_
+#define SMINGCORE_ARDUINOCOMPAT_H_
+
+#include "SmingCore.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void yield();
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* SMINGCORE_ARDUINOCOMPAT_H_ */
diff --git a/Sming/SmingCore/pgmspace.h b/Sming/SmingCore/pgmspace.h
new file mode 100644
index 0000000000..311e0cfd0e
--- /dev/null
+++ b/Sming/SmingCore/pgmspace.h
@@ -0,0 +1,2 @@
+#include "SmingCore.h"
+#include "../Wiring/FakePgmSpace.h"
diff --git a/Sming/SmingCore/pins_arduino.h b/Sming/SmingCore/pins_arduino.h
index d674601df7..a7a0e7a05a 100644
--- a/Sming/SmingCore/pins_arduino.h
+++ b/Sming/SmingCore/pins_arduino.h
@@ -10,6 +10,8 @@
#ifndef WIRING_PINS_ARDUINO_H_
#define WIRING_PINS_ARDUINO_H_
+#include "espinc/peri.h"
+
extern const unsigned int A0; // Single ESP8266EX analog input pin (TOUT) 10 bit, 0..1v
#define NOT_A_PIN 0
@@ -20,23 +22,16 @@ extern const unsigned int A0; // Single ESP8266EX analog input pin (TOUT) 10 bit
#define PB 2
#define PC 3
-#define GPIO_REG_TYPE uint8_t
+#define GPIO_REG_TYPE uint32_t
// We use maximum compatibility to standard Arduino logic.
-// Conversion disabled for now
-#define digitalPinToTimer(P) ( NOT_ON_TIMER )
-
-#define digitalPinToPort(P) ( P < 0 ? NOT_A_PIN : ( (int)P < 8 ? PA : ( (int)P < 16 ? PB : ( (int)P == 16 ? PC : NOT_A_PIN ) ) ) )
-#define digitalPinToBitMask(P) ( (int)P < 8 ? _BV((int)P) : ( P < 16 ? _BV( (int)P-8 ) : 1) )
-
-#define STD_GPIO_OUT (PERIPHS_GPIO_BASEADDR + GPIO_OUT_ADDRESS)
-#define STD_GPIO_IN (PERIPHS_GPIO_BASEADDR + GPIO_IN_ADDRESS)
-#define STD_GPIO_ENABLE (PERIPHS_GPIO_BASEADDR + GPIO_ENABLE_ADDRESS)
-
-#define portOutputRegister(P) ( ((volatile uint8_t*)(P != PC ? STD_GPIO_OUT : RTC_GPIO_OUT)) + ( ( ((int)P) == PB ) ? 1 : 0) )
-#define portInputRegister(P) ( ((volatile uint8_t*)(P != PC ? STD_GPIO_IN : RTC_GPIO_IN_DATA)) + ( ( ((int)P) == PB ) ? 1 : 0) )
-#define portModeRegister(P) ( ((volatile uint8_t*)(P != PC ? STD_GPIO_ENABLE : RTC_GPIO_ENABLE)) + ( ( ((int)P) == PB ) ? 1 : 0) ) // Stored bits: 0=In, 1=Out
+#define digitalPinToPort(pin) (0)
+#define digitalPinToBitMask(pin) (1UL << (pin))
+#define digitalPinToTimer(pin) (NOT_ON_TIMER)
+#define portOutputRegister(port) ((volatile uint32_t*) &GPO)
+#define portInputRegister(port) ((volatile uint32_t*) &GPI)
+#define portModeRegister(port) ((volatile uint32_t*) &GPE)
#endif /* WIRING_PINS_ARDUINO_H_ */
diff --git a/Sming/Wiring/Arduino.h b/Sming/Wiring/Arduino.h
index 67443b59d4..efb7103798 100644
--- a/Sming/Wiring/Arduino.h
+++ b/Sming/Wiring/Arduino.h
@@ -6,6 +6,7 @@
#include "../include/user_config.h"
#include "../Wiring/WiringFrameworkDependencies.h"
#include "../SmingCore/SmingCore.h"
+#include "../SmingCore/ArduinoCompat.h"
#endif /* INCLUDE_ARDUINO_H_ */
From c381740da7b9d8e8ca90f1762be80c54bf178019 Mon Sep 17 00:00:00 2001
From: slaff
Date: Sun, 15 Oct 2017 21:11:32 +0200
Subject: [PATCH 24/50] Http(Client|Server): moved code out of IRAM. No visual
performance slow downs. Freed IRAM. (#1260)
---
Sming/SmingCore/Network/Http/HttpConnection.h | 18 +++++++++---------
.../Network/Http/HttpServerConnection.h | 14 +++++++-------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/Sming/SmingCore/Network/Http/HttpConnection.h b/Sming/SmingCore/Network/Http/HttpConnection.h
index 019f71ee74..10c950aa6d 100644
--- a/Sming/SmingCore/Network/Http/HttpConnection.h
+++ b/Sming/SmingCore/Network/Http/HttpConnection.h
@@ -85,19 +85,19 @@ class HttpConnection : protected TcpClient {
void cleanup();
private:
- static int IRAM_ATTR staticOnMessageBegin(http_parser* parser);
+ static int staticOnMessageBegin(http_parser* parser);
#ifndef COMPACT_MODE
- static int IRAM_ATTR staticOnStatus(http_parser *parser, const char *at, size_t length);
+ static int staticOnStatus(http_parser *parser, const char *at, size_t length);
#endif
- static int IRAM_ATTR staticOnHeadersComplete(http_parser* parser);
- static int IRAM_ATTR staticOnHeaderField(http_parser *parser, const char *at, size_t length);
- static int IRAM_ATTR staticOnHeaderValue(http_parser *parser, const char *at, size_t length);
- static int IRAM_ATTR staticOnBody(http_parser *parser, const char *at, size_t length);
+ static int staticOnHeadersComplete(http_parser* parser);
+ static int staticOnHeaderField(http_parser *parser, const char *at, size_t length);
+ static int staticOnHeaderValue(http_parser *parser, const char *at, size_t length);
+ static int staticOnBody(http_parser *parser, const char *at, size_t length);
#ifndef COMPACT_MODE
- static int IRAM_ATTR staticOnChunkHeader(http_parser* parser);
- static int IRAM_ATTR staticOnChunkComplete(http_parser* parser);
+ static int staticOnChunkHeader(http_parser* parser);
+ static int staticOnChunkComplete(http_parser* parser);
#endif
- static int IRAM_ATTR staticOnMessageComplete(http_parser* parser);
+ static int staticOnMessageComplete(http_parser* parser);
void sendRequestHeaders(HttpRequest* request);
bool sendRequestBody(HttpRequest* request);
diff --git a/Sming/SmingCore/Network/Http/HttpServerConnection.h b/Sming/SmingCore/Network/Http/HttpServerConnection.h
index e9f0818de2..534df786d5 100644
--- a/Sming/SmingCore/Network/Http/HttpServerConnection.h
+++ b/Sming/SmingCore/Network/Http/HttpServerConnection.h
@@ -56,13 +56,13 @@ class HttpServerConnection: public TcpClient
const char * getStatus(enum http_status s);
private:
- static int IRAM_ATTR staticOnMessageBegin(http_parser* parser);
- static int IRAM_ATTR staticOnPath(http_parser *parser, const char *at, size_t length);
- static int IRAM_ATTR staticOnHeadersComplete(http_parser* parser);
- static int IRAM_ATTR staticOnHeaderField(http_parser *parser, const char *at, size_t length);
- static int IRAM_ATTR staticOnHeaderValue(http_parser *parser, const char *at, size_t length);
- static int IRAM_ATTR staticOnBody(http_parser *parser, const char *at, size_t length);
- static int IRAM_ATTR staticOnMessageComplete(http_parser* parser);
+ static int staticOnMessageBegin(http_parser* parser);
+ static int staticOnPath(http_parser *parser, const char *at, size_t length);
+ static int staticOnHeadersComplete(http_parser* parser);
+ static int staticOnHeaderField(http_parser *parser, const char *at, size_t length);
+ static int staticOnHeaderValue(http_parser *parser, const char *at, size_t length);
+ static int staticOnBody(http_parser *parser, const char *at, size_t length);
+ static int staticOnMessageComplete(http_parser* parser);
void sendResponseHeaders(HttpResponse* response);
bool sendResponseBody(HttpResponse* response);
From 6ac7c4ab57502a7d610f9e0aea4beb94ff192527 Mon Sep 17 00:00:00 2001
From: slaff
Date: Mon, 16 Oct 2017 21:56:59 +0200
Subject: [PATCH 25/50] Allow also polling to trigger sending of http client
data. (#1261)
---
.../SmingCore/Network/Http/HttpConnection.cpp | 49 ++++++++++++-------
Sming/SmingCore/Network/Http/HttpRequest.cpp | 2 +-
Sming/SmingCore/Network/Http/HttpRequest.h | 2 +-
Sming/SmingCore/Network/HttpServer.h | 11 ++++-
4 files changed, 42 insertions(+), 22 deletions(-)
diff --git a/Sming/SmingCore/Network/Http/HttpConnection.cpp b/Sming/SmingCore/Network/Http/HttpConnection.cpp
index 403069b02b..4f02c837d8 100644
--- a/Sming/SmingCore/Network/Http/HttpConnection.cpp
+++ b/Sming/SmingCore/Network/Http/HttpConnection.cpp
@@ -24,7 +24,8 @@
bool HttpConnection::parserSettingsInitialized = false;
http_parser_settings HttpConnection::parserSettings;
-HttpConnection::HttpConnection(RequestQueue* queue): TcpClient(false), mode(eHCM_String) {
+HttpConnection::HttpConnection(RequestQueue* queue): TcpClient(false), mode(eHCM_String)
+{
this->waitingQueue = queue;
http_parser_init(&parser, HTTP_RESPONSE);
@@ -55,7 +56,8 @@ HttpConnection::HttpConnection(RequestQueue* queue): TcpClient(false), mode(eHCM
}
}
-bool HttpConnection::connect(const String& host, int port, bool useSsl /* = false */, uint32_t sslOptions /* = 0 */) {
+bool HttpConnection::connect(const String& host, int port, bool useSsl /* = false */, uint32_t sslOptions /* = 0 */)
+{
debugf("HttpConnection::connect: TCP state: %d, isStarted: %d, isActive: %d", (tcp != NULL? tcp->state : -1), (int)(getConnectionState() != eTCS_Ready), (int)isActive());
@@ -76,7 +78,8 @@ bool HttpConnection::connect(const String& host, int port, bool useSsl /* = fals
return TcpClient::connect(host, port, useSsl, sslOptions);
}
-bool HttpConnection::isActive() {
+bool HttpConnection::isActive()
+{
if(tcp == NULL) {
return false;
}
@@ -278,7 +281,8 @@ int HttpConnection::staticOnHeadersComplete(http_parser* parser)
}
#ifndef COMPACT_MODE
-int HttpConnection::staticOnStatus(http_parser *parser, const char *at, size_t length) {
+int HttpConnection::staticOnStatus(http_parser *parser, const char *at, size_t length)
+{
return 0;
}
#endif
@@ -348,22 +352,21 @@ int HttpConnection::staticOnBody(http_parser *parser, const char *at, size_t len
}
#ifndef COMPACT_MODE
-int HttpConnection::staticOnChunkHeader(http_parser* parser) {
+int HttpConnection::staticOnChunkHeader(http_parser* parser)
+{
debugf("On chunk header");
return 0;
}
-int HttpConnection::staticOnChunkComplete(http_parser* parser) {
+int HttpConnection::staticOnChunkComplete(http_parser* parser)
+{
debugf("On chunk complete");
return 0;
}
#endif
-void HttpConnection::onReadyToSendData(TcpConnectionEvent sourceEvent) {
-
- if(!(sourceEvent == eTCE_Connected || sourceEvent == eTCE_Sent)) {
- return;
- }
+void HttpConnection::onReadyToSendData(TcpConnectionEvent sourceEvent)
+{
debugf("HttpConnection::onReadyToSendData: waitingQueue.count: %d", waitingQueue->count());
@@ -434,7 +437,8 @@ void HttpConnection::onReadyToSendData(TcpConnectionEvent sourceEvent) {
TcpClient::onReadyToSendData(sourceEvent);
}
-void HttpConnection::sendRequestHeaders(HttpRequest* request) {
+void HttpConnection::sendRequestHeaders(HttpRequest* request)
+{
sendString(http_method_str(request->method) + String(" ") + request->uri.getPathWithQuery() + " HTTP/1.1\r\nHost: " + request->uri.Host + "\r\n");
// TODO: represent the post params as stream ...
@@ -469,7 +473,8 @@ void HttpConnection::sendRequestHeaders(HttpRequest* request) {
sendString("\r\n");
}
-bool HttpConnection::sendRequestBody(HttpRequest* request) {
+bool HttpConnection::sendRequestBody(HttpRequest* request)
+{
if(state == eHCS_StartBody) {
state = eHCS_SendingBody;
// if there is input raw data -> send it
@@ -520,11 +525,13 @@ bool HttpConnection::sendRequestBody(HttpRequest* request) {
return true;
}
-HttpRequest* HttpConnection::getRequest() {
+HttpRequest* HttpConnection::getRequest()
+{
return incomingRequest;
}
-HttpResponse* HttpConnection::getResponse() {
+HttpResponse* HttpConnection::getResponse()
+{
HttpResponse* response = new HttpResponse();
response->code = code;
response->headers = responseHeaders;
@@ -548,7 +555,8 @@ HttpResponse* HttpConnection::getResponse() {
// end of public methods for HttpConnection
-err_t HttpConnection::onReceive(pbuf *buf) {
+err_t HttpConnection::onReceive(pbuf *buf)
+{
if (buf == NULL)
{
// Disconnected, close it
@@ -584,12 +592,14 @@ err_t HttpConnection::onReceive(pbuf *buf) {
return ERR_OK;
}
-void HttpConnection::onError(err_t err) {
+void HttpConnection::onError(err_t err)
+{
cleanup();
TcpClient::onError(err);
}
-void HttpConnection::cleanup() {
+void HttpConnection::cleanup()
+{
// TODO: clean the current request
reset();
@@ -601,7 +611,8 @@ void HttpConnection::cleanup() {
}
}
-HttpConnection::~HttpConnection() {
+HttpConnection::~HttpConnection()
+{
cleanup();
}
diff --git a/Sming/SmingCore/Network/Http/HttpRequest.cpp b/Sming/SmingCore/Network/Http/HttpRequest.cpp
index c11de48432..722609b35b 100644
--- a/Sming/SmingCore/Network/Http/HttpRequest.cpp
+++ b/Sming/SmingCore/Network/Http/HttpRequest.cpp
@@ -56,7 +56,7 @@ HttpRequest::~HttpRequest() {
stream = NULL;
}
-HttpRequest* HttpRequest::setURL(URL uri) {
+HttpRequest* HttpRequest::setURL(const URL& uri) {
this->uri = uri;
return this;
}
diff --git a/Sming/SmingCore/Network/Http/HttpRequest.h b/Sming/SmingCore/Network/Http/HttpRequest.h
index 59de80a991..1156fb30d5 100644
--- a/Sming/SmingCore/Network/Http/HttpRequest.h
+++ b/Sming/SmingCore/Network/Http/HttpRequest.h
@@ -41,7 +41,7 @@ class HttpRequest {
HttpRequest& operator = (const HttpRequest& rhs);
~HttpRequest();
- HttpRequest* setURL(URL uri);
+ HttpRequest* setURL(const URL& uri);
HttpRequest* setMethod(const HttpMethod method);
diff --git a/Sming/SmingCore/Network/HttpServer.h b/Sming/SmingCore/Network/HttpServer.h
index dfb68a555a..02f6c00c4a 100644
--- a/Sming/SmingCore/Network/HttpServer.h
+++ b/Sming/SmingCore/Network/HttpServer.h
@@ -49,11 +49,20 @@ class HttpServer: public TcpServer
HttpServer(HttpServerSettings settings);
virtual ~HttpServer();
- /*
+ /**
* @brief Allows changing the server configuration
*/
void configure(HttpServerSettings settings);
+ /**
+ * @briefs Allows content-type specific parsing of the body based on content-type.
+ *
+ * @param const String& contentType. Can be full content-type like 'application/json', or 'application/*' or '*'.
+ * If there is exact match for the content-type wildcard content-types will not be used.
+ * There can be only one catch-all '*' body parser and that will be the last registered
+ *
+ * @param HttpBodyParserDelegate parser
+ */
void setBodyParser(const String& contentType, HttpBodyParserDelegate parser);
/**
From 77cc289a5a7e4d33ccca073c0dd6f9970e9aec84 Mon Sep 17 00:00:00 2001
From: slaff
Date: Wed, 18 Oct 2017 10:20:07 +0200
Subject: [PATCH 26/50] HttpServer:WebSocket support: (#1265)
- Fixes #1262
- Fixed memory leak(s).
Core: Added "endless" memory stream.
---
Sming/SmingCore/DataSourceStream.cpp | 62 +++++++++++++++++++
Sming/SmingCore/DataSourceStream.h | 38 +++++++++++-
Sming/SmingCore/Network/Http/HttpResource.h | 4 ++
.../Network/Http/HttpServerConnection.cpp | 3 +
.../Http/Websocket/WebSocketConnection.cpp | 25 ++++----
.../Http/Websocket/WebSocketConnection.h | 6 +-
.../Http/Websocket/WebsocketResource.cpp | 8 ++-
.../Http/Websocket/WebsocketResource.h | 2 +
8 files changed, 130 insertions(+), 18 deletions(-)
diff --git a/Sming/SmingCore/DataSourceStream.cpp b/Sming/SmingCore/DataSourceStream.cpp
index 070e0bb051..7cc53ceef7 100644
--- a/Sming/SmingCore/DataSourceStream.cpp
+++ b/Sming/SmingCore/DataSourceStream.cpp
@@ -133,6 +133,9 @@ uint16_t FileStream::readMemoryBlock(char* data, int bufSize)
int len = min(bufSize, size - pos);
int available = fileRead(handle, data, len);
fileSeek(handle, pos, eSO_FileStart); // Don't move cursor now (waiting seek)
+ if(available < 0) {
+ available = 0;
+ }
return available;
}
@@ -359,3 +362,62 @@ int JsonObjectStream::length()
return rootNode.measureLength();
}
+
+EndlessMemoryStream::~EndlessMemoryStream()
+{
+ delete stream;
+ stream = NULL;
+}
+
+StreamType EndlessMemoryStream::getStreamType()
+{
+ return eSST_Memory;
+}
+
+uint16_t EndlessMemoryStream::readMemoryBlock(char* data, int bufSize)
+{
+ if(stream == NULL) {
+ return 0;
+ }
+
+ return stream->readMemoryBlock(data, bufSize);
+}
+
+//Use base class documentation
+bool EndlessMemoryStream::seek(int len)
+{
+ if(stream == NULL) {
+ return false;
+ }
+
+ int res = stream->seek(len);
+ if(stream->isFinished()) {
+ delete stream;
+ stream = NULL;
+ }
+
+ return res;
+}
+
+size_t EndlessMemoryStream::write(uint8_t charToWrite)
+{
+ if(stream == NULL) {
+ stream = new MemoryDataStream();
+ }
+
+ return stream->write(charToWrite);
+}
+
+size_t EndlessMemoryStream::write(const uint8_t *buffer, size_t size)
+{
+ if(stream == NULL) {
+ stream = new MemoryDataStream();
+ }
+
+ return stream->write(buffer, size);
+}
+
+bool EndlessMemoryStream::isFinished()
+{
+ return false;
+}
diff --git a/Sming/SmingCore/DataSourceStream.h b/Sming/SmingCore/DataSourceStream.h
index e0b2a48cc1..e9c7fbcadf 100644
--- a/Sming/SmingCore/DataSourceStream.h
+++ b/Sming/SmingCore/DataSourceStream.h
@@ -98,7 +98,7 @@ class ReadWriteStream : public IDataSourceStream
/** @brief Write chars to stream
* @param buffer Pointer to buffer to write to the stream
- * @param size Quantity of chars to writen
+ * @param size Quantity of chars to write
* @retval size_t Quantity of chars written to stream
*/
virtual size_t write(const uint8_t *buffer, size_t size) = 0;
@@ -145,7 +145,7 @@ class MemoryDataStream : public Print, public ReadWriteStream
/** @brief Write chars to stream
* @param buffer Pointer to buffer to write to the stream
- * @param size Quantity of chars to writen
+ * @param size Quantity of chars to write
* @retval size_t Quantity of chars written to stream
*/
virtual size_t write(const uint8_t *buffer, size_t size);
@@ -256,7 +256,7 @@ class TemplateFileStream : public FileStream
/** @brief Set value of a variable in the template file
* @param name Name of variable
* @param value Value to assign to the variable
- * @note Sets and existing varible or adds a new variable if variable does not already exist
+ * @note Sets and existing variable or adds a new variable if variable does not already exist
*/
void setVar(String name, String value);
@@ -317,5 +317,37 @@ class JsonObjectStream : public MemoryDataStream
bool send;
};
+class EndlessMemoryStream: public ReadWriteStream
+{
+public:
+ virtual ~EndlessMemoryStream();
+
+ //Use base class documentation
+ virtual StreamType getStreamType();
+
+ virtual uint16_t readMemoryBlock(char* data, int bufSize);
+
+ //Use base class documentation
+ virtual bool seek(int len);
+
+ /** @brief Write a single char to stream
+ * @param charToWrite Char to write to the stream
+ * @retval size_t Quantity of chars written to stream (always 1)
+ */
+ virtual size_t write(uint8_t charToWrite);
+
+ /** @brief Write chars to stream
+ * @param buffer Pointer to buffer to write to the stream
+ * @param size Quantity of chars to write
+ * @retval size_t Quantity of chars written to stream
+ */
+ virtual size_t write(const uint8_t *buffer, size_t size);
+
+ virtual bool isFinished();
+
+private:
+ MemoryDataStream* stream = NULL;
+};
+
/** @} */
#endif /* _SMING_CORE_DATASTREAM_H_ */
diff --git a/Sming/SmingCore/Network/Http/HttpResource.h b/Sming/SmingCore/Network/Http/HttpResource.h
index 4dc6078906..ffcd885977 100644
--- a/Sming/SmingCore/Network/Http/HttpResource.h
+++ b/Sming/SmingCore/Network/Http/HttpResource.h
@@ -30,6 +30,10 @@ typedef Delegate HttpPathDelegate; // << depr
class HttpResource {
public:
virtual ~HttpResource() {}
+ /**
+ * @brief Takes care to cleanup the connection
+ */
+ virtual void shutdown(HttpServerConnection& connection) {}
public:
HttpServerConnectionBodyDelegate onBody = 0; // << called when the resource wants to process the raw body data
diff --git a/Sming/SmingCore/Network/Http/HttpServerConnection.cpp b/Sming/SmingCore/Network/Http/HttpServerConnection.cpp
index 4dc2c14185..6857e4954f 100644
--- a/Sming/SmingCore/Network/Http/HttpServerConnection.cpp
+++ b/Sming/SmingCore/Network/Http/HttpServerConnection.cpp
@@ -46,6 +46,9 @@ HttpServerConnection::HttpServerConnection(tcp_pcb *clientTcp)
HttpServerConnection::~HttpServerConnection()
{
+ if(this->resource) {
+ this->resource->shutdown(*this);
+ }
}
void HttpServerConnection::setResourceTree(ResourceTree* resourceTree)
diff --git a/Sming/SmingCore/Network/Http/Websocket/WebSocketConnection.cpp b/Sming/SmingCore/Network/Http/Websocket/WebSocketConnection.cpp
index 274a1070d0..4fa6aefa83 100644
--- a/Sming/SmingCore/Network/Http/Websocket/WebSocketConnection.cpp
+++ b/Sming/SmingCore/Network/Http/Websocket/WebSocketConnection.cpp
@@ -18,7 +18,7 @@ WebSocketConnection::WebSocketConnection(HttpServerConnection* conn)
WebSocketConnection::~WebSocketConnection()
{
- websocketList.removeElement(*this);
+ websocketList.removeElement(this);
}
bool WebSocketConnection::initialize(HttpRequest& request, HttpResponse& response)
@@ -41,9 +41,11 @@ bool WebSocketConnection::initialize(HttpRequest& request, HttpResponse& respons
response.setHeader("Upgrade", "websocket");
response.setHeader("Sec-WebSocket-Accept", secure);
- connection->userData = (void *)this;
+ delete stream;
+ stream = new EndlessMemoryStream();
+ response.sendDataStream(stream);
- websocketList.addElement(*this);
+ connection->userData = (void *)this;
memset(&parserSettings, 0, sizeof(parserSettings));
parserSettings.on_data_begin = staticOnDataBegin;
@@ -56,6 +58,7 @@ bool WebSocketConnection::initialize(HttpRequest& request, HttpResponse& respons
ws_parser_init(&parser, &parserSettings);
parser.user_data = (void*)this;
+ websocketList.addElement(this);
if(wsConnect) {
wsConnect(*this);
}
@@ -152,19 +155,21 @@ int WebSocketConnection::staticOnControlEnd(void* userData)
void WebSocketConnection::send(const char* message, int length, wsFrameType type /* = WS_TEXT_FRAME*/)
{
+ if(stream == NULL) {
+ return;
+ }
+
uint8_t frameHeader[16] = {0};
size_t headSize = sizeof(frameHeader);
wsMakeFrame(nullptr, length, frameHeader, &headSize, type);
- connection->send((const char* )frameHeader, (uint16_t )headSize);
- if(length > 0) {
- connection->send((const char* )message, (uint16_t )length);
- }
+ stream->write((uint8_t *)frameHeader, (uint16_t )headSize);
+ stream->write((uint8_t *)message, (uint16_t )length);
}
void WebSocketConnection::broadcast(const char* message, int length, wsFrameType type /* = WS_TEXT_FRAME*/)
{
for (int i = 0; i < websocketList.count(); i++) {
- websocketList[i].send(message, length, type);
+ websocketList[i]->send(message, length, type);
}
}
@@ -190,9 +195,8 @@ WebSocketsList& WebSocketConnection::getActiveWebSockets()
void WebSocketConnection::close()
{
- websocketList.removeElement((const WebSocketConnection)*this);
+ websocketList.removeElement(this);
state = eWSCS_Closed;
-
if(wsDisconnect) {
wsDisconnect(*this);
}
@@ -210,7 +214,6 @@ void* WebSocketConnection::getUserData()
return userData;
}
-
void WebSocketConnection::setConnectionHandler(WebSocketDelegate handler)
{
wsConnect = handler;
diff --git a/Sming/SmingCore/Network/Http/Websocket/WebSocketConnection.h b/Sming/SmingCore/Network/Http/Websocket/WebSocketConnection.h
index 0412fb3140..dc90541c19 100644
--- a/Sming/SmingCore/Network/Http/Websocket/WebSocketConnection.h
+++ b/Sming/SmingCore/Network/Http/Websocket/WebSocketConnection.h
@@ -17,7 +17,7 @@ extern "C" {
class WebSocketConnection;
-typedef Vector WebSocketsList;
+typedef Vector WebSocketsList;
typedef Delegate WebSocketDelegate;
typedef Delegate WebSocketMessageDelegate;
@@ -89,9 +89,9 @@ class WebSocketConnection
ws_parser_t parser;
ws_parser_callbacks_t parserSettings;
-// @deprecated
static WebSocketsList websocketList;
-// @end deprecated
+
+ EndlessMemoryStream* stream = NULL;
};
#endif /* SMINGCORE_NETWORK_WEBSOCKETCONNECTION_H_ */
diff --git a/Sming/SmingCore/Network/Http/Websocket/WebsocketResource.cpp b/Sming/SmingCore/Network/Http/Websocket/WebsocketResource.cpp
index bc487ad8e5..5b404766dd 100644
--- a/Sming/SmingCore/Network/Http/Websocket/WebsocketResource.cpp
+++ b/Sming/SmingCore/Network/Http/Websocket/WebsocketResource.cpp
@@ -32,13 +32,19 @@ int WebsocketResource::checkHeaders(HttpServerConnection& connection, HttpReques
}
connection.setTimeOut(USHRT_MAX); //Disable disconnection on connection idle (no rx/tx)
- connection.userData = (void *)socket;
// TODO: Re-Enable Command Executor...
return 0;
}
+void WebsocketResource::shutdown(HttpServerConnection& connection)
+{
+ WebSocketConnection* socket = (WebSocketConnection *)connection.userData;
+ delete socket;
+ connection.userData = NULL;
+}
+
int WebsocketResource::processData(HttpServerConnection& connection, HttpRequest& request, char *at, int size)
{
WebSocketConnection *socket = (WebSocketConnection *)connection.userData;
diff --git a/Sming/SmingCore/Network/Http/Websocket/WebsocketResource.h b/Sming/SmingCore/Network/Http/Websocket/WebsocketResource.h
index e69359993d..fe1ae89c08 100644
--- a/Sming/SmingCore/Network/Http/Websocket/WebsocketResource.h
+++ b/Sming/SmingCore/Network/Http/Websocket/WebsocketResource.h
@@ -20,6 +20,8 @@ class WebsocketResource: public HttpResource {
int checkHeaders(HttpServerConnection& connection, HttpRequest& request, HttpResponse& response);
int processData(HttpServerConnection& connection, HttpRequest& request, char *at, int size);
+ virtual void shutdown(HttpServerConnection& connection);
+
void setConnectionHandler(WebSocketDelegate handler);
void setMessageHandler(WebSocketMessageDelegate handler);
void setBinaryHandler(WebSocketBinaryDelegate handler);
From be670971c9ff735031143790057a16d11a5d5165 Mon Sep 17 00:00:00 2001
From: slaff
Date: Thu, 19 Oct 2017 09:42:42 +0200
Subject: [PATCH 27/50] Allow also poll to trigger sending of data. (#1266)
---
Sming/SmingCore/Network/Http/HttpServerConnection.cpp | 4 ----
1 file changed, 4 deletions(-)
diff --git a/Sming/SmingCore/Network/Http/HttpServerConnection.cpp b/Sming/SmingCore/Network/Http/HttpServerConnection.cpp
index 6857e4954f..3baa6afdf9 100644
--- a/Sming/SmingCore/Network/Http/HttpServerConnection.cpp
+++ b/Sming/SmingCore/Network/Http/HttpServerConnection.cpp
@@ -368,10 +368,6 @@ err_t HttpServerConnection::onReceive(pbuf *buf)
void HttpServerConnection::onReadyToSendData(TcpConnectionEvent sourceEvent)
{
- if(sourceEvent == eTCE_Poll) {
- return;
- }
-
if(state == eHCS_Sent) {
state = eHCS_Ready;
}
From 09be6f481bb3d1f048f5ae7aca7ead8d4932ad48 Mon Sep 17 00:00:00 2001
From: slaff
Date: Fri, 20 Oct 2017 11:42:28 +0200
Subject: [PATCH 28/50] HttpServer: WS: Fixed calling twice wsDisconnect
callback. (#1267)
---
.../Http/Websocket/WebSocketConnection.cpp | 22 ++++++++++++-------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/Sming/SmingCore/Network/Http/Websocket/WebSocketConnection.cpp b/Sming/SmingCore/Network/Http/Websocket/WebSocketConnection.cpp
index 4fa6aefa83..a8c72b781f 100644
--- a/Sming/SmingCore/Network/Http/Websocket/WebSocketConnection.cpp
+++ b/Sming/SmingCore/Network/Http/Websocket/WebSocketConnection.cpp
@@ -18,7 +18,9 @@ WebSocketConnection::WebSocketConnection(HttpServerConnection* conn)
WebSocketConnection::~WebSocketConnection()
{
- websocketList.removeElement(this);
+ state = eWSCS_Closed;
+ stream = NULL;
+ close();
}
bool WebSocketConnection::initialize(HttpRequest& request, HttpResponse& response)
@@ -58,7 +60,10 @@ bool WebSocketConnection::initialize(HttpRequest& request, HttpResponse& respons
ws_parser_init(&parser, &parserSettings);
parser.user_data = (void*)this;
- websocketList.addElement(this);
+ if(!websocketList.contains(this)) {
+ websocketList.addElement(this);
+ }
+
if(wsConnect) {
wsConnect(*this);
}
@@ -123,9 +128,6 @@ int WebSocketConnection::staticOnControlBegin(void* userData, ws_frame_type_t ty
connection->controlFrameType = type;
if (type == WS_FRAME_CLOSE) {
- if(connection->wsDisconnect) {
- connection->wsDisconnect(*connection);
- }
connection->close();
}
@@ -196,9 +198,13 @@ WebSocketsList& WebSocketConnection::getActiveWebSockets()
void WebSocketConnection::close()
{
websocketList.removeElement(this);
- state = eWSCS_Closed;
- if(wsDisconnect) {
- wsDisconnect(*this);
+ if(state != eWSCS_Closed) {
+ state = eWSCS_Closed;
+ send((const char* )NULL, 0, WS_CLOSING_FRAME);
+ stream = NULL;
+ if(wsDisconnect) {
+ wsDisconnect(*this);
+ }
}
connection->setTimeOut(1);
From a1bca65d9636a711099de5a84293fb9d0609cfdc Mon Sep 17 00:00:00 2001
From: slaff
Date: Fri, 20 Oct 2017 11:50:33 +0200
Subject: [PATCH 29/50] Changed the testing MQTT server. (#1268)
---
samples/MqttClient_Hello/app/application.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/samples/MqttClient_Hello/app/application.cpp b/samples/MqttClient_Hello/app/application.cpp
index b534d8f43f..216104d85c 100644
--- a/samples/MqttClient_Hello/app/application.cpp
+++ b/samples/MqttClient_Hello/app/application.cpp
@@ -15,7 +15,7 @@
// ... and/or MQTT host and port
#ifndef MQTT_HOST
- #define MQTT_HOST "test.mosquitto.org"
+ #define MQTT_HOST "attachix.com"
#ifndef ENABLE_SSL
#define MQTT_PORT 1883
#else
From e0d987556aa1486e5fb0c026091f9494f6afc004 Mon Sep 17 00:00:00 2001
From: slaff
Date: Wed, 25 Oct 2017 19:47:24 +0200
Subject: [PATCH 30/50] Changed a TcpClient message to be less confusing.
(#1271)
---
Sming/SmingCore/Network/TcpClient.cpp | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/Sming/SmingCore/Network/TcpClient.cpp b/Sming/SmingCore/Network/TcpClient.cpp
index b327af36eb..cfc72c1301 100644
--- a/Sming/SmingCore/Network/TcpClient.cpp
+++ b/Sming/SmingCore/Network/TcpClient.cpp
@@ -46,11 +46,8 @@ TcpClient::TcpClient(TcpClientDataDelegate onReceive)
TcpClient::~TcpClient()
{
- if (stream != NULL)
- {
- delete[] stream;
- stream = NULL;
- }
+ delete stream;
+ stream = NULL;
}
bool TcpClient::connect(String server, int port, boolean useSsl /* = false */, uint32_t sslOptions /* = 0 */)
@@ -178,7 +175,7 @@ void TcpClient::pushAsyncPart()
if (stream->isFinished())
{
flush();
- debugf("TcpClient request completed");
+ debugf("TcpClient stream finished");
delete stream; // Free memory now!
stream = NULL;
}
From 932af744e4c246121072e1c4fbf98bbddf7b00f6 Mon Sep 17 00:00:00 2001
From: frankdownunder
Date: Wed, 1 Nov 2017 21:22:24 +1100
Subject: [PATCH 31/50] Fix Memory Leak in Mqtt (#1273)
---
Sming/Services/libemqtt/libemqtt.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Sming/Services/libemqtt/libemqtt.c b/Sming/Services/libemqtt/libemqtt.c
index 28a97a14c6..de86c37525 100644
--- a/Sming/Services/libemqtt/libemqtt.c
+++ b/Sming/Services/libemqtt/libemqtt.c
@@ -215,6 +215,7 @@ int mqtt_set_clientid(mqtt_broker_handle_t* broker, const char* clientid) {
int mqtt_init_auth(mqtt_broker_handle_t* broker, const char* username, const char* password) {
if(username && username[0] != '\0') {
+ free(broker->username);
broker->username = (char *)malloc(strlen(username)+1);
if(broker->username==NULL) {
return -1;
@@ -224,6 +225,7 @@ int mqtt_init_auth(mqtt_broker_handle_t* broker, const char* username, const cha
}
if(password && password[0] != '\0') {
+ free(broker->username);
broker->password = (char *)malloc(strlen(password)+1);
if (broker->password == NULL) {
return -1;
From c2687b9ebc4147055d4d46c323d3408fcca31312 Mon Sep 17 00:00:00 2001
From: frankdownunder
Date: Mon, 6 Nov 2017 06:08:00 +1100
Subject: [PATCH 32/50] Mqtt memory fix: Fix copy and paste error (#1276)
---
Sming/Services/libemqtt/libemqtt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Sming/Services/libemqtt/libemqtt.c b/Sming/Services/libemqtt/libemqtt.c
index de86c37525..0278f2c4b3 100644
--- a/Sming/Services/libemqtt/libemqtt.c
+++ b/Sming/Services/libemqtt/libemqtt.c
@@ -225,7 +225,7 @@ int mqtt_init_auth(mqtt_broker_handle_t* broker, const char* username, const cha
}
if(password && password[0] != '\0') {
- free(broker->username);
+ free(broker->password);
broker->password = (char *)malloc(strlen(password)+1);
if (broker->password == NULL) {
return -1;
From f09b9e7bf2cd43de616295109b495b7a636dd0f4 Mon Sep 17 00:00:00 2001
From: slaff
Date: Mon, 6 Nov 2017 04:37:54 -0800
Subject: [PATCH 33/50] Preparation for release 3.4.0. (#1277)
---
Readme.md | 2 +-
Sming/SmingCore/SmingCore.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Readme.md b/Readme.md
index 274774e2a2..7780969bee 100644
--- a/Readme.md
+++ b/Readme.md
@@ -43,7 +43,7 @@ SDK = Software Development Kit
n/a = The selected SDK is not available on that OS
## Latest Stable Release
-- [Sming V3.3.0](https://github.com/SmingHub/Sming/releases/tag/3.3.0)
+- [Sming V3.4.0](https://github.com/SmingHub/Sming/releases/tag/3.4.0)
## Getting started
- [Windows](https://github.com/SmingHub/Sming/wiki/Windows-Quickstart)
diff --git a/Sming/SmingCore/SmingCore.h b/Sming/SmingCore/SmingCore.h
index cc5de45cd6..ae33fe81c7 100644
--- a/Sming/SmingCore/SmingCore.h
+++ b/Sming/SmingCore/SmingCore.h
@@ -8,7 +8,7 @@
#ifndef _NET_WIRING_
#define _NET_WIRING_
-#define SMING_VERSION "3.3.0" // Major Minor Sub
+#define SMING_VERSION "3.4.0" // Major Minor Sub
#include "../Wiring/WiringFrameworkIncludes.h"
From 89ac9a7eef61d8756dd82bb74b451951f2cfa000 Mon Sep 17 00:00:00 2001
From: slaff
Date: Wed, 8 Nov 2017 03:45:53 -0800
Subject: [PATCH 34/50] Reverted: m_printf: stacksize reduced #1097. (#1279)
Was causing instability probably due to infinite loop.
Related to #1274.
---
Sming/system/m_printf.cpp | 38 ++++++++++++++++++++------------------
1 file changed, 20 insertions(+), 18 deletions(-)
diff --git a/Sming/system/m_printf.cpp b/Sming/system/m_printf.cpp
index 507f873e00..03971661ab 100644
--- a/Sming/system/m_printf.cpp
+++ b/Sming/system/m_printf.cpp
@@ -9,7 +9,7 @@ Descr: embedded very simple version of printf with float support
#include
#include "osapi.h"
-#define INITIAL_BUFFSIZE 128
+#define MPRINTF_BUF_SIZE 256
static void defaultPrintChar(uart_t *uart, char c) {
return uart_tx_one_char(c);
@@ -62,25 +62,27 @@ int m_snprintf(char* buf, int length, const char *fmt, ...)
return n;
}
-int m_vprintf(const char *fmt, va_list va)
+int m_vprintf ( const char * format, va_list arg )
{
- size_t size = INITIAL_BUFFSIZE - 1;
-
- // need to retry if size is not big enough
- while (1) {
- char buffer[size + 1];
- size_t sz = m_vsnprintf(buffer, sizeof(buffer), fmt, va);
- if (sz > size) {
- size = sz;
- continue;
- }
+ if(!cbc_printchar)
+ {
+ return 0;
+ }
- const char *p = buffer;
- while (char c = *p++) {
- cbc_printchar(cbc_printchar_uart, c);
- }
- return sz;
- }
+ char buf[MPRINTF_BUF_SIZE], *p;
+
+ int n = 0;
+ m_vsnprintf(buf, sizeof(buf), format, arg);
+
+ p = buf;
+ while (p && n < sizeof(buf) && *p)
+ {
+ cbc_printchar(cbc_printchar_uart, *p);
+ n++;
+ p++;
+ }
+
+ return n;
}
/**
From c7e4099f7b0538a0f358f652cae894d742319970 Mon Sep 17 00:00:00 2001
From: bbourdel
Date: Wed, 8 Nov 2017 15:31:21 +0100
Subject: [PATCH 35/50] fix/MemoryLeak(Heap) during TCP Client connection and
delete
Not really sure of this fix. But on my side, it's help to solve Memory Leak when I call httpClient.cleanup(). (About 50Bytes losed each time)
---
Sming/SmingCore/Network/HttpClient.cpp | 34 +++++++++++++++++++++--
Sming/SmingCore/Network/HttpClient.h | 4 ++-
Sming/SmingCore/Network/TcpClient.cpp | 7 +++--
Sming/SmingCore/Network/TcpConnection.cpp | 6 ++++
4 files changed, 46 insertions(+), 5 deletions(-)
diff --git a/Sming/SmingCore/Network/HttpClient.cpp b/Sming/SmingCore/Network/HttpClient.cpp
index 0ef64dc0de..2f87b182ee 100644
--- a/Sming/SmingCore/Network/HttpClient.cpp
+++ b/Sming/SmingCore/Network/HttpClient.cpp
@@ -115,17 +115,47 @@ void HttpClient::freeSslSessionPool() {
free(sslSessionIdPool[key]->value);
}
free(sslSessionIdPool[key]->value);
+ free(sslSessionIdPool[key]);
}
sslSessionIdPool.clear();
}
#endif
+
+void HttpClient::freeRequestQueue() {
+ for(int i=0; i< queue.count(); i ++) {
+ debugf("~RquestQueue");
+ String key = queue.keyAt(i);
+ RequestQueue* rq = queue[key];
+ HttpRequest* req_to_del = rq->dequeue();
+ while(req_to_del != NULL){
+ debugf("~Request");
+ delete req_to_del;
+ req_to_del = rq->dequeue();
+ }
+ queue[key]->flush();
+ delete queue[key]; // Delete the FIFO list of request (does it delete request too ?)
+ }
+ queue.clear();
+}
+
+
+void HttpClient::freeHttpConnectionPool() {
+ for(int i=0; i< httpConnectionPool.count(); i ++) {
+ String key = httpConnectionPool.keyAt(i);
+ delete httpConnectionPool[key];
+ httpConnectionPool[key] = NULL;
+ httpConnectionPool.remove(key);
+ }
+ httpConnectionPool.clear();
+}
+
void HttpClient::cleanup() {
#ifdef ENABLE_SSL
freeSslSessionPool();
#endif
- httpConnectionPool.clear();
- queue.clear();
+ freeHttpConnectionPool();
+ freeRequestQueue();
}
diff --git a/Sming/SmingCore/Network/HttpClient.h b/Sming/SmingCore/Network/HttpClient.h
index afca2fe1ee..a76bf28249 100644
--- a/Sming/SmingCore/Network/HttpClient.h
+++ b/Sming/SmingCore/Network/HttpClient.h
@@ -79,6 +79,8 @@ class HttpClient
#ifdef ENABLE_SSL
static void freeSslSessionPool();
#endif
+ static void freeHttpConnectionPool();
+ static void freeRequestQueue();
/**
* Use this method to clean all request queues and object pools
@@ -100,4 +102,4 @@ class HttpClient
};
/** @} */
-#endif /* _SMING_CORE_NETWORK_HTTPCLIENT_H_ */
+#endif /* _SMING_CORE_NETWORK_HTTPCLIENT_H_ */
\ No newline at end of file
diff --git a/Sming/SmingCore/Network/TcpClient.cpp b/Sming/SmingCore/Network/TcpClient.cpp
index cfc72c1301..d4f9c8469d 100644
--- a/Sming/SmingCore/Network/TcpClient.cpp
+++ b/Sming/SmingCore/Network/TcpClient.cpp
@@ -46,8 +46,11 @@ TcpClient::TcpClient(TcpClientDataDelegate onReceive)
TcpClient::~TcpClient()
{
- delete stream;
- stream = NULL;
+ if (stream != NULL)
+ {
+ delete[] stream;
+ stream = NULL;
+ }
}
bool TcpClient::connect(String server, int port, boolean useSsl /* = false */, uint32_t sslOptions /* = 0 */)
diff --git a/Sming/SmingCore/Network/TcpConnection.cpp b/Sming/SmingCore/Network/TcpConnection.cpp
index f29399a53e..dab2b52185 100644
--- a/Sming/SmingCore/Network/TcpConnection.cpp
+++ b/Sming/SmingCore/Network/TcpConnection.cpp
@@ -36,6 +36,12 @@ TcpConnection::~TcpConnection()
delete[] sslFingerprint.pkSha256;
}
freeSslClientKeyCert();
+ if(ssl_ext != NULL) {
+ debugf("SSL not null");
+ ssl_ext_free(ssl_ext);
+ }
+
+
#endif
debugf("~TCP connection");
}
From 6efe04f570f9cf172409791c8ec37568a09b90c7 Mon Sep 17 00:00:00 2001
From: Slavey Karadzhov
Date: Wed, 8 Nov 2017 17:57:00 +0100
Subject: [PATCH 36/50] TcpConnection fixes related to ssl extensions. Styling
fixes for HttpClient.
---
Sming/SmingCore/Network/HttpClient.cpp | 44 ++++++++++++-----------
Sming/SmingCore/Network/TcpClient.cpp | 7 ++--
Sming/SmingCore/Network/TcpConnection.cpp | 26 ++++++--------
Sming/SmingCore/Network/TcpConnection.h | 2 +-
4 files changed, 37 insertions(+), 42 deletions(-)
diff --git a/Sming/SmingCore/Network/HttpClient.cpp b/Sming/SmingCore/Network/HttpClient.cpp
index 2f87b182ee..eb58bda9fc 100644
--- a/Sming/SmingCore/Network/HttpClient.cpp
+++ b/Sming/SmingCore/Network/HttpClient.cpp
@@ -13,7 +13,8 @@
#include "HttpClient.h"
/* Low Level Methods */
-bool HttpClient::send(HttpRequest* request) {
+bool HttpClient::send(HttpRequest* request)
+{
String cacheKey = getCacheKey(request->uri);
bool useSsl = (request->uri.Protocol == HTTPS_URL_PROTOCOL);
@@ -65,7 +66,8 @@ bool HttpClient::send(HttpRequest* request) {
// Convenience methods
-bool HttpClient::downloadString(const String& url, RequestCompletedDelegate requestComplete) {
+bool HttpClient::downloadString(const String& url, RequestCompletedDelegate requestComplete)
+{
return send(request(url)
->setMethod(HTTP_GET)
->onRequestComplete(requestComplete)
@@ -98,7 +100,8 @@ bool HttpClient::downloadFile(const String& url, const String& saveFileName, Req
// end convenience methods
-HttpRequest* HttpClient::request(const String& url) {
+HttpRequest* HttpClient::request(const String& url)
+{
return new HttpRequest(URL(url));
}
@@ -108,7 +111,8 @@ HashMap HttpClient::queue;
#ifdef ENABLE_SSL
HashMap HttpClient::sslSessionIdPool;
-void HttpClient::freeSslSessionPool() {
+void HttpClient::freeSslSessionPool()
+{
for(int i=0; i< sslSessionIdPool.count(); i ++) {
String key = sslSessionIdPool.keyAt(i);
if(sslSessionIdPool[key]->value != NULL) {
@@ -121,26 +125,24 @@ void HttpClient::freeSslSessionPool() {
}
#endif
-
-void HttpClient::freeRequestQueue() {
+void HttpClient::freeRequestQueue()
+{
for(int i=0; i< queue.count(); i ++) {
- debugf("~RquestQueue");
String key = queue.keyAt(i);
- RequestQueue* rq = queue[key];
- HttpRequest* req_to_del = rq->dequeue();
- while(req_to_del != NULL){
- debugf("~Request");
- delete req_to_del;
- req_to_del = rq->dequeue();
+ RequestQueue* requestQueue = queue[key];
+ HttpRequest* request = requestQueue->dequeue();
+ while(request != NULL){
+ delete request;
+ request = requestQueue->dequeue();
}
queue[key]->flush();
- delete queue[key]; // Delete the FIFO list of request (does it delete request too ?)
+ delete queue[key];
}
queue.clear();
}
-
-void HttpClient::freeHttpConnectionPool() {
+void HttpClient::freeHttpConnectionPool()
+{
for(int i=0; i< httpConnectionPool.count(); i ++) {
String key = httpConnectionPool.keyAt(i);
delete httpConnectionPool[key];
@@ -150,7 +152,8 @@ void HttpClient::freeHttpConnectionPool() {
httpConnectionPool.clear();
}
-void HttpClient::cleanup() {
+void HttpClient::cleanup()
+{
#ifdef ENABLE_SSL
freeSslSessionPool();
#endif
@@ -158,11 +161,12 @@ void HttpClient::cleanup() {
freeRequestQueue();
}
-
-HttpClient::~HttpClient() {
+HttpClient::~HttpClient()
+{
}
-String HttpClient::getCacheKey(URL url) {
+String HttpClient::getCacheKey(URL url)
+{
return String(url.Host) + ":" + String(url.Port);
}
diff --git a/Sming/SmingCore/Network/TcpClient.cpp b/Sming/SmingCore/Network/TcpClient.cpp
index d4f9c8469d..cfc72c1301 100644
--- a/Sming/SmingCore/Network/TcpClient.cpp
+++ b/Sming/SmingCore/Network/TcpClient.cpp
@@ -46,11 +46,8 @@ TcpClient::TcpClient(TcpClientDataDelegate onReceive)
TcpClient::~TcpClient()
{
- if (stream != NULL)
- {
- delete[] stream;
- stream = NULL;
- }
+ delete stream;
+ stream = NULL;
}
bool TcpClient::connect(String server, int port, boolean useSsl /* = false */, uint32_t sslOptions /* = 0 */)
diff --git a/Sming/SmingCore/Network/TcpConnection.cpp b/Sming/SmingCore/Network/TcpConnection.cpp
index dab2b52185..1ce1d02f1d 100644
--- a/Sming/SmingCore/Network/TcpConnection.cpp
+++ b/Sming/SmingCore/Network/TcpConnection.cpp
@@ -36,12 +36,6 @@ TcpConnection::~TcpConnection()
delete[] sslFingerprint.pkSha256;
}
freeSslClientKeyCert();
- if(ssl_ext != NULL) {
- debugf("SSL not null");
- ssl_ext_free(ssl_ext);
- }
-
-
#endif
debugf("~TCP connection");
}
@@ -57,15 +51,15 @@ bool TcpConnection::connect(String server, int port, bool useSsl /* = false */,
#ifdef ENABLE_SSL
this->sslOptions |= sslOptions;
- if(ssl_ext != NULL) {
- ssl_ext_free(ssl_ext);
+ if(sslExtension != NULL) {
+ ssl_ext_free(sslExtension);
}
- ssl_ext = ssl_ext_new();
- ssl_ext->host_name = (char *)malloc(server.length() + 1);
- strcpy(ssl_ext->host_name, server.c_str());
+ sslExtension = ssl_ext_new();
+ sslExtension->host_name = (char *)malloc(server.length() + 1);
+ strcpy(sslExtension->host_name, server.c_str());
- ssl_ext->max_fragment_size = 4*1024; // 4K max size
+ sslExtension->max_fragment_size = 4*1024; // 4K max size
#endif
debugf("connect to: %s", server.c_str());
@@ -166,11 +160,11 @@ void TcpConnection::onError(err_t err)
{
#ifdef ENABLE_SSL
if(ssl) {
-// ssl_ctx_free(sslContext);
- ssl_free(ssl);
+ sslConnected = false;
+ ssl_free(ssl); // ssl_free frees internally also the SSL context and the SSL extension data
sslContext=nullptr;
+ sslExtension = NULL;
ssl=nullptr;
- sslConnected = false;
}
#endif
debugf("TCP connection error: %d", err);
@@ -457,7 +451,7 @@ err_t TcpConnection::staticOnConnected(void *arg, tcp_pcb *tcp, err_t err)
con->ssl = ssl_client_new(con->sslContext, clientfd,
(con->sslSessionId != NULL ? con->sslSessionId->value : NULL),
(con->sslSessionId != NULL ? con->sslSessionId->length: 0),
- con->ssl_ext
+ con->sslExtension
);
if(ssl_handshake_status(con->ssl)!=SSL_OK) {
debugf("SSL: handshake is in progress...");
diff --git a/Sming/SmingCore/Network/TcpConnection.h b/Sming/SmingCore/Network/TcpConnection.h
index a902e3b55a..f53ef3dfeb 100644
--- a/Sming/SmingCore/Network/TcpConnection.h
+++ b/Sming/SmingCore/Network/TcpConnection.h
@@ -224,7 +224,7 @@ class TcpConnection
#ifdef ENABLE_SSL
SSL *ssl = nullptr;
SSLCTX *sslContext = nullptr;
- SSL_EXTENSIONS *ssl_ext=NULL;
+ SSL_EXTENSIONS *sslExtension=NULL;
SSLFingerprints sslFingerprint;
bool sslConnected = false;
uint32_t sslOptions=0;
From 30e7d6b0bcb788ede5a10be51a74a5d66c8fe67e Mon Sep 17 00:00:00 2001
From: slaff
Date: Sat, 11 Nov 2017 12:15:14 +0100
Subject: [PATCH 37/50] Allow shutting down of TcpServers (#1284)
* Delete the server only after all connections are closed and deleted.
* Added command to test remotely server shutdown.
* It should be possible to shut down cleanly all servers that inherit from TcpServer.
---
Sming/SmingCore/Network/HttpServer.cpp | 21 +++----
Sming/SmingCore/Network/HttpServer.h | 2 -
Sming/SmingCore/Network/TcpConnection.cpp | 30 +++++++---
Sming/SmingCore/Network/TcpConnection.h | 13 +++++
Sming/SmingCore/Network/TcpServer.cpp | 55 ++++++++++++++++++-
Sming/SmingCore/Network/TcpServer.h | 8 ++-
.../HttpServer_WebSockets/app/application.cpp | 8 +++
7 files changed, 112 insertions(+), 25 deletions(-)
diff --git a/Sming/SmingCore/Network/HttpServer.cpp b/Sming/SmingCore/Network/HttpServer.cpp
index fa2e2b8ae5..9ad31c89ee 100644
--- a/Sming/SmingCore/Network/HttpServer.cpp
+++ b/Sming/SmingCore/Network/HttpServer.cpp
@@ -26,7 +26,8 @@ HttpServer::HttpServer(HttpServerSettings settings)
configure(settings);
}
-void HttpServer::configure(HttpServerSettings settings) {
+void HttpServer::configure(HttpServerSettings settings)
+{
this->settings = settings;
if(settings.minHeapSize != -1 && settings.minHeapSize > -1) {
minHeapSize = settings.minHeapSize;
@@ -61,10 +62,6 @@ TcpConnection* HttpServer::createClient(tcp_pcb *clientTcp)
HttpServerConnection* con = new HttpServerConnection(clientTcp);
con->setResourceTree(&resourceTree);
con->setBodyParsers(&bodyParsers);
- con->setCompleteDelegate(TcpClientCompleteDelegate(&HttpServer::onConnectionClose, this));
-
- totalConnections++;
- debugf("Opening connection. Total connections: %d", totalConnections);
return con;
}
@@ -85,21 +82,19 @@ void HttpServer::setDefaultHandler(const HttpPathDelegate& callback)
addPath("*", callback);
}
-void HttpServer::addPath(const String& path, const HttpResourceDelegate& onRequestComplete) {
+void HttpServer::addPath(const String& path, const HttpResourceDelegate& onRequestComplete)
+{
HttpResource* resource = new HttpResource;
resource->onRequestComplete = onRequestComplete;
resourceTree[path] = resource;
}
-void HttpServer::addPath(const String& path, HttpResource* resource) {
+void HttpServer::addPath(const String& path, HttpResource* resource)
+{
resourceTree[path] = resource;
}
-void HttpServer::setDefaultResource(HttpResource* resource) {
+void HttpServer::setDefaultResource(HttpResource* resource)
+{
addPath("*", resource);
}
-
-void HttpServer::onConnectionClose(TcpClient& connection, bool success) {
- totalConnections--;
- debugf("Closing connection. Total connections: %d", totalConnections);
-}
diff --git a/Sming/SmingCore/Network/HttpServer.h b/Sming/SmingCore/Network/HttpServer.h
index 02f6c00c4a..f688aa80ec 100644
--- a/Sming/SmingCore/Network/HttpServer.h
+++ b/Sming/SmingCore/Network/HttpServer.h
@@ -77,10 +77,8 @@ class HttpServer: public TcpServer
void setDefaultHandler(const HttpPathDelegate& callback);
void setDefaultResource(HttpResource* resource);
-
protected:
virtual TcpConnection* createClient(tcp_pcb *clientTcp);
- virtual void onConnectionClose(TcpClient& connection, bool success);
protected:
#ifdef ENABLE_SSL
diff --git a/Sming/SmingCore/Network/TcpConnection.cpp b/Sming/SmingCore/Network/TcpConnection.cpp
index f29399a53e..aa9d342ba9 100644
--- a/Sming/SmingCore/Network/TcpConnection.cpp
+++ b/Sming/SmingCore/Network/TcpConnection.cpp
@@ -38,6 +38,10 @@ TcpConnection::~TcpConnection()
freeSslClientKeyCert();
#endif
debugf("~TCP connection");
+
+ if(destroyedDelegate) {
+ destroyedDelegate(*this);
+ }
}
bool TcpConnection::connect(String server, int port, bool useSsl /* = false */, uint32_t sslOptions /* = 0 */)
@@ -698,12 +702,19 @@ void TcpConnection::staticDnsResponse(const char *name, ip_addr_t *ipaddr, void
delete dlook;
}
+void TcpConnection::setDestroyedDelegate(TcpConnectionDestroyedDelegate destroyedDelegate)
+{
+ this->destroyedDelegate = destroyedDelegate;
+}
+
#ifdef ENABLE_SSL
-void TcpConnection::addSslOptions(uint32_t sslOptions) {
+void TcpConnection::addSslOptions(uint32_t sslOptions)
+{
this->sslOptions |= sslOptions;
}
-bool TcpConnection::pinCertificate(const uint8_t *fingerprint, SslFingerprintType type, bool freeAfterHandshake /* = false */) {
+bool TcpConnection::pinCertificate(const uint8_t *fingerprint, SslFingerprintType type, bool freeAfterHandshake /* = false */)
+{
int length = 0;
uint8_t *localStore;
@@ -749,7 +760,8 @@ bool TcpConnection::pinCertificate(const uint8_t *fingerprint, SslFingerprintTyp
return true;
}
-bool TcpConnection::pinCertificate(SSLFingerprints fingerprints, bool freeAfterHandshake /* = false */) {
+bool TcpConnection::pinCertificate(SSLFingerprints fingerprints, bool freeAfterHandshake /* = false */)
+{
sslFingerprint = fingerprints;
freeFingerprints = freeAfterHandshake;
return true;
@@ -757,7 +769,8 @@ bool TcpConnection::pinCertificate(SSLFingerprints fingerprints, bool freeAfterH
bool TcpConnection::setSslClientKeyCert(const uint8_t *key, int keyLength,
const uint8_t *certificate, int certificateLength,
- const char *keyPassword /* = NULL */, bool freeAfterHandshake /* = false */) {
+ const char *keyPassword /* = NULL */, bool freeAfterHandshake /* = false */)
+{
clientKeyCert.key = new uint8_t[keyLength];
@@ -785,14 +798,16 @@ bool TcpConnection::setSslClientKeyCert(const uint8_t *key, int keyLength,
return true;
}
-bool TcpConnection::setSslClientKeyCert(SSLKeyCertPair clientKeyCert, bool freeAfterHandshake /* = false */) {
+bool TcpConnection::setSslClientKeyCert(SSLKeyCertPair clientKeyCert, bool freeAfterHandshake /* = false */)
+{
this->clientKeyCert = clientKeyCert;
freeClientKeyCert = freeAfterHandshake;
return true;
}
-void TcpConnection::freeSslClientKeyCert() {
+void TcpConnection::freeSslClientKeyCert()
+{
if(clientKeyCert.key) {
delete[] clientKeyCert.key;
clientKeyCert.key = NULL;
@@ -812,7 +827,8 @@ void TcpConnection::freeSslClientKeyCert() {
clientKeyCert.certificateLength = 0;
}
-void TcpConnection::freeSslFingerprints() {
+void TcpConnection::freeSslFingerprints()
+{
if(sslFingerprint.certSha1) {
delete[] sslFingerprint.certSha1;
sslFingerprint.certSha1 = NULL;
diff --git a/Sming/SmingCore/Network/TcpConnection.h b/Sming/SmingCore/Network/TcpConnection.h
index a902e3b55a..932e4dc7fe 100644
--- a/Sming/SmingCore/Network/TcpConnection.h
+++ b/Sming/SmingCore/Network/TcpConnection.h
@@ -20,6 +20,7 @@
#include "../Wiring/WiringFrameworkDependencies.h"
#include "IPAddress.h"
+#include "../Delegate.h"
#define NETWORK_DEBUG
@@ -71,6 +72,9 @@ class String;
class IDataSourceStream;
class IPAddress;
class TcpServer;
+class TcpConnection;
+
+typedef Delegate TcpConnectionDestroyedDelegate;
class TcpConnection
{
@@ -99,6 +103,12 @@ class TcpConnection
IPAddress getRemoteIp() { return (tcp == NULL) ? INADDR_NONE : IPAddress(tcp->remote_ip);};
uint16_t getRemotePort() { return (tcp == NULL) ? 0 : tcp->remote_port; };
+ /**
+ * @brief Sets a callback to be called when the object instance is destroyed
+ * @param TcpServerConnectionDestroyedDelegate destroyedDelegate - callback
+ */
+ void setDestroyedDelegate(TcpConnectionDestroyedDelegate destroyedDelegate);
+
#ifdef ENABLE_SSL
void addSslOptions(uint32_t sslOptions);
@@ -234,6 +244,9 @@ class TcpConnection
SSLSessionId* sslSessionId = NULL;
#endif
bool useSsl = false;
+
+private:
+ TcpConnectionDestroyedDelegate destroyedDelegate = 0;
};
/** @} */
diff --git a/Sming/SmingCore/Network/TcpServer.cpp b/Sming/SmingCore/Network/TcpServer.cpp
index 828d725563..32362f2d70 100644
--- a/Sming/SmingCore/Network/TcpServer.cpp
+++ b/Sming/SmingCore/Network/TcpServer.cpp
@@ -63,6 +63,11 @@ TcpConnection* TcpServer::createClient(tcp_pcb *clientTcp)
debugf("TCP Server createClient not NULL");
}
+ if(!active) {
+ debugf("Refusing new connections. The server is shutting down");
+ return NULL;
+ }
+
TcpConnection* con = new TcpClient(clientTcp,
TcpClientDataDelegate(&TcpServer::onClientReceive,this),
TcpClientCompleteDelegate(&TcpServer::onClientComplete,this));
@@ -83,7 +88,8 @@ void TcpServer::setTimeOut(uint16_t waitTimeOut)
}
#ifdef ENABLE_SSL
-void TcpServer::setServerKeyCert(SSLKeyCertPair serverKeyCert) {
+void TcpServer::setServerKeyCert(SSLKeyCertPair serverKeyCert)
+{
clientKeyCert = serverKeyCert;
}
#endif
@@ -148,7 +154,7 @@ err_t TcpServer::onAccept(tcp_pcb *clientTcp, err_t err)
}
#ifdef NETWORK_DEBUG
- debugf("onAccept state: %d K=%d", err, totalConnections);
+ debugf("onAccept state: %d K=%d", err, connections.count());
list_mem();
#endif
@@ -177,6 +183,11 @@ err_t TcpServer::onAccept(tcp_pcb *clientTcp, err_t err)
}
#endif
+ client->setDestroyedDelegate(TcpConnectionDestroyedDelegate(&TcpServer::onClientDestroy, this));
+
+ connections.add(client);
+ debugf("Opening connection. Total connections: %d", connections.count());
+
onClient((TcpClient*)client);
return ERR_OK;
@@ -231,3 +242,43 @@ err_t TcpServer::staticAccept(void *arg, tcp_pcb *new_tcp, err_t err)
err_t res = con->onAccept(new_tcp, err);
return res;
}
+
+
+void TcpServer::shutdown()
+{
+ active = false;
+
+ debugf("Shutting down the server ...");
+
+ if(tcp) {
+ tcp_arg(tcp, NULL);
+ tcp_accept(tcp, NULL);
+ tcp_close(tcp);
+
+ tcp = NULL;
+ }
+
+ for(int i=0; i < connections.count(); i++) {
+ TcpConnection* connection = connections[i];
+ if(connection == NULL) {
+ continue;
+ }
+
+ connection->setTimeOut(1);
+ }
+}
+
+void TcpServer::onClientDestroy(TcpConnection& connection)
+{
+ connections.removeElement((TcpConnection*)&connection);
+ debugf("Destroying connection. Total connections: %d", connections.count());
+
+ if(active) {
+ return;
+ }
+
+ if(connections.count() == 0) {
+ debugf("Server is destroyed.");
+ delete this;
+ }
+}
diff --git a/Sming/SmingCore/Network/TcpServer.h b/Sming/SmingCore/Network/TcpServer.h
index f70d69b171..39e88d36a4 100644
--- a/Sming/SmingCore/Network/TcpServer.h
+++ b/Sming/SmingCore/Network/TcpServer.h
@@ -33,6 +33,8 @@ class TcpServer: public TcpConnection {
virtual bool listen(int port, bool useSsl = false);
void setTimeOut(uint16_t waitTimeOut);
+ void shutdown();
+
#ifdef ENABLE_SSL
/**
* @brief Adds SSL support and specifies the server certificate and private key.
@@ -46,8 +48,9 @@ class TcpServer: public TcpConnection {
virtual err_t onAccept(tcp_pcb *clientTcp, err_t err);
virtual void onClient(TcpClient *client);
- virtual void onClientComplete(TcpClient& client, bool succesfull);
virtual bool onClientReceive (TcpClient& client, char *data, int size);
+ virtual void onClientComplete(TcpClient& client, bool succesfull);
+ virtual void onClientDestroy(TcpConnection& connection);
static err_t staticAccept(void *arg, tcp_pcb *new_tcp, err_t err);
@@ -62,6 +65,9 @@ class TcpServer: public TcpConnection {
int sslSessionCacheSize = 50;
#endif
+ bool active = true;
+ Vector connections;
+
private:
uint16_t timeOut;
TcpClientDataDelegate clientReceiveDelegate = NULL;
diff --git a/samples/HttpServer_WebSockets/app/application.cpp b/samples/HttpServer_WebSockets/app/application.cpp
index 24876d8b7a..3ed79853f5 100644
--- a/samples/HttpServer_WebSockets/app/application.cpp
+++ b/samples/HttpServer_WebSockets/app/application.cpp
@@ -52,6 +52,14 @@ void wsConnected(WebSocketConnection& socket)
void wsMessageReceived(WebSocketConnection& socket, const String& message)
{
Serial.printf("WebSocket message received:\r\n%s\r\n", message.c_str());
+
+ if(message == "shutdown") {
+ String message = "The server is shutting down...";
+ socket.broadcast(message.c_str(), message.length());
+ server.shutdown();
+ return;
+ }
+
String response = "Echo: " + message;
socket.sendString(response);
From 086795a711108ded827c2c550f4382f81fc6b741 Mon Sep 17 00:00:00 2001
From: Slavey Karadzhov
Date: Mon, 13 Nov 2017 10:44:48 +0100
Subject: [PATCH 38/50] Deleting an HttpClient should result in freeing the
total memory it uses.
---
Sming/SmingCore/Network/HttpClient.cpp | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/Sming/SmingCore/Network/HttpClient.cpp b/Sming/SmingCore/Network/HttpClient.cpp
index eb58bda9fc..29340277e2 100644
--- a/Sming/SmingCore/Network/HttpClient.cpp
+++ b/Sming/SmingCore/Network/HttpClient.cpp
@@ -115,11 +115,10 @@ void HttpClient::freeSslSessionPool()
{
for(int i=0; i< sslSessionIdPool.count(); i ++) {
String key = sslSessionIdPool.keyAt(i);
- if(sslSessionIdPool[key]->value != NULL) {
- free(sslSessionIdPool[key]->value);
- }
free(sslSessionIdPool[key]->value);
+ sslSessionIdPool[key]->value = NULL;
free(sslSessionIdPool[key]);
+ sslSessionIdPool[key] = NULL;
}
sslSessionIdPool.clear();
}
@@ -163,7 +162,7 @@ void HttpClient::cleanup()
HttpClient::~HttpClient()
{
-
+ cleanup();
}
String HttpClient::getCacheKey(URL url)
From 8fe38882bd1ab452f9f5b3e5de6eba3a65d997e3 Mon Sep 17 00:00:00 2001
From: slaff
Date: Tue, 14 Nov 2017 08:36:26 +0100
Subject: [PATCH 39/50] Allow immediate server deletion if there are no active
connections. (#1285)
---
Sming/SmingCore/Network/TcpServer.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/Sming/SmingCore/Network/TcpServer.cpp b/Sming/SmingCore/Network/TcpServer.cpp
index 32362f2d70..f8deae3ff0 100644
--- a/Sming/SmingCore/Network/TcpServer.cpp
+++ b/Sming/SmingCore/Network/TcpServer.cpp
@@ -50,6 +50,7 @@ TcpServer::TcpServer(TcpClientDataDelegate clientReceiveDataHandler)
TcpServer::~TcpServer()
{
+ debugf("Server is destroyed.");
}
TcpConnection* TcpServer::createClient(tcp_pcb *clientTcp)
@@ -258,6 +259,11 @@ void TcpServer::shutdown()
tcp = NULL;
}
+ if(!connections.count()) {
+ delete this;
+ return;
+ }
+
for(int i=0; i < connections.count(); i++) {
TcpConnection* connection = connections[i];
if(connection == NULL) {
@@ -278,7 +284,6 @@ void TcpServer::onClientDestroy(TcpConnection& connection)
}
if(connections.count() == 0) {
- debugf("Server is destroyed.");
delete this;
}
}
From 95b490b02234266034ccc1664216d2778dd21d8a Mon Sep 17 00:00:00 2001
From: slaff
Date: Tue, 14 Nov 2017 10:36:24 +0100
Subject: [PATCH 40/50] Added Adafruit_BME280 Library (#1286)
Added also Adafruit_Sensor to facilitate further integration of other Adafruit sensors.
---
.gitmodules | 14 +++++++++++---
Sming/Libraries/Adafruit_BME280_Library | 1 +
Sming/Libraries/Adafruit_Sensor | 1 +
3 files changed, 13 insertions(+), 3 deletions(-)
create mode 160000 Sming/Libraries/Adafruit_BME280_Library
create mode 160000 Sming/Libraries/Adafruit_Sensor
diff --git a/.gitmodules b/.gitmodules
index 054baa12d4..a734fc0223 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,4 +1,4 @@
-[submodule "Sming/rboot"]
+[submodule "Sming/third-party/rboot"]
path = Sming/third-party/rboot
url = https://github.com/raburton/rboot.git
ignore = dirty
@@ -10,11 +10,11 @@
path = Sming/third-party/esp-gdbstub
url = https://github.com/espressif/esp-gdbstub.git
ignore = dirty
-[submodule "Sming/pwm"]
+[submodule "Sming/third-party/pwm"]
path = Sming/third-party/pwm
url = https://github.com/StefanBruens/ESP8266_new_pwm.git
ignore = dirty
-[submodule "third-party/axtls-8266"]
+[submodule "Sming/third-party/axtls-8266"]
path = Sming/third-party/axtls-8266
url = https://github.com/igrr/axtls-8266.git
ignore = dirty
@@ -45,3 +45,11 @@
path = Sming/Libraries/Adafruit_SSD1306
url = https://github.com/adafruit/Adafruit_SSD1306.git
ignore = dirty
+[submodule "Sming/Libraries/Adafruit_BME280_Library"]
+ path = Sming/Libraries/Adafruit_BME280_Library
+ url = https://github.com/adafruit/Adafruit_BME280_Library.git
+ ignore = dirty
+[submodule "Sming/Libraries/Adafruit_Sensor"]
+ path = Sming/Libraries/Adafruit_Sensor
+ url = https://github.com/adafruit/Adafruit_Sensor
+ ignore = dirty
diff --git a/Sming/Libraries/Adafruit_BME280_Library b/Sming/Libraries/Adafruit_BME280_Library
new file mode 160000
index 0000000000..321186220e
--- /dev/null
+++ b/Sming/Libraries/Adafruit_BME280_Library
@@ -0,0 +1 @@
+Subproject commit 321186220e1e04080bb70fa45aae6e6a5820899f
diff --git a/Sming/Libraries/Adafruit_Sensor b/Sming/Libraries/Adafruit_Sensor
new file mode 160000
index 0000000000..e985f2253a
--- /dev/null
+++ b/Sming/Libraries/Adafruit_Sensor
@@ -0,0 +1 @@
+Subproject commit e985f2253a687ef377cde3dcfb1f788830d1bc09
From ddfc9aa96774bf91df0756e5dfa9e04fae200688 Mon Sep 17 00:00:00 2001
From: slaff
Date: Tue, 14 Nov 2017 11:21:37 +0100
Subject: [PATCH 41/50] Fixed an error breaking SSL session resumption, Http
Connection reuse and Http pipelining. (#1287)
---
Sming/SmingCore/Network/HttpClient.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Sming/SmingCore/Network/HttpClient.cpp b/Sming/SmingCore/Network/HttpClient.cpp
index 29340277e2..ef77482b2f 100644
--- a/Sming/SmingCore/Network/HttpClient.cpp
+++ b/Sming/SmingCore/Network/HttpClient.cpp
@@ -162,7 +162,10 @@ void HttpClient::cleanup()
HttpClient::~HttpClient()
{
- cleanup();
+ // DON'T call cleanup.
+ // If you want to free all resources from HttpClients the correct sequence will be to
+ // 1. Delete all instances of HttpClient
+ // 2. Call the static method HttpClient::cleanup();
}
String HttpClient::getCacheKey(URL url)
From 841d084fed38fc1bd6314e0a2db82b868b73eb48 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20GR?=
Date: Thu, 16 Nov 2017 07:07:18 -0200
Subject: [PATCH 42/50] Fixed ssl memory leaks related to SSL context not being
freed (#1288)
---
Sming/SmingCore/Network/TcpConnection.cpp | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/Sming/SmingCore/Network/TcpConnection.cpp b/Sming/SmingCore/Network/TcpConnection.cpp
index e707c4bd05..742e4abc9e 100644
--- a/Sming/SmingCore/Network/TcpConnection.cpp
+++ b/Sming/SmingCore/Network/TcpConnection.cpp
@@ -165,7 +165,7 @@ void TcpConnection::onError(err_t err)
#ifdef ENABLE_SSL
if(ssl) {
sslConnected = false;
- ssl_free(ssl); // ssl_free frees internally also the SSL context and the SSL extension data
+ ssl_ctx_free(sslContext);
sslContext=nullptr;
sslExtension = NULL;
ssl=nullptr;
@@ -297,8 +297,7 @@ void TcpConnection::close()
#ifdef ENABLE_SSL
if (ssl != nullptr) {
debugf("SSL: closing ...");
-// ssl_ctx_free(sslContext);
- ssl_free(ssl);
+ ssl_ctx_free(sslContext);
sslContext=nullptr;
ssl=nullptr;
sslConnected = false;
@@ -419,8 +418,8 @@ err_t TcpConnection::staticOnConnected(void *arg, tcp_pcb *tcp, err_t err)
#endif
debugf("SSL: handshake start (%d ms)", millis());
- if(con->ssl != NULL) {
- ssl_free(con->ssl);
+ if(con->sslContext != NULL) {
+ ssl_ctx_free(con->sslContext);
}
con->sslContext = ssl_ctx_new(SSL_CONNECT_IN_PARTS | sslOptions, 1);
From 13fd385652b1e935028eabc31b2f1b09e3fdfde6 Mon Sep 17 00:00:00 2001
From: slaff
Date: Wed, 22 Nov 2017 10:29:07 +0100
Subject: [PATCH 43/50] Added experimental support for LWIP v2 (#1289)
---
.gitmodules | 4 +
.travis.yml | 1 +
Sming/Makefile | 23 ++++-
Sming/Makefile-project.mk | 18 +++-
Sming/Makefile-rboot.mk | 21 ++++-
.../CommandProcessing/CommandHandler.cpp | 5 ++
Sming/SmingCore/Clock.h | 12 ++-
Sming/SmingCore/Network/NtpClient.cpp | 4 +-
Sming/SmingCore/Network/NtpClient.h | 2 +-
Sming/SmingCore/Network/TcpConnection.cpp | 2 +-
Sming/SmingCore/Network/TcpConnection.h | 2 +-
Sming/SmingCore/Network/UdpConnection.cpp | 2 +-
Sming/SmingCore/Network/UdpConnection.h | 2 +-
Sming/Wiring/IPAddress.cpp | 7 ++
Sming/Wiring/IPAddress.h | 14 ++++
Sming/compiler/ld/common.ld | 1 +
Sming/system/{include => esp-lwip}/arch/cc.h | 0
.../system/{include => esp-lwip}/arch/perf.h | 0
.../{include => esp-lwip}/arch/sys_arch.h | 0
Sming/system/{include => esp-lwip}/lwip/api.h | 0
.../{include => esp-lwip}/lwip/api_msg.h | 0
.../lwip/app/dhcpserver.h | 0
.../{include => esp-lwip}/lwip/app/espconn.h | 0
.../lwip/app/espconn_tcp.h | 0
.../lwip/app/espconn_udp.h | 0
.../{include => esp-lwip}/lwip/app/ping.h | 0
.../system/{include => esp-lwip}/lwip/arch.h | 0
.../{include => esp-lwip}/lwip/autoip.h | 0
.../system/{include => esp-lwip}/lwip/debug.h | 0
Sming/system/{include => esp-lwip}/lwip/def.h | 0
.../system/{include => esp-lwip}/lwip/dhcp.h | 0
Sming/system/{include => esp-lwip}/lwip/dns.h | 0
Sming/system/{include => esp-lwip}/lwip/err.h | 0
.../system/{include => esp-lwip}/lwip/icmp.h | 0
.../system/{include => esp-lwip}/lwip/igmp.h | 0
.../system/{include => esp-lwip}/lwip/inet.h | 0
.../{include => esp-lwip}/lwip/inet_chksum.h | 0
.../system/{include => esp-lwip}/lwip/init.h | 0
Sming/system/{include => esp-lwip}/lwip/ip.h | 0
.../{include => esp-lwip}/lwip/ip_addr.h | 0
.../{include => esp-lwip}/lwip/ip_frag.h | 0
Sming/system/{include => esp-lwip}/lwip/mem.h | 0
.../system/{include => esp-lwip}/lwip/memp.h | 0
.../{include => esp-lwip}/lwip/memp_std.h | 0
.../{include => esp-lwip}/lwip/netbuf.h | 0
.../system/{include => esp-lwip}/lwip/netdb.h | 0
.../system/{include => esp-lwip}/lwip/netif.h | 0
.../{include => esp-lwip}/lwip/netifapi.h | 0
Sming/system/{include => esp-lwip}/lwip/opt.h | 0
.../system/{include => esp-lwip}/lwip/pbuf.h | 0
Sming/system/{include => esp-lwip}/lwip/raw.h | 0
Sming/system/{include => esp-lwip}/lwip/sio.h | 0
.../system/{include => esp-lwip}/lwip/snmp.h | 0
.../{include => esp-lwip}/lwip/snmp_asn1.h | 0
.../{include => esp-lwip}/lwip/snmp_msg.h | 0
.../{include => esp-lwip}/lwip/snmp_structs.h | 0
.../{include => esp-lwip}/lwip/sockets.h | 0
.../system/{include => esp-lwip}/lwip/stats.h | 0
Sming/system/{include => esp-lwip}/lwip/sys.h | 0
Sming/system/{include => esp-lwip}/lwip/tcp.h | 0
.../{include => esp-lwip}/lwip/tcp_impl.h | 0
.../system/{include => esp-lwip}/lwip/tcpip.h | 0
.../{include => esp-lwip}/lwip/timers.h | 0
Sming/system/{include => esp-lwip}/lwip/udp.h | 0
Sming/system/{include => esp-lwip}/lwipopts.h | 0
.../third-party/.patches/esp-open-lwip.patch | 84 +++++++++----------
Sming/third-party/.patches/lwip2.patch | 25 ++++++
Sming/third-party/lwip2 | 1 +
68 files changed, 169 insertions(+), 61 deletions(-)
rename Sming/system/{include => esp-lwip}/arch/cc.h (100%)
rename Sming/system/{include => esp-lwip}/arch/perf.h (100%)
rename Sming/system/{include => esp-lwip}/arch/sys_arch.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/api.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/api_msg.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/app/dhcpserver.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/app/espconn.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/app/espconn_tcp.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/app/espconn_udp.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/app/ping.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/arch.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/autoip.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/debug.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/def.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/dhcp.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/dns.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/err.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/icmp.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/igmp.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/inet.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/inet_chksum.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/init.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/ip.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/ip_addr.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/ip_frag.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/mem.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/memp.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/memp_std.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/netbuf.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/netdb.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/netif.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/netifapi.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/opt.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/pbuf.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/raw.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/sio.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/snmp.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/snmp_asn1.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/snmp_msg.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/snmp_structs.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/sockets.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/stats.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/sys.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/tcp.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/tcp_impl.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/tcpip.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/timers.h (100%)
rename Sming/system/{include => esp-lwip}/lwip/udp.h (100%)
rename Sming/system/{include => esp-lwip}/lwipopts.h (100%)
create mode 100644 Sming/third-party/.patches/lwip2.patch
create mode 160000 Sming/third-party/lwip2
diff --git a/.gitmodules b/.gitmodules
index a734fc0223..0bec643f7d 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -53,3 +53,7 @@
path = Sming/Libraries/Adafruit_Sensor
url = https://github.com/adafruit/Adafruit_Sensor
ignore = dirty
+[submodule "Sming/third-party/lwip2"]
+ path = Sming/third-party/lwip2
+ url = https://github.com/d-a-v/esp82xx-nonos-linklayer.git
+ ignore = dirty
diff --git a/.travis.yml b/.travis.yml
index 2d6c6ba0e4..d9c3e9b868 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -56,6 +56,7 @@ script:
- make clean samples-clean
- make ENABLE_CUSTOM_HEAP=1
- make Basic_Blink ENABLE_CUSTOM_HEAP=1
+ - make dist-clean; make HttpServer_ConfigNetwork ENABLE_CUSTOM_LWIP=2
deploy:
provider: script
diff --git a/Sming/Makefile b/Sming/Makefile
index 1cfb9db6d2..b70cd2594b 100644
--- a/Sming/Makefile
+++ b/Sming/Makefile
@@ -199,9 +199,23 @@ endif
LIBLWIP = lwip
ENABLE_CUSTOM_LWIP ?= 1
ENABLE_ESPCONN ?= 0
+ifeq ($(ENABLE_CUSTOM_LWIP), 0)
+ EXTRA_INCDIR += system/esp-lwip
+endif
ifeq ($(ENABLE_CUSTOM_LWIP), 1)
THIRD_PARTY_DATA += third-party/esp-open-lwip/Makefile.open
EXTRA_INCDIR += third-party/esp-open-lwip/include
+ LIBLWIP = lwip_open
+ LWIP_EXTRA_FLAGS = 1
+endif
+ifeq ($(ENABLE_CUSTOM_LWIP), 2)
+ THIRD_PARTY_DATA += third-party/lwip2/Makefile.sming
+ EXTRA_INCDIR += third-party/lwip2/glue-esp/include-esp third-party/lwip2/include
+ LIBLWIP = lwip2
+ LWIP_EXTRA_FLAGS = 1
+endif
+
+ifeq ($(LWIP_EXTRA_FLAGS),1)
EXTRA_CFLAGS_LWIP = -I../../system/include -I../../Wiring
ENABLE_LWIPDEBUG ?= 0
ifeq ($(ENABLE_LWIPDEBUG), 1)
@@ -210,8 +224,6 @@ ifeq ($(ENABLE_CUSTOM_LWIP), 1)
ifeq ($(ENABLE_ESPCONN), 1)
LIBLWIP = lwip_full
- else
- LIBLWIP = lwip_open
endif
CUSTOM_TARGETS += $(USER_LIBDIR)/lib$(LIBLWIP).a
endif
@@ -384,6 +396,10 @@ ifeq ($(ENABLE_CUSTOM_LWIP), 1)
$(USER_LIBDIR)/liblwip_%.a: third-party/esp-open-lwip/Makefile.open
$(Q) $(MAKE) -C third-party/esp-open-lwip/ -f Makefile.open ENABLE_ESPCONN=$(ENABLE_ESPCONN) SDK_BASE="$(SDK_BASE)" USER_LIBDIR="$(SMING_HOME)/$(USER_LIBDIR)/" CFLAGS_EXTRA="$(EXTRA_CFLAGS_LWIP)" all
endif
+ifeq ($(ENABLE_CUSTOM_LWIP), 2)
+$(USER_LIBDIR)/liblwip%.a: third-party/lwip2/Makefile.sming
+ $(Q) $(MAKE) -C third-party/lwip2/ -f Makefile.sming ENABLE_ESPCONN=$(ENABLE_ESPCONN) SDK_BASE="$(SDK_BASE)" USER_LIBDIR="$(SMING_HOME)/$(USER_LIBDIR)/" CFLAGS_EXTRA="$(EXTRA_CFLAGS_LWIP)" all
+endif
spiffy: spiffy/spiffy
@@ -429,6 +445,9 @@ endif
ifeq ($(ENABLE_CUSTOM_LWIP), 1)
$(Q) -$(MAKE) -C third-party/esp-open-lwip/ -f Makefile.open ENABLE_ESPCONN=$(ENABLE_ESPCONN) SDK_BASE="$(SDK_BASE)" USER_LIBDIR="$(SMING_HOME)/$(USER_LIBDIR)/" CFLAGS_EXTRA="$(EXTRA_CFLAGS_LWIP)" clean
endif
+ifeq ($(ENABLE_CUSTOM_LWIP), 2)
+ $(Q) -$(MAKE) -C third-party/lwip2/ -f Makefile.sming ENABLE_ESPCONN=$(ENABLE_ESPCONN) SDK_BASE="$(SDK_BASE)" USER_LIBDIR="$(SMING_HOME)/$(USER_LIBDIR)/" CFLAGS_EXTRA="$(EXTRA_CFLAGS_LWIP)" clean
+endif
test: Basic_Blink Basic_rBoot Basic_Ssl Basic_HwPWM
diff --git a/Sming/Makefile-project.mk b/Sming/Makefile-project.mk
index 52090080b9..7e52eea2c4 100644
--- a/Sming/Makefile-project.mk
+++ b/Sming/Makefile-project.mk
@@ -174,8 +174,11 @@ MODULES ?= app # default to app if not set by user
EXTRA_INCDIR ?= include # default to include if not set by user
ENABLE_CUSTOM_LWIP ?= 1
+LWIP_INCDIR = $(SMING_HOME)/system/esp-lwip/lwip/include
ifeq ($(ENABLE_CUSTOM_LWIP), 1)
LWIP_INCDIR = $(SMING_HOME)/third-party/esp-open-lwip/include
+else ifeq ($(ENABLE_CUSTOM_LWIP), 2)
+ LWIP_INCDIR = $(SMING_HOME)/third-party/lwip2/glue-esp/include-esp $(SMING_HOME)/third-party/lwip2/include
endif
EXTRA_INCDIR += $(SMING_HOME)/include $(SMING_HOME)/ $(LWIP_INCDIR) $(SMING_HOME)/system/include \
@@ -200,6 +203,13 @@ ifeq ($(ENABLE_CUSTOM_LWIP), 1)
endif
CUSTOM_TARGETS += $(USER_LIBDIR)/lib$(LIBLWIP).a
endif
+ifeq ($(ENABLE_CUSTOM_LWIP), 2)
+ ifeq ($(ENABLE_ESPCONN), 1)
+$(error LWIP2 does not support espconn_* functions. Make sure to set ENABLE_CUSTOM_LWIP to 0 or 1.)
+ endif
+ LIBLWIP = lwip2
+ CUSTOM_TARGETS += $(USER_LIBDIR)/liblwip2.a
+endif
LIBPWM = pwm
@@ -457,10 +467,10 @@ $(USER_LIBDIR)/libpwm_open.a:
$(Q) $(MAKE) -C $(SMING_HOME) compiler/lib/libpwm_open.a ENABLE_CUSTOM_PWM=1
endif
-ifeq ($(ENABLE_CUSTOM_LWIP), 1)
-$(USER_LIBDIR)/liblwip_%.a:
- $(Q) $(MAKE) -C $(SMING_HOME) compiler/lib/$(notdir $@) ENABLE_CUSTOM_LWIP=1 ENABLE_ESPCONN=$(ENABLE_ESPCONN)
-endif
+$(USER_LIBDIR)/liblwip%.a:
+ $(Q) $(MAKE) -C $(SMING_HOME) compiler/lib/$(notdir $@) \
+ ENABLE_CUSTOM_LWIP=$(ENABLE_CUSTOM_LWIP) \
+ ENABLE_ESPCONN=$(ENABLE_ESPCONN)
checkdirs: $(BUILD_DIR) $(FW_BASE) $(CUSTOM_TARGETS)
diff --git a/Sming/Makefile-rboot.mk b/Sming/Makefile-rboot.mk
index 32ab0599c3..9ac90dc0bb 100644
--- a/Sming/Makefile-rboot.mk
+++ b/Sming/Makefile-rboot.mk
@@ -182,8 +182,11 @@ MODULES += $(THIRD_PARTY_DIR)/rboot/appcode
EXTRA_INCDIR ?= include # default to include if not set by user
ENABLE_CUSTOM_LWIP ?= 1
+LWIP_INCDIR = $(SMING_HOME)/system/esp-lwip/lwip/include
ifeq ($(ENABLE_CUSTOM_LWIP), 1)
LWIP_INCDIR = $(SMING_HOME)/third-party/esp-open-lwip/include
+else ifeq ($(ENABLE_CUSTOM_LWIP), 2)
+ LWIP_INCDIR = $(SMING_HOME)/third-party/lwip2/glue-esp/include-esp $(SMING_HOME)/third-party/lwip2/include
endif
EXTRA_INCDIR += $(SMING_HOME)/include $(SMING_HOME)/ $(LWIP_INCDIR) $(SMING_HOME)/system/include \
@@ -249,6 +252,13 @@ ifeq ($(ENABLE_CUSTOM_LWIP), 1)
endif
CUSTOM_TARGETS += $(USER_LIBDIR)/lib$(LIBLWIP).a
endif
+ifeq ($(ENABLE_CUSTOM_LWIP), 2)
+ ifeq ($(ENABLE_ESPCONN), 1)
+$(error LWIP2 does not support espconn_* functions. Make sure to set ENABLE_CUSTOM_LWIP to 0 or 1.)
+ endif
+ LIBLWIP = lwip2
+ CUSTOM_TARGETS += $(USER_LIBDIR)/liblwip2.a
+endif
LIBPWM = pwm
@@ -280,6 +290,9 @@ endif
ifeq ($(ENABLE_CUSTOM_LWIP), 1)
EXTRA_INCDIR += third-party/esp-open-lwip/include
endif
+ifeq ($(ENABLE_CUSTOM_LWIP), 2)
+ EXTRA_INCDIR += third-party/lwip2/include
+endif
# we will use global WiFi settings from Eclipse Environment Variables, if possible
@@ -507,10 +520,10 @@ $(USER_LIBDIR)/libpwm_open.a:
$(Q) $(MAKE) -C $(SMING_HOME) compiler/lib/libpwm_open.a ENABLE_CUSTOM_PWM=1
endif
-ifeq ($(ENABLE_CUSTOM_LWIP), 1)
-$(USER_LIBDIR)/liblwip_%.a:
- $(Q) $(MAKE) -C $(SMING_HOME) compiler/lib/$(notdir $@) ENABLE_CUSTOM_LWIP=1 ENABLE_ESPCONN=$(ENABLE_ESPCONN)
-endif
+$(USER_LIBDIR)/liblwip%.a:
+ $(Q) $(MAKE) -C $(SMING_HOME) compiler/lib/$(notdir $@) \
+ ENABLE_CUSTOM_LWIP=$(ENABLE_CUSTOM_LWIP) \
+ ENABLE_ESPCONN=$(ENABLE_ESPCONN)
checkdirs: $(BUILD_DIR) $(FW_BASE) $(CUSTOM_TARGETS)
diff --git a/Sming/Services/CommandProcessing/CommandHandler.cpp b/Sming/Services/CommandProcessing/CommandHandler.cpp
index f7c0ad6154..c9c5b8f573 100644
--- a/Sming/Services/CommandProcessing/CommandHandler.cpp
+++ b/Sming/Services/CommandProcessing/CommandHandler.cpp
@@ -8,6 +8,10 @@
#include "CommandHandler.h"
#include "CommandDelegate.h"
+#ifndef LWIP_HASH_STR
+#define LWIP_HASH_STR ""
+#endif
+
CommandHandler::CommandHandler()
{
registeredCommands = new HashMap;
@@ -138,6 +142,7 @@ void CommandHandler::procesStatusCommand(String commandLine, CommandOutput* comm
commandOutput->printf("ESP SDK version : ");
commandOutput->print(system_get_sdk_version());
commandOutput->printf("\r\n");
+ commandOutput->printf("lwIP version : %d.%d.%d(%s)\n", LWIP_VERSION_MAJOR, LWIP_VERSION_MINOR, LWIP_VERSION_REVISION, LWIP_HASH_STR);
commandOutput->printf("Time = ");
commandOutput->printf(SystemClock.getSystemTimeString().c_str());
commandOutput->printf("\r\n");
diff --git a/Sming/SmingCore/Clock.h b/Sming/SmingCore/Clock.h
index bf12d02b04..d3d63b27b4 100644
--- a/Sming/SmingCore/Clock.h
+++ b/Sming/SmingCore/Clock.h
@@ -15,13 +15,17 @@
#include "../Wiring/WiringFrameworkDependencies.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/** @brief Get the system (up)time in milliseconds
* @retval "unsigned long" Quantity of milliseconds elapsed since clock epoch
* @note Clock epoch will reset every 49 days, 17 hours, 2 minutes, 47 seconds, 296 milliseconds
* @note This function uses ESP8266 _system time_ clock which pauses during sleep. Function is provided for compatibility with Arduino. For date and time functionality, use SystemClock
* @see SystemClockClass
*/
-unsigned long millis(void);
+unsigned long millis(void) __attribute__((weak));
/** @brief Get the time from clock in microseconds
* @retval "unsigned long" Quantity of microseconds elapsed since clock epoch
@@ -29,7 +33,7 @@ unsigned long millis(void);
* @note This function uses ESP8266 _system time_ clock which pauses during sleep. Function is provided for compatibility with Arduino. For date and time functionality, use SystemClock
* @see SystemClockClass
*/
-unsigned long micros(void);
+unsigned long micros(void) __attribute__((weak));
/** @brief Pause execution
* @param time Duration of delay in milliseconds
@@ -46,5 +50,9 @@ void delay(uint32_t time);
*/
void delayMicroseconds(uint32_t time);
+#ifdef __cplusplus
+}
+#endif
+
/** @} */
#endif
diff --git a/Sming/SmingCore/Network/NtpClient.cpp b/Sming/SmingCore/Network/NtpClient.cpp
index 21599470a0..4f2ed488fd 100644
--- a/Sming/SmingCore/Network/NtpClient.cpp
+++ b/Sming/SmingCore/Network/NtpClient.cpp
@@ -52,7 +52,7 @@ void NtpClient::requestTime()
return;
}
- struct ip_addr resolvedIp;
+ ip_addr_t resolvedIp;
int result = dns_gethostbyname(this->server.c_str(), &resolvedIp,
staticDnsResponse, (void*) this);
@@ -174,7 +174,7 @@ void NtpClient::onReceive(pbuf *buf, IPAddress remoteIP, uint16_t remotePort)
}
}
-void NtpClient::staticDnsResponse(const char *name, struct ip_addr *ip, void *arg)
+void NtpClient::staticDnsResponse(const char *name, LWIP_IP_ADDR_T *ip, void *arg)
{
// DNS has been resolved
diff --git a/Sming/SmingCore/Network/NtpClient.h b/Sming/SmingCore/Network/NtpClient.h
index 57357553e1..a9ce399c64 100644
--- a/Sming/SmingCore/Network/NtpClient.h
+++ b/Sming/SmingCore/Network/NtpClient.h
@@ -106,7 +106,7 @@ class NtpClient : protected UdpConnection
* @param arg Pointer to the NTP client object that made the DNS request
* @note This function is called when a DNS query is serviced
*/
- static void staticDnsResponse(const char *name, struct ip_addr *ip, void *arg);
+ static void staticDnsResponse(const char *name, LWIP_IP_ADDR_T *ip, void *arg);
};
/** @} */
diff --git a/Sming/SmingCore/Network/TcpConnection.cpp b/Sming/SmingCore/Network/TcpConnection.cpp
index 742e4abc9e..08c402ddbe 100644
--- a/Sming/SmingCore/Network/TcpConnection.cpp
+++ b/Sming/SmingCore/Network/TcpConnection.cpp
@@ -674,7 +674,7 @@ void TcpConnection::staticOnError(void *arg, err_t err)
//debugf("irom0_0_seg :irom0_0_phdr
diff --git a/Sming/system/include/arch/cc.h b/Sming/system/esp-lwip/arch/cc.h
similarity index 100%
rename from Sming/system/include/arch/cc.h
rename to Sming/system/esp-lwip/arch/cc.h
diff --git a/Sming/system/include/arch/perf.h b/Sming/system/esp-lwip/arch/perf.h
similarity index 100%
rename from Sming/system/include/arch/perf.h
rename to Sming/system/esp-lwip/arch/perf.h
diff --git a/Sming/system/include/arch/sys_arch.h b/Sming/system/esp-lwip/arch/sys_arch.h
similarity index 100%
rename from Sming/system/include/arch/sys_arch.h
rename to Sming/system/esp-lwip/arch/sys_arch.h
diff --git a/Sming/system/include/lwip/api.h b/Sming/system/esp-lwip/lwip/api.h
similarity index 100%
rename from Sming/system/include/lwip/api.h
rename to Sming/system/esp-lwip/lwip/api.h
diff --git a/Sming/system/include/lwip/api_msg.h b/Sming/system/esp-lwip/lwip/api_msg.h
similarity index 100%
rename from Sming/system/include/lwip/api_msg.h
rename to Sming/system/esp-lwip/lwip/api_msg.h
diff --git a/Sming/system/include/lwip/app/dhcpserver.h b/Sming/system/esp-lwip/lwip/app/dhcpserver.h
similarity index 100%
rename from Sming/system/include/lwip/app/dhcpserver.h
rename to Sming/system/esp-lwip/lwip/app/dhcpserver.h
diff --git a/Sming/system/include/lwip/app/espconn.h b/Sming/system/esp-lwip/lwip/app/espconn.h
similarity index 100%
rename from Sming/system/include/lwip/app/espconn.h
rename to Sming/system/esp-lwip/lwip/app/espconn.h
diff --git a/Sming/system/include/lwip/app/espconn_tcp.h b/Sming/system/esp-lwip/lwip/app/espconn_tcp.h
similarity index 100%
rename from Sming/system/include/lwip/app/espconn_tcp.h
rename to Sming/system/esp-lwip/lwip/app/espconn_tcp.h
diff --git a/Sming/system/include/lwip/app/espconn_udp.h b/Sming/system/esp-lwip/lwip/app/espconn_udp.h
similarity index 100%
rename from Sming/system/include/lwip/app/espconn_udp.h
rename to Sming/system/esp-lwip/lwip/app/espconn_udp.h
diff --git a/Sming/system/include/lwip/app/ping.h b/Sming/system/esp-lwip/lwip/app/ping.h
similarity index 100%
rename from Sming/system/include/lwip/app/ping.h
rename to Sming/system/esp-lwip/lwip/app/ping.h
diff --git a/Sming/system/include/lwip/arch.h b/Sming/system/esp-lwip/lwip/arch.h
similarity index 100%
rename from Sming/system/include/lwip/arch.h
rename to Sming/system/esp-lwip/lwip/arch.h
diff --git a/Sming/system/include/lwip/autoip.h b/Sming/system/esp-lwip/lwip/autoip.h
similarity index 100%
rename from Sming/system/include/lwip/autoip.h
rename to Sming/system/esp-lwip/lwip/autoip.h
diff --git a/Sming/system/include/lwip/debug.h b/Sming/system/esp-lwip/lwip/debug.h
similarity index 100%
rename from Sming/system/include/lwip/debug.h
rename to Sming/system/esp-lwip/lwip/debug.h
diff --git a/Sming/system/include/lwip/def.h b/Sming/system/esp-lwip/lwip/def.h
similarity index 100%
rename from Sming/system/include/lwip/def.h
rename to Sming/system/esp-lwip/lwip/def.h
diff --git a/Sming/system/include/lwip/dhcp.h b/Sming/system/esp-lwip/lwip/dhcp.h
similarity index 100%
rename from Sming/system/include/lwip/dhcp.h
rename to Sming/system/esp-lwip/lwip/dhcp.h
diff --git a/Sming/system/include/lwip/dns.h b/Sming/system/esp-lwip/lwip/dns.h
similarity index 100%
rename from Sming/system/include/lwip/dns.h
rename to Sming/system/esp-lwip/lwip/dns.h
diff --git a/Sming/system/include/lwip/err.h b/Sming/system/esp-lwip/lwip/err.h
similarity index 100%
rename from Sming/system/include/lwip/err.h
rename to Sming/system/esp-lwip/lwip/err.h
diff --git a/Sming/system/include/lwip/icmp.h b/Sming/system/esp-lwip/lwip/icmp.h
similarity index 100%
rename from Sming/system/include/lwip/icmp.h
rename to Sming/system/esp-lwip/lwip/icmp.h
diff --git a/Sming/system/include/lwip/igmp.h b/Sming/system/esp-lwip/lwip/igmp.h
similarity index 100%
rename from Sming/system/include/lwip/igmp.h
rename to Sming/system/esp-lwip/lwip/igmp.h
diff --git a/Sming/system/include/lwip/inet.h b/Sming/system/esp-lwip/lwip/inet.h
similarity index 100%
rename from Sming/system/include/lwip/inet.h
rename to Sming/system/esp-lwip/lwip/inet.h
diff --git a/Sming/system/include/lwip/inet_chksum.h b/Sming/system/esp-lwip/lwip/inet_chksum.h
similarity index 100%
rename from Sming/system/include/lwip/inet_chksum.h
rename to Sming/system/esp-lwip/lwip/inet_chksum.h
diff --git a/Sming/system/include/lwip/init.h b/Sming/system/esp-lwip/lwip/init.h
similarity index 100%
rename from Sming/system/include/lwip/init.h
rename to Sming/system/esp-lwip/lwip/init.h
diff --git a/Sming/system/include/lwip/ip.h b/Sming/system/esp-lwip/lwip/ip.h
similarity index 100%
rename from Sming/system/include/lwip/ip.h
rename to Sming/system/esp-lwip/lwip/ip.h
diff --git a/Sming/system/include/lwip/ip_addr.h b/Sming/system/esp-lwip/lwip/ip_addr.h
similarity index 100%
rename from Sming/system/include/lwip/ip_addr.h
rename to Sming/system/esp-lwip/lwip/ip_addr.h
diff --git a/Sming/system/include/lwip/ip_frag.h b/Sming/system/esp-lwip/lwip/ip_frag.h
similarity index 100%
rename from Sming/system/include/lwip/ip_frag.h
rename to Sming/system/esp-lwip/lwip/ip_frag.h
diff --git a/Sming/system/include/lwip/mem.h b/Sming/system/esp-lwip/lwip/mem.h
similarity index 100%
rename from Sming/system/include/lwip/mem.h
rename to Sming/system/esp-lwip/lwip/mem.h
diff --git a/Sming/system/include/lwip/memp.h b/Sming/system/esp-lwip/lwip/memp.h
similarity index 100%
rename from Sming/system/include/lwip/memp.h
rename to Sming/system/esp-lwip/lwip/memp.h
diff --git a/Sming/system/include/lwip/memp_std.h b/Sming/system/esp-lwip/lwip/memp_std.h
similarity index 100%
rename from Sming/system/include/lwip/memp_std.h
rename to Sming/system/esp-lwip/lwip/memp_std.h
diff --git a/Sming/system/include/lwip/netbuf.h b/Sming/system/esp-lwip/lwip/netbuf.h
similarity index 100%
rename from Sming/system/include/lwip/netbuf.h
rename to Sming/system/esp-lwip/lwip/netbuf.h
diff --git a/Sming/system/include/lwip/netdb.h b/Sming/system/esp-lwip/lwip/netdb.h
similarity index 100%
rename from Sming/system/include/lwip/netdb.h
rename to Sming/system/esp-lwip/lwip/netdb.h
diff --git a/Sming/system/include/lwip/netif.h b/Sming/system/esp-lwip/lwip/netif.h
similarity index 100%
rename from Sming/system/include/lwip/netif.h
rename to Sming/system/esp-lwip/lwip/netif.h
diff --git a/Sming/system/include/lwip/netifapi.h b/Sming/system/esp-lwip/lwip/netifapi.h
similarity index 100%
rename from Sming/system/include/lwip/netifapi.h
rename to Sming/system/esp-lwip/lwip/netifapi.h
diff --git a/Sming/system/include/lwip/opt.h b/Sming/system/esp-lwip/lwip/opt.h
similarity index 100%
rename from Sming/system/include/lwip/opt.h
rename to Sming/system/esp-lwip/lwip/opt.h
diff --git a/Sming/system/include/lwip/pbuf.h b/Sming/system/esp-lwip/lwip/pbuf.h
similarity index 100%
rename from Sming/system/include/lwip/pbuf.h
rename to Sming/system/esp-lwip/lwip/pbuf.h
diff --git a/Sming/system/include/lwip/raw.h b/Sming/system/esp-lwip/lwip/raw.h
similarity index 100%
rename from Sming/system/include/lwip/raw.h
rename to Sming/system/esp-lwip/lwip/raw.h
diff --git a/Sming/system/include/lwip/sio.h b/Sming/system/esp-lwip/lwip/sio.h
similarity index 100%
rename from Sming/system/include/lwip/sio.h
rename to Sming/system/esp-lwip/lwip/sio.h
diff --git a/Sming/system/include/lwip/snmp.h b/Sming/system/esp-lwip/lwip/snmp.h
similarity index 100%
rename from Sming/system/include/lwip/snmp.h
rename to Sming/system/esp-lwip/lwip/snmp.h
diff --git a/Sming/system/include/lwip/snmp_asn1.h b/Sming/system/esp-lwip/lwip/snmp_asn1.h
similarity index 100%
rename from Sming/system/include/lwip/snmp_asn1.h
rename to Sming/system/esp-lwip/lwip/snmp_asn1.h
diff --git a/Sming/system/include/lwip/snmp_msg.h b/Sming/system/esp-lwip/lwip/snmp_msg.h
similarity index 100%
rename from Sming/system/include/lwip/snmp_msg.h
rename to Sming/system/esp-lwip/lwip/snmp_msg.h
diff --git a/Sming/system/include/lwip/snmp_structs.h b/Sming/system/esp-lwip/lwip/snmp_structs.h
similarity index 100%
rename from Sming/system/include/lwip/snmp_structs.h
rename to Sming/system/esp-lwip/lwip/snmp_structs.h
diff --git a/Sming/system/include/lwip/sockets.h b/Sming/system/esp-lwip/lwip/sockets.h
similarity index 100%
rename from Sming/system/include/lwip/sockets.h
rename to Sming/system/esp-lwip/lwip/sockets.h
diff --git a/Sming/system/include/lwip/stats.h b/Sming/system/esp-lwip/lwip/stats.h
similarity index 100%
rename from Sming/system/include/lwip/stats.h
rename to Sming/system/esp-lwip/lwip/stats.h
diff --git a/Sming/system/include/lwip/sys.h b/Sming/system/esp-lwip/lwip/sys.h
similarity index 100%
rename from Sming/system/include/lwip/sys.h
rename to Sming/system/esp-lwip/lwip/sys.h
diff --git a/Sming/system/include/lwip/tcp.h b/Sming/system/esp-lwip/lwip/tcp.h
similarity index 100%
rename from Sming/system/include/lwip/tcp.h
rename to Sming/system/esp-lwip/lwip/tcp.h
diff --git a/Sming/system/include/lwip/tcp_impl.h b/Sming/system/esp-lwip/lwip/tcp_impl.h
similarity index 100%
rename from Sming/system/include/lwip/tcp_impl.h
rename to Sming/system/esp-lwip/lwip/tcp_impl.h
diff --git a/Sming/system/include/lwip/tcpip.h b/Sming/system/esp-lwip/lwip/tcpip.h
similarity index 100%
rename from Sming/system/include/lwip/tcpip.h
rename to Sming/system/esp-lwip/lwip/tcpip.h
diff --git a/Sming/system/include/lwip/timers.h b/Sming/system/esp-lwip/lwip/timers.h
similarity index 100%
rename from Sming/system/include/lwip/timers.h
rename to Sming/system/esp-lwip/lwip/timers.h
diff --git a/Sming/system/include/lwip/udp.h b/Sming/system/esp-lwip/lwip/udp.h
similarity index 100%
rename from Sming/system/include/lwip/udp.h
rename to Sming/system/esp-lwip/lwip/udp.h
diff --git a/Sming/system/include/lwipopts.h b/Sming/system/esp-lwip/lwipopts.h
similarity index 100%
rename from Sming/system/include/lwipopts.h
rename to Sming/system/esp-lwip/lwipopts.h
diff --git a/Sming/third-party/.patches/esp-open-lwip.patch b/Sming/third-party/.patches/esp-open-lwip.patch
index 21a025222f..ecfa834500 100644
--- a/Sming/third-party/.patches/esp-open-lwip.patch
+++ b/Sming/third-party/.patches/esp-open-lwip.patch
@@ -75,7 +75,7 @@ index 1bc584f..0bfc424 100644
$(LIB): $(OBJS)
$(AR) rcs $@ $^
diff --git a/include/arch/cc.h b/include/arch/cc.h
-index ff03b30..fde6567 100644
+index ff03b30..6664d59 100644
--- a/include/arch/cc.h
+++ b/include/arch/cc.h
@@ -38,8 +38,25 @@
@@ -93,7 +93,7 @@ index ff03b30..fde6567 100644
+extern size_t ets_strlen(const char *s);
+extern int os_printf_plus(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
+extern int ets_sprintf(char *str, const char *format, ...) __attribute__ ((format (printf, 2, 3)));
-+extern void ets_timer_arm_new(ETSTimer *ptimer, uint32_t milliseconds, bool repeat_flag, int isMstimer);
++//extern void ets_timer_arm_new(ETSTimer *ptimer, uint32_t milliseconds, bool repeat_flag, int isMstimer);
+extern void ets_timer_disarm(ETSTimer *a);
+extern void ets_timer_setfn(ETSTimer *t, ETSTimerFunc *pfunction, void *parg);
+extern uint32 r_rand(void);
@@ -252,47 +252,47 @@ index ddb5984..fb677c6 100644
--- a/lwip/app/dhcpserver.c
+++ b/lwip/app/dhcpserver.c
@@ -133,21 +133,16 @@ static uint8_t* ICACHE_FLASH_ATTR add_offer_options(uint8_t *optptr)
-
- ipadd.addr = *( (uint32_t *) &server_address);
-
--#ifdef USE_CLASS_B_NET
-- *optptr++ = DHCP_OPTION_SUBNET_MASK;
-- *optptr++ = 4; //length
-- *optptr++ = 255;
-- *optptr++ = 240;
-- *optptr++ = 0;
-- *optptr++ = 0;
--#else
-+ struct ip_info if_ip;
-+ os_bzero(&if_ip, sizeof(struct ip_info));
-+ wifi_get_ip_info(SOFTAP_IF, &if_ip);
-+
- *optptr++ = DHCP_OPTION_SUBNET_MASK;
-- *optptr++ = 4;
-- *optptr++ = 255;
-- *optptr++ = 255;
-- *optptr++ = 255;
-- *optptr++ = 0;
--#endif
-+ *optptr++ = 4;
-+ *optptr++ = ip4_addr1( &if_ip.netmask);
-+ *optptr++ = ip4_addr2( &if_ip.netmask);
-+ *optptr++ = ip4_addr3( &if_ip.netmask);
-+ *optptr++ = ip4_addr4( &if_ip.netmask);
-
- *optptr++ = DHCP_OPTION_LEASE_TIME;
- *optptr++ = 4;
+
+ ipadd.addr = *( (uint32_t *) &server_address);
+
+-#ifdef USE_CLASS_B_NET
+- *optptr++ = DHCP_OPTION_SUBNET_MASK;
+- *optptr++ = 4; //length
+- *optptr++ = 255;
+- *optptr++ = 240;
+- *optptr++ = 0;
+- *optptr++ = 0;
+-#else
++ struct ip_info if_ip;
++ os_bzero(&if_ip, sizeof(struct ip_info));
++ wifi_get_ip_info(SOFTAP_IF, &if_ip);
++
+ *optptr++ = DHCP_OPTION_SUBNET_MASK;
+- *optptr++ = 4;
+- *optptr++ = 255;
+- *optptr++ = 255;
+- *optptr++ = 255;
+- *optptr++ = 0;
+-#endif
++ *optptr++ = 4;
++ *optptr++ = ip4_addr1( &if_ip.netmask);
++ *optptr++ = ip4_addr2( &if_ip.netmask);
++ *optptr++ = ip4_addr3( &if_ip.netmask);
++ *optptr++ = ip4_addr4( &if_ip.netmask);
+
+ *optptr++ = DHCP_OPTION_LEASE_TIME;
+ *optptr++ = 4;
@@ -164,10 +159,6 @@ static uint8_t* ICACHE_FLASH_ATTR add_offer_options(uint8_t *optptr)
- *optptr++ = ip4_addr4( &ipadd);
-
- if (dhcps_router_enabled(offer)){
-- struct ip_info if_ip;
-- os_bzero(&if_ip, sizeof(struct ip_info));
-- wifi_get_ip_info(SOFTAP_IF, &if_ip);
--
- *optptr++ = DHCP_OPTION_ROUTER;
- *optptr++ = 4;
- *optptr++ = ip4_addr1( &if_ip.gw);
+ *optptr++ = ip4_addr4( &ipadd);
+
+ if (dhcps_router_enabled(offer)){
+- struct ip_info if_ip;
+- os_bzero(&if_ip, sizeof(struct ip_info));
+- wifi_get_ip_info(SOFTAP_IF, &if_ip);
+-
+ *optptr++ = DHCP_OPTION_ROUTER;
+ *optptr++ = 4;
+ *optptr++ = ip4_addr1( &if_ip.gw);
diff --git a/include/lwip/tcp_impl.h b/include/lwip/tcp_impl.h
index 24ca8bb..0c20b6a 100644
--- a/include/lwip/tcp_impl.h
diff --git a/Sming/third-party/.patches/lwip2.patch b/Sming/third-party/.patches/lwip2.patch
new file mode 100644
index 0000000000..5c772b6ef5
--- /dev/null
+++ b/Sming/third-party/.patches/lwip2.patch
@@ -0,0 +1,25 @@
+diff --git a/glue-esp/include-esp/arch/cc.h b/glue-esp/include-esp/arch/cc.h
+index 735e700..47413e5 100644
+--- a/glue-esp/include-esp/arch/cc.h
++++ b/glue-esp/include-esp/arch/cc.h
+@@ -59,6 +59,7 @@ typedef signed short s16_t;
+ typedef unsigned long u32_t;
+ typedef signed long s32_t;
+ typedef unsigned long mem_ptr_t;
++typedef signed short sint16_t;
+
+ #define S16_F "d"
+ #define U16_F "d"
+diff --git a/glue-lwip/arch/cc.h b/glue-lwip/arch/cc.h
+index 63cd72d..5f100eb 100644
+--- a/glue-lwip/arch/cc.h
++++ b/glue-lwip/arch/cc.h
+@@ -34,6 +34,8 @@ author: d. gauchard
+
+ #include "stdint.h"
+
++typedef signed short sint16_t;
++
+ #ifdef LWIP_BUILD
+
+ // define LWIP_BUILD only when building LWIP
diff --git a/Sming/third-party/lwip2 b/Sming/third-party/lwip2
new file mode 160000
index 0000000000..5b73bb11d5
--- /dev/null
+++ b/Sming/third-party/lwip2
@@ -0,0 +1 @@
+Subproject commit 5b73bb11d59285d49a6efeb20726186cc5cc2b74
From f1e685fe5f3bccf21ee139b416c0a7743f020d83 Mon Sep 17 00:00:00 2001
From: slaff
Date: Wed, 22 Nov 2017 10:31:11 +0100
Subject: [PATCH 44/50] Initial test code for improved sendPing and sendPong.
(#1270)
* Changed ping and pong to have automatic mask generation. If there is no payload the mask will be 0x0000.
---
.../Http/Websocket/WebSocketConnection.cpp | 19 ++++--
.../Http/Websocket/WebSocketConnection.h | 8 ++-
Sming/SmingCore/Network/WebsocketClient.cpp | 49 ++++++++++++--
Sming/SmingCore/Network/WebsocketClient.h | 65 +++++++++++++------
Sming/SmingCore/Network/WebsocketFrame.cpp | 17 +++++
Sming/SmingCore/Network/WebsocketFrame.h | 45 +++++++------
6 files changed, 151 insertions(+), 52 deletions(-)
diff --git a/Sming/SmingCore/Network/Http/Websocket/WebSocketConnection.cpp b/Sming/SmingCore/Network/Http/Websocket/WebSocketConnection.cpp
index a8c72b781f..646e207b56 100644
--- a/Sming/SmingCore/Network/Http/Websocket/WebSocketConnection.cpp
+++ b/Sming/SmingCore/Network/Http/Websocket/WebSocketConnection.cpp
@@ -125,7 +125,9 @@ int WebSocketConnection::staticOnControlBegin(void* userData, ws_frame_type_t ty
return -1;
}
- connection->controlFrameType = type;
+ connection->controlFrame.type = type;
+ connection->controlFrame.payload = NULL;
+ connection->controlFrame.payloadLegth = 0;
if (type == WS_FRAME_CLOSE) {
connection->close();
@@ -136,6 +138,14 @@ int WebSocketConnection::staticOnControlBegin(void* userData, ws_frame_type_t ty
int WebSocketConnection::staticOnControlPayload(void* userData, const char *data, size_t length)
{
+ WebSocketConnection *connection = (WebSocketConnection *)userData;
+ if (connection == NULL) {
+ return -1;
+ }
+
+ connection->controlFrame.payload = (char *)data;
+ connection->controlFrame.payloadLegth = length;
+
return WS_OK;
}
@@ -146,9 +156,10 @@ int WebSocketConnection::staticOnControlEnd(void* userData)
return -1;
}
- if(connection->controlFrameType == WS_FRAME_PING) {
- // TODO: add control frame payload processing...
- connection->send((const char* )NULL, 0, WS_PONG_FRAME);
+ if(connection->controlFrame.type == WS_FRAME_PING) {
+ connection->send((const char* )connection->controlFrame.payload,
+ connection->controlFrame.payloadLegth,
+ WS_PONG_FRAME);
}
return WS_OK;
diff --git a/Sming/SmingCore/Network/Http/Websocket/WebSocketConnection.h b/Sming/SmingCore/Network/Http/Websocket/WebSocketConnection.h
index dc90541c19..a8d32c23e6 100644
--- a/Sming/SmingCore/Network/Http/Websocket/WebSocketConnection.h
+++ b/Sming/SmingCore/Network/Http/Websocket/WebSocketConnection.h
@@ -30,6 +30,12 @@ enum WsConnectionState
eWSCS_Closed
};
+typedef struct {
+ ws_frame_type_t type;
+ char* payload;
+ size_t payloadLegth;
+} WsFrameInfo;
+
class WebSocketConnection
{
public:
@@ -84,7 +90,7 @@ class WebSocketConnection
HttpServerConnection* connection = nullptr;
ws_frame_type_t frameType = WS_FRAME_TEXT;
- ws_frame_type_t controlFrameType = WS_FRAME_PING;
+ WsFrameInfo controlFrame;
ws_parser_t parser;
ws_parser_callbacks_t parserSettings;
diff --git a/Sming/SmingCore/Network/WebsocketClient.cpp b/Sming/SmingCore/Network/WebsocketClient.cpp
index 30166c8172..749304f34e 100644
--- a/Sming/SmingCore/Network/WebsocketClient.cpp
+++ b/Sming/SmingCore/Network/WebsocketClient.cpp
@@ -156,18 +156,16 @@ void WebsocketClient::onFinished(TcpClientState finishState)
TcpClient::onFinished(finishState);
}
-void WebsocketClient::sendPing()
+bool WebsocketClient::sendPing(const String& payload /* = "" */)
{
- uint8_t buf[2] = { 0x89, 0x00 };
debugf("Sending PING");
- send((char*) buf, 2, false);
+ return sendControlFrame(WSFrameType::ping, payload);
}
-void WebsocketClient::sendPong()
+bool WebsocketClient::sendPong(const String& payload /* = "" */)
{
- uint8_t buf[2] = { 0x8A, 0x00 };
debugf("Sending PONG");
- send((char*) buf, 2, false);
+ return sendControlFrame(WSFrameType::pong, payload);
}
void WebsocketClient::disconnect()
@@ -209,6 +207,43 @@ void WebsocketClient::sendMessage(const String& str)
_sendFrame(WSFrameType::text, (uint8_t*) str.c_str(), str.length() + 1);
}
+bool WebsocketClient::sendControlFrame(WSFrameType frameType, const String& payload /* = "" */)
+{
+ if(payload.length() > 127) {
+ debugf("Maximum length of payload is 127 bytes");
+ return false;
+ }
+
+ uint32_t mask = 0;
+ int size = 2 + payload.length() + 4 * mask;
+ uint8_t* buf = new uint8_t[size];
+
+ // if we have payload, generate random mask for it
+ if(payload.length()) {
+ mask = ESP8266_DREG(0x20E44); // See: http://esp8266-re.foogod.com/wiki/Random_Number_Generator
+ }
+
+ int pos = 0;
+ buf[pos++] = (uint8_t)frameType;
+ buf[pos++] = 0x00;
+ buf[pos] |= bit(7);
+
+ if(payload.length()) {
+ buf[pos] += payload.length();
+ }
+
+ buf[++pos] = (mask >> 24) & 0xFF;
+ buf[++pos] = (mask >> 16) & 0xFF;
+ buf[++pos] = (mask >> 8) & 0xFF;
+ buf[++pos] = (mask >> 0) & 0xFF;
+
+ WebsocketFrameClass::mask(payload, mask, (char *)(buf+pos+1));
+
+ send((char*) buf, size, false);
+
+ return true;
+}
+
err_t WebsocketClient::onReceive(pbuf* buf)
{
if (buf == NULL)
@@ -280,7 +315,7 @@ err_t WebsocketClient::onReceive(pbuf* buf)
case WSFrameType::ping:
{
debugf("Got ping ...");
- sendPong(); //Need to send Pong in response to Ping
+ sendPong(String((char*)wsFrame._payload, wsFrame._payloadLength)); //Need to send Pong in response to Ping
break;
}
case WSFrameType::pong:
diff --git a/Sming/SmingCore/Network/WebsocketClient.h b/Sming/SmingCore/Network/WebsocketClient.h
index 7342332ec3..16ee642ad5 100644
--- a/Sming/SmingCore/Network/WebsocketClient.h
+++ b/Sming/SmingCore/Network/WebsocketClient.h
@@ -61,54 +61,79 @@ class WebsocketClient: protected TcpClient
public:
WebsocketClient(bool autoDestruct = false) :TcpClient(autoDestruct) {};
virtual ~WebsocketClient() {};
+
+ /** @brief Set handler for websocket text messages
+ * @param handler Delegate callback to be run when text message received
+ */
void setWebSocketMessageHandler(WebSocketClientMessageDelegate handler);
- /** @brief Set handler for websocket text messages
- * @param handler Delegate callback to be run when text message received
- */
- void setWebSocketDisconnectedHandler(WebSocketClientDisconnectDelegate handler);
+
/** @brief Set handler for websocket disconnection event
* @param handler Delegate callback to be run when websocket disconnects
*/
- void setWebSocketConnectedHandler(WebSocketClientConnectedDelegate handler);
+ void setWebSocketDisconnectedHandler(WebSocketClientDisconnectDelegate handler);
+
/** @brief Set handler for websocket connection event
* @param handler Delegate callback to be run when websocket connects
*/
- void setWebSocketBinaryHandler(WebSocketClientBinaryDelegate handler);
+ void setWebSocketConnectedHandler(WebSocketClientConnectedDelegate handler);
+
/** @brief Set handler for websocket binary messages
* @param handler Delegate callback to be run when binary message received
*/
- bool connect(String url, uint32_t sslOptions = 0);
- /** @brief Connects websocket client to server
+ void setWebSocketBinaryHandler(WebSocketClientBinaryDelegate handler);
+
+ /** @brief Connects websocket client to server
* @param url URL address of websocket server
* @param sslOptions Specify the SSL options to be used when calling websocket server over SSL
*/
- void sendPing();
+ bool connect(String url, uint32_t sslOptions = 0);
+
/** @brief Send websocket ping to server
+ *
+ * @param String payload - maximum 255 bytes
+ *
+ * @retval bool true if the data can be send, false otherwise
*/
- void sendPong();
+ bool sendPing(const String& payload = "");
+
/** @brief Send websocket ping to server
+ * @param String& payload - maximum 255 bytes
+ *
+ * @retval bool true if the data can be send, false otherwise
*/
- void disconnect();
- /** @brief Disconnects websocket client from server
+ bool sendPong(const String& payload = "");
+
+ /** @brief Disconnects websocket client from server
*/
- void sendMessage(char* msg, uint16_t length);
- /** @brief Send text message to websocket server
+ void disconnect();
+
+ /** @brief Send text message to websocket server
* @param msg Pointer to NULL-terminated string buffer to be send to websocket server
* @param length length of the NULL-terminated string buffer
*/
- void sendMessage(const String& str);
- /** @brief Send text message to websocket server
+ void sendMessage(char* msg, uint16_t length);
+
+ /** @brief Send text message to websocket server
* @param C++ String to be send to websocket server
*/
- void sendBinary(uint8_t* msg, uint16_t length);
- /** @brief Send binary message to websocket server
+ void sendMessage(const String& str);
+
+ /** @brief Send binary message to websocket server
* @param msg Pointer to binary-data buffer to be send to websocket server
* @param length length of the binary-data buffer
*/
- wsMode getWSMode();
- /** @brief Get websocket client mode
+ void sendBinary(uint8_t* msg, uint16_t length);
+
+ /** @brief Send control frame to websocket server
+ * @param payload C++ String to be send to websocket server
+ *
+ */
+ bool sendControlFrame(WSFrameType frameType, const String& payload = "");
+
+ /** @brief Get websocket client mode
* @retval Returnt websocket client mode
*/
+ wsMode getWSMode();
#ifdef ENABLE_SSL
using TcpClient::addSslOptions;
diff --git a/Sming/SmingCore/Network/WebsocketFrame.cpp b/Sming/SmingCore/Network/WebsocketFrame.cpp
index bb694ee873..e5538a8ef9 100644
--- a/Sming/SmingCore/Network/WebsocketFrame.cpp
+++ b/Sming/SmingCore/Network/WebsocketFrame.cpp
@@ -242,3 +242,20 @@ uint8_t WebsocketFrameClass::decodeFrame(uint8_t * buffer, size_t length)
}
return true;
}
+
+int WebsocketFrameClass::mask(const String& payload, uint32_t key, char *data)
+{
+ uint8_t pool[4] = {0};
+ int pos = 0;
+ pool[pos++] = (key >> 24) & 0xFF;
+ pool[pos++] = (key >> 16) & 0xFF;
+ pool[pos++] = (key >> 8) & 0xFF;
+ pool[pos++] = (key >> 0) & 0xFF;
+
+ int i;
+ for (i = 0; i < payload.length(); i++) {
+ data[i] = (payload[i] ^ pool[i % 4]);
+ }
+
+ return i;
+}
diff --git a/Sming/SmingCore/Network/WebsocketFrame.h b/Sming/SmingCore/Network/WebsocketFrame.h
index 8265c4f542..1b9e6d1c23 100644
--- a/Sming/SmingCore/Network/WebsocketFrame.h
+++ b/Sming/SmingCore/Network/WebsocketFrame.h
@@ -54,29 +54,34 @@ class WebsocketFrameClass
public:
WebsocketFrameClass() {};
virtual ~WebsocketFrameClass();
+
+ /** @brief Encode given buffer to valid websocket frame
+ * @param frameType Websocket frame type text or binary
+ * @param payload Pointer to buffer to be encoded as websocket frame
+ * @param length Length of buffer to be encoded as websocket frame
+ * @param mask If true websocket frame will be masked (required for client->server communication)
+ * @param fin If true produce ordinary websocket frame, not continuation. Currently MUST be true.
+ * @param headerToPayload If true try to create single buffer message with header and payload, otherwise produce separate header and payload buffers
+ * @retval Return true on success, false on error
+ *
+ * @details if successfully executed, check whether _header is not nullptr and either use _header and _payload or just _payload as websocket frame
+ *
+ */
uint8_t encodeFrame(WSFrameType frameType, uint8_t * payload, size_t length, uint8_t mask, uint8_t fin, uint8_t headerToPayload = true);
- /** @brief Encode given buffer to valid websocket frame
- * @param frameType Websocket frame type text or binary
- * @param payload Pointer to buffer to be encoded as websocket frame
- * @param length Length of buffer to be encoded as websocket frame
- * @param mask If true websocket frame will be masked (required for client->server communication)
- * @param fin If true produce ordinary websocket frame, not continuation. Currently MUST be true.
- * @param headerToPayload If true try to create single buffer message with header and payload, otherwise produce separate header and payload buffers
- * @retval Return true on success, false on error
- *
- * @details if successfully executed, check whether _header is not nullptr and either use _header and _payload or just _payload as websocket frame
- *
- */
+ /** @brief Decode given buffer containing websocket frame to payload
+ * @param buffer Pointer to buffer to be decoded as websocket frame
+ * @param length Length of buffer to be decoded as websocket frame
+ * @retval Return true on success, false on error
+ *
+ * @details if successfully executed, check _frameType to decide what to do with payload pointed by _payload
+ *
+ */
uint8_t decodeFrame(uint8_t * buffer, size_t length);
- /** @brief Decode given buffer containing websocket frame to payload
- * @param buffer Pointer to buffer to be decoded as websocket frame
- * @param length Length of buffer to be decoded as websocket frame
- * @retval Return true on success, false on error
- *
- * @details if successfully executed, check _frameType to decide what to do with payload pointed by _payload
- *
- */
+
+
+ static int mask(const String& payload, uint32_t key, char *data);
+
protected:
uint8_t* _payload = nullptr; // pointer to payload; in encode - will point to proper websocket frame payload, in decode - will point to websocket frame's decoded data
size_t _payloadLength = 0;
From c2cc852e40b1971a1987aceeedab5b28b8c7297c Mon Sep 17 00:00:00 2001
From: slaff
Date: Thu, 23 Nov 2017 10:42:12 +0100
Subject: [PATCH 45/50] Added experimental support for SDK 2.1 (#1264)
In order to use SDK 2.1 you should set one environment variable before compiling Sming and applications based on it. The variable is SDK_BASE and it should point to `$SMING_HOME/third-party/ESP8266_NONOS_SDK`.
For Windows you need to do:
```
set SDK_BASE %SMING_HOME%//third-party/ESP8266_NONOS_SDK
```
For Linux(bash) you need to do:
```
export SDK_BASE="$SMING_HOME/third-party/ESP8266_NONOS_SDK"
```
Read the comments from this URL for known issues:
https://github.com/SmingHub/Sming/pull/1264
---
.gitmodules | 4 ++
.travis.yml | 13 +++--
Sming/Makefile | 10 +++-
Sming/Makefile-project.mk | 4 ++
Sming/Makefile-rboot.mk | 4 ++
Sming/SmingCore/HardwareTimer.cpp | 4 +-
Sming/SmingCore/Interrupts.cpp | 2 +-
Sming/SmingCore/SPI.cpp | 3 +-
Sming/compiler/ld/common.ld | 27 +++++++++-
Sming/include/user_config.h | 12 +++--
Sming/system/include/esp_systemapi.h | 22 ++++++--
Sming/system/uart.cpp | 9 ++--
.../.patches/ESP8266_NONOS_SDK.patch | 13 +++++
Sming/third-party/.patches/esp-gdbstub.patch | 11 +++-
.../third-party/.patches/esp-open-lwip.patch | 22 ++++----
Sming/third-party/.patches/lwip2.patch | 51 +++++++++++++++++++
Sming/third-party/.patches/pwm.patch | 31 +++++------
Sming/third-party/ESP8266_NONOS_SDK | 1 +
18 files changed, 188 insertions(+), 55 deletions(-)
create mode 100644 Sming/third-party/.patches/ESP8266_NONOS_SDK.patch
create mode 160000 Sming/third-party/ESP8266_NONOS_SDK
diff --git a/.gitmodules b/.gitmodules
index 0bec643f7d..a32e4f5042 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -57,3 +57,7 @@
path = Sming/third-party/lwip2
url = https://github.com/d-a-v/esp82xx-nonos-linklayer.git
ignore = dirty
+[submodule "Sming/third-party/ESP8266_NONOS_SDK"]
+ path = Sming/third-party/ESP8266_NONOS_SDK
+ url = https://github.com/espressif/ESP8266_NONOS_SDK.git
+ ignore = dirty
diff --git a/.travis.yml b/.travis.yml
index d9c3e9b868..1d017afebf 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,6 +12,8 @@ matrix:
env: SDK_VERSION=1.5.0
- os: linux
env: SDK_VERSION=2.0.0
+ - os: linux
+ env: SDK_VERSION=2.1.0
git:
submodules: false
@@ -29,12 +31,12 @@ addons:
- graphviz
install:
- - if [ "$SDK_VERSION" != "2.0.0" ] && [ "$TRAVIS_OS_NAME" == "osx" ]; then export SDK_FILE_NAME="esp-alt-sdk-v${SDK_VERSION}.${SDK_BUILD}-macos-x86_64.zip"; fi
- - if [ "$SDK_VERSION" != "2.0.0" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then export SDK_FILE_NAME="esp-alt-sdk-v${SDK_VERSION}.${SDK_BUILD}-linux-x86_64.tar.gz"; fi
+ - if [ "$SDK_VERSION" == "1.5.0" ] && [ "$TRAVIS_OS_NAME" == "osx" ]; then export SDK_FILE_NAME="esp-alt-sdk-v${SDK_VERSION}.${SDK_BUILD}-macos-x86_64.zip"; fi
+ - if [ "$SDK_VERSION" == "1.5.0" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then export SDK_FILE_NAME="esp-alt-sdk-v${SDK_VERSION}.${SDK_BUILD}-linux-x86_64.tar.gz"; fi
- mkdir -p $TRAVIS_BUILD_DIR/opt/esp-alt-sdk
- - if [ "$SDK_VERSION" != "2.0.0" ]; then wget https://bintray.com/artifact/download/kireevco/generic/${SDK_FILE_NAME}; fi
- - if [ "$SDK_VERSION" != "2.0.0" ]; then bsdtar -xf ${SDK_FILE_NAME} -C $TRAVIS_BUILD_DIR/opt/esp-alt-sdk; fi
- - if [ "$SDK_VERSION" == "2.0.0" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then wget https://github.com/nodemcu/nodemcu-firmware/raw/master/tools/esp-open-sdk.tar.xz; tar -Jxvf esp-open-sdk.tar.xz; ln -s `pwd`/esp-open-sdk/xtensa-lx106-elf $TRAVIS_BUILD_DIR/opt/esp-alt-sdk/. ; fi
+ - if [ "$SDK_VERSION" == "1.5.0" ]; then wget https://bintray.com/artifact/download/kireevco/generic/${SDK_FILE_NAME}; fi
+ - if [ "$SDK_VERSION" == "1.5.0" ]; then bsdtar -xf ${SDK_FILE_NAME} -C $TRAVIS_BUILD_DIR/opt/esp-alt-sdk; fi
+ - if [[ "$SDK_VERSION" != "1.5.0" && "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://github.com/nodemcu/nodemcu-firmware/raw/master/tools/esp-open-sdk.tar.xz; tar -Jxvf esp-open-sdk.tar.xz; ln -s `pwd`/esp-open-sdk/xtensa-lx106-elf $TRAVIS_BUILD_DIR/opt/esp-alt-sdk/. ; fi
- if [ "$SDK_VERSION" == "2.0.0" ] && [ "$TRAVIS_OS_NAME" == "linux" ]; then wget http://bbs.espressif.com/download/file.php?id=1690 -O sdk.zip; unzip sdk.zip; ln -s `pwd`/ESP8266_NONOS_SDK/ $TRAVIS_BUILD_DIR/opt/esp-alt-sdk/sdk; export DEPLOY='true'; fi
script:
@@ -42,6 +44,7 @@ script:
- export CHANGED_PROJECTS=`for i in $CHANGED_FILES; do echo "$i" | grep '^samples/' | cut -d'/' -f2; done | uniq`
- export SMING_HOME=$TRAVIS_BUILD_DIR/Sming
- export ESP_HOME=$TRAVIS_BUILD_DIR/opt/esp-alt-sdk
+ - if [ "$SDK_VERSION" == "2.1.0" ]; then export SDK_BASE=$SMING_HOME/third-party/ESP8266_NONOS_SDK; fi
- export PATH=$PATH:$ESP_HOME/xtensa-lx106-elf/bin:$ESP_HOME/utils/:$SMING_HOME/../.travis/tools
- cd $SMING_HOME
- make test
diff --git a/Sming/Makefile b/Sming/Makefile
index b70cd2594b..d47f0e8e75 100644
--- a/Sming/Makefile
+++ b/Sming/Makefile
@@ -173,11 +173,17 @@ THIRD_PARTY_DATA += third-party/http-parser/Makefile
MODULES += third-party/http-parser/
EXTRA_INCDIR += third-party/http-parser/
-# => webscoket-parser
+# => websocket-parser
THIRD_PARTY_DATA += third-party/ws_parser/Makefile
MODULES += third-party/ws_parser/
EXTRA_INCDIR += third-party/ws_parser/
+# => SDK
+ifneq (,$(findstring third-party/ESP8266_NONOS_SDK, $(SDK_BASE)))
+ THIRD_PARTY_DATA += third-party/ESP8266_NONOS_SDK/Makefile
+ CFLAGS += -DSDK_INTERNAL
+endif
+
# => esp-gdbstub
ifeq ($(ENABLE_GDB), 1)
THIRD_PARTY_DATA += third-party/esp-gdbstub/Makefile
@@ -240,7 +246,7 @@ endif
MFORCE32 := $(shell $(CC) --help=target | grep mforce-l32)
# compiler flags using during compilation of source files. Add '-pg' for debugging
-CFLAGS = -Wpointer-arith -Wundef -Werror -Wl,-EL -nostdlib -mlongcalls -mtext-section-literals -finline-functions -fdata-sections -ffunction-sections \
+CFLAGS += -Wpointer-arith -Wundef -Werror -Wl,-EL -nostdlib -mlongcalls -mtext-section-literals -finline-functions -fdata-sections -ffunction-sections \
-D__ets__ -DICACHE_FLASH -DARDUINO=106 -DCOM_SPEED_SERIAL=$(COM_SPEED_SERIAL) -DENABLE_CMD_EXECUTOR=$(ENABLE_CMD_EXECUTOR) -DESP8266=1
ifeq ($(SMING_RELEASE),1)
# See: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
diff --git a/Sming/Makefile-project.mk b/Sming/Makefile-project.mk
index 7e52eea2c4..18e1ccd814 100644
--- a/Sming/Makefile-project.mk
+++ b/Sming/Makefile-project.mk
@@ -227,6 +227,10 @@ endif
# compiler flags using during compilation of source files
CFLAGS = -Wpointer-arith -Wundef -Werror -Wl,-EL -nostdlib -mlongcalls -mtext-section-literals -finline-functions -fdata-sections -ffunction-sections -D__ets__ -DICACHE_FLASH -DARDUINO=106 -DCOM_SPEED_SERIAL=$(COM_SPEED_SERIAL) $(USER_CFLAGS) -DENABLE_CMD_EXECUTOR=$(ENABLE_CMD_EXECUTOR)
+# => SDK
+ifneq (,$(findstring third-party/ESP8266_NONOS_SDK, $(SDK_BASE)))
+ CFLAGS += -DSDK_INTERNAL
+endif
ifeq ($(SMING_RELEASE),1)
# See: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
# for full list of optimization options
diff --git a/Sming/Makefile-rboot.mk b/Sming/Makefile-rboot.mk
index 9ac90dc0bb..c7d983aa3d 100644
--- a/Sming/Makefile-rboot.mk
+++ b/Sming/Makefile-rboot.mk
@@ -198,6 +198,10 @@ USER_LIBDIR = $(SMING_HOME)/compiler/lib/
# compiler flags using during compilation of source files
CFLAGS = -Wpointer-arith -Wundef -Werror -Wl,-EL -nostdlib -mlongcalls -mtext-section-literals -finline-functions -fdata-sections -ffunction-sections -D__ets__ -DICACHE_FLASH -DARDUINO=106 -DCOM_SPEED_SERIAL=$(COM_SPEED_SERIAL) $(USER_CFLAGS) -DENABLE_CMD_EXECUTOR=$(ENABLE_CMD_EXECUTOR)
+# => SDK
+ifneq (,$(findstring third-party/ESP8266_NONOS_SDK, $(SDK_BASE)))
+ CFLAGS += -DSDK_INTERNAL
+endif
ifeq ($(SMING_RELEASE),1)
# See: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
# for full list of optimization options
diff --git a/Sming/SmingCore/HardwareTimer.cpp b/Sming/SmingCore/HardwareTimer.cpp
index 4ee271f53e..2026293f22 100644
--- a/Sming/SmingCore/HardwareTimer.cpp
+++ b/Sming/SmingCore/HardwareTimer.cpp
@@ -48,12 +48,12 @@ static void IRAM_ATTR hw_timer_isr_cb(void *arg)
Hardware_Timer::Hardware_Timer()
{
- ETS_FRC_TIMER1_INTR_ATTACH((void*)hw_timer_isr_cb, (void *)this);
+ ETS_FRC_TIMER1_INTR_ATTACH((ets_isr_t)hw_timer_isr_cb, (void *)this);
}
Hardware_Timer::~Hardware_Timer()
{
- ETS_FRC_TIMER1_INTR_ATTACH((void*)hw_timer_isr_cb, null);
+ ETS_FRC_TIMER1_INTR_ATTACH((ets_isr_t)hw_timer_isr_cb, null);
stop();
}
diff --git a/Sming/SmingCore/Interrupts.cpp b/Sming/SmingCore/Interrupts.cpp
index 7f775e8a2c..d00df45e63 100644
--- a/Sming/SmingCore/Interrupts.cpp
+++ b/Sming/SmingCore/Interrupts.cpp
@@ -47,7 +47,7 @@ void attachInterruptHandler(uint8_t pin, GPIO_INT_TYPE mode)
if (!_gpioInterruptsInitialied)
{
- ETS_GPIO_INTR_ATTACH((void*)interruptHandler, NULL); // Register interrupt handler
+ ETS_GPIO_INTR_ATTACH((ets_isr_t)interruptHandler, NULL); // Register interrupt handler
_gpioInterruptsInitialied = true;
}
diff --git a/Sming/SmingCore/SPI.cpp b/Sming/SmingCore/SPI.cpp
index 117afad5e4..b3f1787485 100644
--- a/Sming/SmingCore/SPI.cpp
+++ b/Sming/SmingCore/SPI.cpp
@@ -20,8 +20,7 @@
#include
#include "eagle_soc.h"
#include "espinc/spi_register.h"
-#include "espinc/c_types_compatible.h"
-
+#include "c_types.h"
// define the static singleton
SPIClass SPI;
diff --git a/Sming/compiler/ld/common.ld b/Sming/compiler/ld/common.ld
index 461fff9c50..a76fd0ea2e 100644
--- a/Sming/compiler/ld/common.ld
+++ b/Sming/compiler/ld/common.ld
@@ -152,11 +152,36 @@ SECTIONS
.irom0.text : ALIGN(4)
{
_irom0_text_start = ABSOLUTE(.);
+
+ *libsmartconfig.a:(.literal .text .literal.* .text.*)
+ *libstdc++.a:(.literal .text .literal.* .text.*)
+ *liblwip_open.a:(.literal .text .literal.* .text.*)
+ *liblwip_full.a:(.literal .text .literal.* .text.*)
+ *liblwip2.a:(.literal .text .literal.* .text.*)
+ *libaxtls.a:(.literal .text .literal.* .text.*)
+ *libat.a:(.literal.* .text.*)
+ *libcrypto.a:(.literal.* .text.*)
+ *libespnow.a:(.literal.* .text.*)
+ *libjson.a:(.literal.* .text.*)
+ *liblwip.a:(.literal.* .text.*)
+ *libmesh.a:(.literal.* .text.*)
+ *libnet80211.a:(.literal.* .text.*)
+ *libsmartconfig.a:(.literal.* .text.*)
+ *libssl.a:(.literal.* .text.*)
+ *libupgrade.a:(.literal.* .text.*)
+ *libwpa.a:(.literal.* .text.*)
+ *libwpa2.a:(.literal.* .text.*)
+ *libwps.a:(.literal.* .text.*)
+
+ *libmbedtls.a:(.literal.* .text.*)
+
+ *libm.a:(.literal .text .literal.* .text.*)
+
*(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text .irom.debug.*)
out/build/app_app.a:*(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.* .irom.debug.*)
*libsming.a:*(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.* .irom.debug.*)
*libsmingssl.a:*(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.* .irom.debug.*)
- *liblwip2.a:(.literal .text .literal.* .text.*)
+
_irom0_text_end = ABSOLUTE(.);
_flash_code_end = ABSOLUTE(.);
} >irom0_0_seg :irom0_0_phdr
diff --git a/Sming/include/user_config.h b/Sming/include/user_config.h
index d498e0d580..ea24da560e 100644
--- a/Sming/include/user_config.h
+++ b/Sming/include/user_config.h
@@ -17,13 +17,17 @@ extern "C" {
#include
#include
- // Override c_types.h include and remove buggy espconn
- #define _C_TYPES_H_
+ // Remove buggy espconn
#define _NO_ESPCON_
- // Updated, compatible version of c_types.h
- // Just removed types declared in
+#ifdef SDK_INTERNAL
+ // ESP SDK 2.1 or later provide proper c_types.h
+ #include "c_types.h"
+#else
+ // Older SDKs, have wrong or incompatible c_types type definitions
+ #define _C_TYPES_H_
#include
+#endif /* SDK_INTERNAL */
// System API declarations
#include
diff --git a/Sming/system/include/esp_systemapi.h b/Sming/system/include/esp_systemapi.h
index 19e303742e..4c964a2a54 100644
--- a/Sming/system/include/esp_systemapi.h
+++ b/Sming/system/include/esp_systemapi.h
@@ -44,6 +44,7 @@
#define assert(condition) if (!(condition)) SYSTEM_ERROR("ASSERT: %s %d", __FUNCTION__, __LINE__)
#define SYSTEM_ERROR(fmt, ...) m_printf("ERROR: " fmt "\r\n", ##__VA_ARGS__)
+#ifndef SDK_INTERNAL
extern void ets_timer_arm_new(ETSTimer *ptimer, uint32_t milliseconds, bool repeat_flag, int isMstimer);
extern void ets_timer_disarm(ETSTimer *a);
extern void ets_timer_setfn(ETSTimer *t, ETSTimerFunc *pfunction, void *parg);
@@ -57,13 +58,18 @@ extern void ets_delay_us(uint32_t us);
extern void ets_isr_mask(unsigned intr);
extern void ets_isr_unmask(unsigned intr);
-extern void ets_isr_attach(int intr, void *handler, void *arg);
+
+typedef void (* ets_isr_t)(void *);
+
+//extern void ets_isr_attach(int intr, void *handler, void *arg);
+extern void ets_isr_attach(int i, ets_isr_t func, void *arg);
extern int ets_memcmp(const void *s1, const void *s2, size_t n);
extern void *ets_memcpy(void *dest, const void *src, size_t n);
extern void *ets_memset(void *s, int c, size_t n);
-extern void ets_install_putc1(void *routine);
+//extern void ets_install_putc1(void *routine);
+extern void ets_install_putc1(void (*p)(char c));
extern int ets_sprintf(char *str, const char *format, ...) __attribute__ ((format (printf, 2, 3)));
extern int ets_str2macaddr(void *, void *);
extern int ets_strcmp(const char *s1, const char *s2);
@@ -71,8 +77,8 @@ extern char *ets_strcpy(char *dest, const char *src);
//extern int os_random();
//extern char *ets_strdup(const char *str); // :(
const char * ets_strrchr(const char *str, int character);
-extern size_t ets_strlen(const char *s);
-extern int ets_strncmp(const char *s1, const char *s2, int len);
+extern int ets_strlen(const char *s);
+extern int ets_strncmp(const char *s1, const char *s2, unsigned int len);
extern char *ets_strncpy(char *dest, const char *src, size_t n);
extern char *ets_strstr(const char *haystack, const char *needle);
extern int os_printf_plus(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
@@ -85,13 +91,15 @@ extern void pvPortFree(void *ptr);
extern void vPortFree(void *ptr, const char *file, uint32 line);
extern void *vPortMalloc(size_t xWantedSize);
-extern void uart_div_modify(int no, unsigned int freq);
+extern void uart_div_modify(uint8 uart_no, uint32 DivLatchValue);
extern int ets_uart_printf(const char *fmt, ...);
extern void uart_tx_one_char(char ch);
extern void ets_intr_lock();
extern void ets_intr_unlock();
+#endif /* SDK_INTERNAL */
+
// CPU Frequency
extern void ets_update_cpu_frequency(uint32_t frq);
extern uint32_t ets_get_cpu_frequency();
@@ -99,6 +107,10 @@ extern uint32_t ets_get_cpu_frequency();
extern void xt_disable_interrupts();
extern void xt_enable_interrupts();
+extern void uart_tx_one_char(char ch);
+extern void ets_isr_mask(unsigned intr);
+extern void ets_isr_unmask(unsigned intr);
+
typedef signed short file_t;
#endif
diff --git a/Sming/system/uart.cpp b/Sming/system/uart.cpp
index 87e95f0903..e2bc99ca00 100644
--- a/Sming/system/uart.cpp
+++ b/Sming/system/uart.cpp
@@ -139,8 +139,7 @@ void uart_start_isr(uart_t* uart)
USC1(uart->uart_nr) = (127 << UCFFT) | (0x02 << UCTOT) | (1 <uart_nr) = 0xffff;
USIE(uart->uart_nr) = (1 << UIFF) | (1 << UIFR) | (1 << UITO);
-// ETS_UART_INTR_ATTACH(uart_isr, (void *)uart);
- ETS_UART_INTR_ATTACH((void *)uart_isr, (void *)uart);
+ ETS_UART_INTR_ATTACH(uart_isr, (void *)uart);
ETS_UART_INTR_ENABLE();
}
@@ -492,16 +491,16 @@ void uart_set_debug(int uart_nr)
switch(s_uart_debug_nr) {
case UART0:
system_set_os_print(1);
- ets_install_putc1((void *) &uart0_write_char);
+ ets_install_putc1(uart0_write_char);
break;
case UART1:
system_set_os_print(1);
- ets_install_putc1((void *) &uart1_write_char);
+ ets_install_putc1(uart1_write_char);
break;
case UART_NO:
default:
system_set_os_print(0);
- ets_install_putc1((void *) &uart_ignore_char);
+ ets_install_putc1(uart_ignore_char);
break;
}
}
diff --git a/Sming/third-party/.patches/ESP8266_NONOS_SDK.patch b/Sming/third-party/.patches/ESP8266_NONOS_SDK.patch
new file mode 100644
index 0000000000..1b0e3351ed
--- /dev/null
+++ b/Sming/third-party/.patches/ESP8266_NONOS_SDK.patch
@@ -0,0 +1,13 @@
+diff --git a/include/osapi.h b/include/osapi.h
+index 0462a9c..52ad21f 100644
+--- a/include/osapi.h
++++ b/include/osapi.h
+@@ -30,7 +30,7 @@
+ #include "user_config.h"
+
+ void ets_bzero(void *s, size_t n);
+-void ets_delay_us(uint16_t us);
++void ets_delay_us(uint32_t us);
+ void ets_install_putc1(void (*p)(char c));
+
+ #define os_bzero ets_bzero
diff --git a/Sming/third-party/.patches/esp-gdbstub.patch b/Sming/third-party/.patches/esp-gdbstub.patch
index c6ec250659..0bb2a20791 100644
--- a/Sming/third-party/.patches/esp-gdbstub.patch
+++ b/Sming/third-party/.patches/esp-gdbstub.patch
@@ -1,5 +1,5 @@
diff --git a/gdbstub.c b/gdbstub.c
-index 5fc6633..03f6d49 100644
+index 5fc6633..fe655b8 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -8,6 +8,7 @@
@@ -42,3 +42,12 @@ index 5fc6633..03f6d49 100644
while(gdbReadCommand()!=ST_CONT);
ets_wdt_enable();
//Copy any changed registers back to the frame the Xtensa HAL uses.
+@@ -714,7 +719,7 @@ static void ATTR_GDBFN uart_hdlr(void *arg, void *frame) {
+ }
+
+ static void ATTR_GDBINIT install_uart_hdlr() {
+- ets_isr_attach(ETS_UART_INUM, uart_hdlr, NULL);
++ ets_isr_attach(ETS_UART_INUM, (ets_isr_t)uart_hdlr, NULL);
+ SET_PERI_REG_MASK(UART_INT_ENA(0), UART_RXFIFO_FULL_INT_ENA|UART_RXFIFO_TOUT_INT_ENA);
+ ets_isr_unmask((1<
+
#define EFAULT 14
@@ -90,7 +92,7 @@ index ff03b30..6664d59 100644
+extern void *ets_memset(void *s, int c, size_t n);
+extern void *ets_memcpy(void *dest, const void *src, size_t n);
+
-+extern size_t ets_strlen(const char *s);
++extern int ets_strlen(const char *s);
+extern int os_printf_plus(const char *format, ...) __attribute__ ((format (printf, 1, 2)));
+extern int ets_sprintf(char *str, const char *format, ...) __attribute__ ((format (printf, 2, 3)));
+//extern void ets_timer_arm_new(ETSTimer *ptimer, uint32_t milliseconds, bool repeat_flag, int isMstimer);
@@ -104,7 +106,7 @@ index ff03b30..6664d59 100644
//#define LWIP_PROVIDE_ERRNO
#if (1)
-@@ -56,6 +73,7 @@ typedef signed short s16_t;
+@@ -56,6 +74,7 @@ typedef signed short s16_t;
typedef unsigned long u32_t;
typedef signed long s32_t;
typedef unsigned long mem_ptr_t;
@@ -112,7 +114,7 @@ index ff03b30..6664d59 100644
#define S16_F "d"
#define U16_F "d"
-@@ -73,11 +91,12 @@ typedef unsigned long mem_ptr_t;
+@@ -73,11 +92,12 @@ typedef unsigned long mem_ptr_t;
#define PACK_STRUCT_BEGIN
#define PACK_STRUCT_END
@@ -247,7 +249,7 @@ index af6e360..6d8cabd 100644
#endif
#else
#ifndef mem_free
- diff --git a/lwip/app/dhcpserver.c b/lwip/app/dhcpserver.c
+diff --git a/lwip/app/dhcpserver.c b/lwip/app/dhcpserver.c
index ddb5984..fb677c6 100644
--- a/lwip/app/dhcpserver.c
+++ b/lwip/app/dhcpserver.c
diff --git a/Sming/third-party/.patches/lwip2.patch b/Sming/third-party/.patches/lwip2.patch
index 5c772b6ef5..c752f3eef3 100644
--- a/Sming/third-party/.patches/lwip2.patch
+++ b/Sming/third-party/.patches/lwip2.patch
@@ -23,3 +23,54 @@ index 63cd72d..5f100eb 100644
#ifdef LWIP_BUILD
// define LWIP_BUILD only when building LWIP
+diff --git a/Makefile.sming b/Makefile.sming
+index 842f4fe..7550a72 100644
+--- a/Makefile.sming
++++ b/Makefile.sming
+@@ -4,12 +4,13 @@
+ USER_LIBDIR ?= tweaked-
+ LWIP_LIB_RELEASE=$(USER_LIBDIR)liblwip2.a
+ LWIP_INCLUDES_RELEASE=include
++SDK_BASE ?= $(ESP_HOME)/sdk
+
+ all: install
+
+ %:
+ @make -f makefiles/Makefile.build-lwip2 \
+- SDK=$(ESP_HOME)/sdk \
++ SDK=$(SDK_BASE) \
+ LWIP_LIB=liblwip2.a \
+ LWIP_LIB_RELEASE=$(LWIP_LIB_RELEASE) \
+ LWIP_INCLUDES_RELEASE=$(LWIP_INCLUDES_RELEASE) \
+diff --git a/glue/esp-missing.h b/glue/esp-missing.h
+index 0e42073..4cb5d6c 100644
+--- a/glue/esp-missing.h
++++ b/glue/esp-missing.h
+@@ -9,9 +9,9 @@
+
+ uint32_t r_rand (void);
+
+-void* pvPortZalloc (size_t, const char*, int);
+-void* pvPortMalloc (size_t xWantedSize, const char* file, int line) __attribute__((malloc, alloc_size(1)));
+-void vPortFree (void *ptr, const char* file, int line);
++void* pvPortZalloc (size_t, const char*, unsigned line);
++void* pvPortMalloc (size_t xWantedSize, const char* file, unsigned line) __attribute__((malloc, alloc_size(1)));
++void vPortFree (void *ptr, const char* file, unsigned line);
+
+ struct netif* eagle_lwip_getif (int netif_index);
+
+@@ -27,10 +27,10 @@ int ets_memcmp (const void*, const void*, size_t n);
+ void *ets_memset (void *s, int c, size_t n);
+ void *ets_memcpy (void *dest, const void *src, size_t n);
+
+-typedef void ETSTimerFunc(void *timer_arg);
+-void ets_timer_disarm (ETSTimer *a);
+-void ets_timer_arm_new (ETSTimer *a, int b, int c, int isMstimer);
+-void ets_timer_setfn (ETSTimer *t, ETSTimerFunc *fn, void *parg);
++//typedef void ETSTimerFunc(void *timer_arg);
++//void ets_timer_disarm (ETSTimer *a);
++//void ets_timer_arm_new (ETSTimer *a, int b, int c, int isMstimer);
++//void ets_timer_setfn (ETSTimer *t, ETSTimerFunc *fn, void *parg);
+
+ struct ip_addr;
+ void wifi_softap_set_station_info (uint8_t* mac, struct ip_addr*);
diff --git a/Sming/third-party/.patches/pwm.patch b/Sming/third-party/.patches/pwm.patch
index 7f59825408..bd2b382c65 100644
--- a/Sming/third-party/.patches/pwm.patch
+++ b/Sming/third-party/.patches/pwm.patch
@@ -1,25 +1,22 @@
diff --git a/pwm.c b/pwm.c
-index 5e7f218..51bdf35 100644
+index 5e7f218..0386a06 100644
--- a/pwm.c
+++ b/pwm.c
-@@ -18,6 +18,8 @@
+@@ -16,6 +16,8 @@
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
++#include
++
/* Set the following three defines to your needs */
-+#include
-+
#ifndef SDK_PWM_PERIOD_COMPAT_MODE
- #define SDK_PWM_PERIOD_COMPAT_MODE 0
- #endif
-@@ -42,6 +44,11 @@
- #define PWM_MAX_PERIOD PWM_MAX_TICKS
- #endif
+@@ -109,7 +111,7 @@ struct timer_regs {
+ };
+ static struct timer_regs* timer = (void*)(0x60000600);
-+/* ISR related definitions that are missing in some SDKs */
-+extern void ets_isr_attach(int intr, void *handler, void *arg);
-+extern void ets_isr_mask(unsigned intr);
-+extern void ets_isr_unmask(unsigned intr);
-+
- #include
- #include
- #include
+-static void pwm_intr_handler(void)
++static void pwm_intr_handler(void* param)
+ {
+ if ((pwm_state.current_set[pwm_state.current_phase].off_mask == 0) &&
+ (pwm_state.current_set[pwm_state.current_phase].on_mask == 0)) {
diff --git a/Sming/third-party/ESP8266_NONOS_SDK b/Sming/third-party/ESP8266_NONOS_SDK
new file mode 160000
index 0000000000..61248df5f6
--- /dev/null
+++ b/Sming/third-party/ESP8266_NONOS_SDK
@@ -0,0 +1 @@
+Subproject commit 61248df5f6d45d130313b412f7492f581fd4cadf
From 8d07e784e8f98cda99a81b4243c584ad6307bc69 Mon Sep 17 00:00:00 2001
From: slaff
Date: Fri, 1 Dec 2017 20:32:38 +0100
Subject: [PATCH 46/50] Made spiffs_mount() compatible with rBoot. (#1292)
---
Sming/Makefile-rboot.mk | 3 +-
Sming/Services/SpifFS/spiffs_sming.c | 40 +--------------------
Sming/Services/SpifFS/spiffs_sming.h | 3 +-
Sming/appspecific/rboot/overrides.c | 23 ++++++++++++
samples/Basic_WebClient/app/application.cpp | 2 +-
5 files changed, 29 insertions(+), 42 deletions(-)
create mode 100644 Sming/appspecific/rboot/overrides.c
diff --git a/Sming/Makefile-rboot.mk b/Sming/Makefile-rboot.mk
index c7d983aa3d..470cb8ea01 100644
--- a/Sming/Makefile-rboot.mk
+++ b/Sming/Makefile-rboot.mk
@@ -179,6 +179,7 @@ endif
# define your custom directories in the project's own Makefile before including this one
MODULES ?= app # default to app if not set by user
MODULES += $(THIRD_PARTY_DIR)/rboot/appcode
+MODULES += $(SMING_HOME)/appspecific/rboot
EXTRA_INCDIR ?= include # default to include if not set by user
ENABLE_CUSTOM_LWIP ?= 1
@@ -313,7 +314,7 @@ ifeq ($(DISABLE_SPIFFS), 1)
endif
# linker flags used to generate the main object file
-LDFLAGS = -nostdlib -u call_user_start -u Cache_Read_Enable_New -Wl,-static -Wl,--gc-sections -Wl,-Map=$(basename $@).map -Wl,-wrap,system_restart_local
+LDFLAGS = -nostdlib -u call_user_start -u Cache_Read_Enable_New -u spiffs_get_storage_config -Wl,-static -Wl,--gc-sections -Wl,-Map=$(basename $@).map -Wl,-wrap,system_restart_local
ifeq ($(SPI_SPEED), 26)
flashimageoptions = -ff 26m
diff --git a/Sming/Services/SpifFS/spiffs_sming.c b/Sming/Services/SpifFS/spiffs_sming.c
index 12b71cf918..4af5d71998 100644
--- a/Sming/Services/SpifFS/spiffs_sming.c
+++ b/Sming/Services/SpifFS/spiffs_sming.c
@@ -1,7 +1,5 @@
#include "spiffs_sming.h"
-#define LOG_PAGE_SIZE 256
-
spiffs _filesystemStorageHandle;
static u8_t spiffs_work_buf[LOG_PAGE_SIZE*2];
@@ -39,7 +37,7 @@ the entire chip (chip erase). The W25Q32BV has 1,024 erasable sectors and 64 era
The small 4KB sectors allow for greater flexibility in applications that require data and parameter storage.
********************/
-spiffs_config spiffs_get_storage_config()
+spiffs_config __attribute__((weak)) spiffs_get_storage_config()
{
spiffs_config cfg = {0};
cfg.phys_addr = ( u32_t )flashmem_get_first_free_block_address();
@@ -185,39 +183,3 @@ bool spiffs_format_manual(u32_t phys_addr, u32_t phys_size)
spiffs_mount_manual(phys_addr, phys_size);
return true;
}
-
-//int spiffs_check( void )
-//{
- // ets_wdt_disable();
- // int res = (int)SPIFFS_check(&_filesystemStorageHandle);
- // ets_wdt_enable();
- // return res;
-//}
-
-void test_spiffs()
-{
- char buf[12] = {0};
-
- // Surely, I've mounted spiffs before entering here
-
- spiffs_file fd;
- spiffs_stat st = {0};
- SPIFFS_stat(&_filesystemStorageHandle, "my_file.txt", &st);
- if (st.size <= 0)
- {
- fd = SPIFFS_open(&_filesystemStorageHandle, "my_file.txt", SPIFFS_CREAT | SPIFFS_TRUNC | SPIFFS_RDWR, 0);
- if (SPIFFS_write(&_filesystemStorageHandle, fd, (u8_t *)"Hello world", 11) < 0)
- debugf("errno %d\n", SPIFFS_errno(&_filesystemStorageHandle));
- SPIFFS_close(&_filesystemStorageHandle, fd);
- debugf("file created");
- }
- else
- debugf("file %s exist :)", st.name);
-
-
- fd = SPIFFS_open(&_filesystemStorageHandle, "my_file.txt", SPIFFS_RDWR, 0);
- if (SPIFFS_read(&_filesystemStorageHandle, fd, (u8_t *)buf, 11) < 0) debugf("errno %d\n", SPIFFS_errno(&_filesystemStorageHandle));
- SPIFFS_close(&_filesystemStorageHandle, fd);
-
- debugf("--> %s <--\n", buf);
-}
diff --git a/Sming/Services/SpifFS/spiffs_sming.h b/Sming/Services/SpifFS/spiffs_sming.h
index 28bdac66a2..31cb89eaa8 100644
--- a/Sming/Services/SpifFS/spiffs_sming.h
+++ b/Sming/Services/SpifFS/spiffs_sming.h
@@ -7,6 +7,8 @@ extern "C" {
#include "spiffs.h"
+#define LOG_PAGE_SIZE 256
+
void spiffs_mount();
void spiffs_mount_manual(u32_t phys_addr, u32_t phys_size);
void spiffs_unmount();
@@ -14,7 +16,6 @@ bool spiffs_format();
bool spiffs_format_internal(spiffs_config *cfg);
bool spiffs_format_manual(u32_t phys_addr, u32_t phys_size);
spiffs_config spiffs_get_storage_config();
-extern void test_spiffs();
extern spiffs _filesystemStorageHandle;
diff --git a/Sming/appspecific/rboot/overrides.c b/Sming/appspecific/rboot/overrides.c
new file mode 100644
index 0000000000..fcf3d83333
--- /dev/null
+++ b/Sming/appspecific/rboot/overrides.c
@@ -0,0 +1,23 @@
+#include "spiffs_sming.h"
+
+/*
+ * rBoot uses different spiffs organization and we need to override this method
+ * during application compile time in order to make automatic
+ * mounting with `spiffs_mount()` work as expected.
+ */
+spiffs_config spiffs_get_storage_config()
+{
+ spiffs_config cfg = {0};
+#ifdef RBOOT_SPIFFS_0
+ cfg.phys_addr = RBOOT_SPIFFS_0;
+#elif RBOOT_SPIFFS_1
+ cfg.phys_addr = RBOOT_SPIFFS_1;
+#else
+#error "Define either RBOOT_SPIFFS_0 or RBOOT_SPIFFS_1"
+#endif
+ cfg.phys_size = SPIFF_SIZE;
+ cfg.phys_erase_block = INTERNAL_FLASH_SECTOR_SIZE; // according to datasheet
+ cfg.log_block_size = INTERNAL_FLASH_SECTOR_SIZE * 2; // Important to make large
+ cfg.log_page_size = LOG_PAGE_SIZE; // as we said
+ return cfg;
+}
diff --git a/samples/Basic_WebClient/app/application.cpp b/samples/Basic_WebClient/app/application.cpp
index 05ec2d5d43..3421b55eca 100644
--- a/samples/Basic_WebClient/app/application.cpp
+++ b/samples/Basic_WebClient/app/application.cpp
@@ -194,7 +194,7 @@ void init()
#ifndef DISABLE_SPIFFS
debugf("trying to mount spiffs at 0x%08x, length %d", RBOOT_SPIFFS_0, SPIFF_SIZE);
- spiffs_mount_manual(RBOOT_SPIFFS_0, SPIFF_SIZE);
+ spiffs_mount();
#endif
// Setup the WIFI connection
From 53fd0eb082b7da83db5259a319a0103ecc2f87f1 Mon Sep 17 00:00:00 2001
From: slaff
Date: Mon, 4 Dec 2017 09:21:52 +0100
Subject: [PATCH 47/50] Added Stream::indexOf(char c) that finds a character in
a stream (#1290)
without advancing the internal stream pointers.
---
Sming/SmingCore/HardwareSerial.cpp | 23 +++++++++++++++++++++++
Sming/SmingCore/HardwareSerial.h | 7 +++++++
Sming/Wiring/Stream.h | 9 +++++++++
samples/Basic_rBoot/app/application.cpp | 8 ++++----
4 files changed, 43 insertions(+), 4 deletions(-)
diff --git a/Sming/SmingCore/HardwareSerial.cpp b/Sming/SmingCore/HardwareSerial.cpp
index 37fede7487..3b08f0aa82 100644
--- a/Sming/SmingCore/HardwareSerial.cpp
+++ b/Sming/SmingCore/HardwareSerial.cpp
@@ -290,5 +290,28 @@ HardwareSerial::operator bool() const
return uart != 0;
}
+size_t HardwareSerial::indexOf(char c)
+{
+ int offset = uart->rx_buffer->rpos;
+ int pos = 0;
+ while(pos < available()) {
+ if(uart->rx_buffer->buffer[offset + pos] == c) {
+ return pos;
+ }
+
+ pos++;
+
+ if(pos + offset == uart->rx_buffer->wpos) {
+ break;
+ }
+
+ if(pos + offset == uart->rx_buffer->size) {
+ offset = -pos;
+ }
+ }
+
+ return -1;
+}
+
HardwareSerial Serial(UART_ID_0);
diff --git a/Sming/SmingCore/HardwareSerial.h b/Sming/SmingCore/HardwareSerial.h
index a6c9f03c3e..bd7e36f9c9 100644
--- a/Sming/SmingCore/HardwareSerial.h
+++ b/Sming/SmingCore/HardwareSerial.h
@@ -252,6 +252,13 @@ class HardwareSerial : public Stream
*/
operator bool() const;
+ /*
+ * @brief Returns the location of the searched character
+ * @param char c - character to search for
+ * @retval size_t -1 if not found 0 or positive number otherwise
+ */
+ size_t indexOf(char c);
+
private:
int uartNr;
static HWSerialMemberData memberData[NUMBER_UARTS];
diff --git a/Sming/Wiring/Stream.h b/Sming/Wiring/Stream.h
index 807a0aadb5..e8ebc9510c 100644
--- a/Sming/Wiring/Stream.h
+++ b/Sming/Wiring/Stream.h
@@ -76,6 +76,15 @@ class Stream : public Print
// Wiring String functions to be added here
String readString();
String readStringUntil(char terminator);
+
+ /*
+ * @brief Returns the location of the searched character
+ * @param char c - character to search for
+ * @retval size_t -1 if not found 0 or positive number otherwise
+ */
+ virtual size_t indexOf(char c) {
+ return -1;
+ }
protected:
long parseInt(char skipChar); // as above but the given skipChar is ignored
diff --git a/samples/Basic_rBoot/app/application.cpp b/samples/Basic_rBoot/app/application.cpp
index 48c7567e97..421ecc1987 100644
--- a/samples/Basic_rBoot/app/application.cpp
+++ b/samples/Basic_rBoot/app/application.cpp
@@ -98,10 +98,10 @@ void ShowInfo() {
}
void serialCallBack(Stream& stream, char arrivedChar, unsigned short availableCharsCount) {
-
- if (arrivedChar == '\n') {
- char str[availableCharsCount];
- for (int i = 0; i < availableCharsCount; i++) {
+ int pos = stream.indexOf('\n');
+ if(pos > -1) {
+ char str[pos + 1];
+ for (int i = 0; i < pos + 1; i++) {
str[i] = stream.read();
if (str[i] == '\r' || str[i] == '\n') {
str[i] = '\0';
From f8f675415c36dd4d8da45cfc3669f50469c65d8d Mon Sep 17 00:00:00 2001
From: slaff
Date: Fri, 8 Dec 2017 15:17:34 +0100
Subject: [PATCH 48/50] Preparation for release 3.5.0. (#1295)
---
Readme.md | 33 ++++++++++++++++++++++++---------
Sming/SmingCore/SmingCore.h | 2 +-
2 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/Readme.md b/Readme.md
index 7780969bee..646403eecf 100644
--- a/Readme.md
+++ b/Readme.md
@@ -43,7 +43,7 @@ SDK = Software Development Kit
n/a = The selected SDK is not available on that OS
## Latest Stable Release
-- [Sming V3.4.0](https://github.com/SmingHub/Sming/releases/tag/3.4.0)
+- [Sming V3.5.0](https://github.com/SmingHub/Sming/releases/tag/3.5.0)
## Getting started
- [Windows](https://github.com/SmingHub/Sming/wiki/Windows-Quickstart)
@@ -59,17 +59,32 @@ n/a = The selected SDK is not available on that OS
There are multiple custom features that can be enabled by default. For example: SSL support, custom LWIP, open PWM, custom heap allocation, more verbose debugging, etc. Click here to see the details
-- Custom LWIP: (default: ON) By default we are using custom compiled LWIP stack instead of the binary one provided from Espressif. This is increasing the free memory and decreasing the space on the flash. All espconn_* functions are turned off by default. If your application requires the use of some of the espconn_* functions then add the ENABLE_ESPCONN=1 directive. See `Makefile-user.mk` from the [Basic_SmartConfig](https://github.com/SmingHub/Sming/blob/develop/samples/Basic_SmartConfig/Makefile-user.mk#L41) application for examples. If you would like to use the binary LWIP then you should turn off the custom LWIP compilation by providing `ENABLE_CUSTOM_LWIP=0`.
-- SSL: (default: OFF) The SSL support is not built-in by default to conserve resources. If you want to enable it then take a look at the [Readme](https://github.com/SmingHub/Sming/blob/develop/samples/Basic_Ssl/README.md) in the Basic_Ssl samples.
-- Custom PWM: (default: ON) If you don't want to use the [open PWM implementation](https://github.com/StefanBruens/ESP8266_new_pwm) then compile your application with `ENABLE_CUSTOM_PWM=0`. There is no need to recompile the Sming library.
+- **Custom LWIP**: (default: ON) By default we are using custom compiled LWIP stack instead of the binary one provided from Espressif. This is increasing the free memory and decreasing the space on the flash. All espconn_* functions are turned off by default. If your application requires the use of some of the espconn_* functions then add the ENABLE_ESPCONN=1 directive. See `Makefile-user.mk` from the [Basic_SmartConfig](https://github.com/SmingHub/Sming/blob/develop/samples/Basic_SmartConfig/Makefile-user.mk#L41) application for examples. If you would like to use the binary LWIP then you should turn off the custom LWIP compilation by providing `ENABLE_CUSTOM_LWIP=0`.
+- **LWIP 2**: (default: OFF) LWIP 2 stands for LightWeight IP stack, version 2. In order to enable that feature you should (re)compile the Sming library AND your application using the following directive ENABLE_CUSTOM_LWIP=2. LWIP v2 does not have support for espconn_* functions.
+This feature is still **experimental** which means that we still do not recommend it in production.
+- **SSL support**: (default: OFF) The SSL support is not built-in by default to conserve resources. If you want to enable it then take a look at the [Readme](https://github.com/SmingHub/Sming/blob/develop/samples/Basic_Ssl/README.md) in the Basic_Ssl samples.
+- **Custom PWM**: (default: ON) If you don't want to use the [open PWM implementation](https://github.com/StefanBruens/ESP8266_new_pwm) then compile your application with `ENABLE_CUSTOM_PWM=0`. There is no need to recompile the Sming library.
- WPS: (default: OFF) The WPS support (Wi-Fi Protected Setup) is not activated by default to preserve resources. To enable WPS, use the switch ENABLE_WPS=1 for compiling Sming.
-- Custom serial baud rate: (default: OFF) The default serial baud rate is 115200. If you want to change it to a higher baud rate you can recompile Sming and your application changing the `COM_SPEED_SERIAL` directive. For example `COM_SPEED_SERIAL=921600`.
-- Custom heap allocation: (default: OFF) If your application is experiencing heap fragmentation then you can try the [umm_malloc](https://github.com/rhempel/umm_malloc) heap allocation. To enable it compile Sming with `ENABLE_CUSTOM_HEAP=1`. In order to use it in your sample/application make sure to compile the sample with `ENABLE_CUSTOM_HEAP=1`. **Do not enable custom heap allocation and -mforce-l32 compiler flag together**.
-- Debug information log level and format: There are four debug levels: debug=3, info=2, warn=1, error=0. Using `DEBUG_VERBOSE_LEVEL` you can set the desired level (0-3). For example `DEBUG_VERBOSE_LEVEL=2` will show only info messages and above. Another make directive is `DEBUG_PRINT_FILENAME_AND_LINE=1` which enables printing the filename and line number of every debug line. This will require extra space on flash. Note: you can compile the Sming library with a set of debug directives and your project with another settings, this way you can control debugging separately for Sming and your application code.
-- Debug information for custom LWIP: If you use custom LWIP (see above) some debug information will be printed for critical errors and situations. You can enable debug information printing altogether using `ENABLE_LWIPDEBUG=1`. To increase debugging for certain areas you can modify debug options in `third-party/esp-open-lwip/include/lwipopts.h`.
-- Interactive debugging on the device: (default: OFF) In order to be able to debug live directly on the ESP8266 microcontroller you should re-compile your application and the Sming library with `ENABLE_GDB=1` directive. See [Basic_Debug](https://github.com/SmingHub/Sming/tree/develop/samples/Basic_Debug) sample for more details.
+- **Custom serial baud rate**: (default: OFF) The default serial baud rate is 115200. If you want to change it to a higher baud rate you can recompile Sming and your application changing the `COM_SPEED_SERIAL` directive. For example `COM_SPEED_SERIAL=921600`.
+- **Custom heap allocation**: (default: OFF) If your application is experiencing heap fragmentation then you can try the [umm_malloc](https://github.com/rhempel/umm_malloc) heap allocation. To enable it compile Sming with `ENABLE_CUSTOM_HEAP=1`. In order to use it in your sample/application make sure to compile the sample with `ENABLE_CUSTOM_HEAP=1`. **Do not enable custom heap allocation and -mforce-l32 compiler flag at the same time**.
+- **Debug information log level and format**: There are four debug levels: debug=3, info=2, warn=1, error=0. Using `DEBUG_VERBOSE_LEVEL` you can set the desired level (0-3). For example `DEBUG_VERBOSE_LEVEL=2` will show only info messages and above. Another make directive is `DEBUG_PRINT_FILENAME_AND_LINE=1` which enables printing the filename and line number of every debug line. This will require extra space on flash. Note: you can compile the Sming library with a set of debug directives and your project with another settings, this way you can control debugging separately for Sming and your application code.
+- **Debug information for custom LWIP**: If you use custom LWIP (see above) some debug information will be printed for critical errors and situations. You can enable debug information printing altogether using `ENABLE_LWIPDEBUG=1`. To increase debugging for certain areas you can modify debug options in `third-party/esp-open-lwip/include/lwipopts.h`.
+- **Interactive debugging on the device**: (default: OFF) In order to be able to debug live directly on the ESP8266 microcontroller you should re-compile your application and the Sming library with `ENABLE_GDB=1` directive. See [Basic_Debug](https://github.com/SmingHub/Sming/tree/develop/samples/Basic_Debug) sample for more details.
- CommandExecutor feature: (default: ON) This feature enables execution of certain commands by registering token handlers for text received via serial, websocket or telnet connection. If this feature is not used additional RAM/Flash can be obtained by setting `ENABLE_CMD_EXECUTOR=0`. This will save ~1KB RAM and ~3KB of flash memory.
+- **SDK 2.1.0+**: (default: OFF) In order to use SDK 2.1 you should set one environment variable before (re)compiling Sming AND applications based on it. The variable is SDK_BASE and it should point to `$SMING_HOME/third-party/ESP8266_NONOS_SDK`.
+For Windows you need to do:
+```
+set SDK_BASE %SMING_HOME%//third-party/ESP8266_NONOS_SDK
+```
+
+For Linux(bash) you need to do:
+```
+export SDK_BASE="$SMING_HOME/third-party/ESP8266_NONOS_SDK"
+```
+
+Read the comments from [this URL](https://github.com/SmingHub/Sming/pull/1264) for known issues.
+This feature is still **experimental** which means that we still do not recommend it in production.
## Compilation and flashing
diff --git a/Sming/SmingCore/SmingCore.h b/Sming/SmingCore/SmingCore.h
index ae33fe81c7..e8870d0398 100644
--- a/Sming/SmingCore/SmingCore.h
+++ b/Sming/SmingCore/SmingCore.h
@@ -8,7 +8,7 @@
#ifndef _NET_WIRING_
#define _NET_WIRING_
-#define SMING_VERSION "3.4.0" // Major Minor Sub
+#define SMING_VERSION "3.5.0" // Major Minor Sub
#include "../Wiring/WiringFrameworkIncludes.h"
From e5f933f78f5c46dbc2fced882d8163b0c45cea4d Mon Sep 17 00:00:00 2001
From: Slavey Karadzhov
Date: Fri, 8 Dec 2017 15:59:55 +0100
Subject: [PATCH 49/50] Added the latest changes to the third-party projects.
---
Sming/third-party/ESP8266_NONOS_SDK | 1 -
Sming/third-party/ESP8266_NONOS_SDK/License | 24 +
Sming/third-party/ESP8266_NONOS_SDK/Makefile | 396 +
Sming/third-party/ESP8266_NONOS_SDK/README.md | 3 +
Sming/third-party/ESP8266_NONOS_SDK/VERSION | 23 +
.../bin/at/1024+1024/user1.2048.new.5.bin | Bin 0 -> 427060 bytes
.../bin/at/1024+1024/user2.2048.new.5.bin | Bin 0 -> 427060 bytes
.../bin/at/512+512/user1.1024.new.2.bin | Bin 0 -> 427060 bytes
.../bin/at/512+512/user2.1024.new.2.bin | Bin 0 -> 427060 bytes
.../ESP8266_NONOS_SDK/bin/at/README.md | 81 +
.../at_sdio/1024+1024/user1.2048.new.5.bin | Bin 0 -> 428980 bytes
.../at_sdio/1024+1024/user2.2048.new.5.bin | Bin 0 -> 428980 bytes
.../bin/at_sdio/512+512/user1.1024.new.2.bin | Bin 0 -> 428980 bytes
.../bin/at_sdio/512+512/user2.1024.new.2.bin | Bin 0 -> 428980 bytes
.../ESP8266_NONOS_SDK/bin/at_sdio/README.md | 81 +
.../ESP8266_NONOS_SDK/bin/blank.bin | 1 +
.../ESP8266_NONOS_SDK/bin/boot_v1.2.bin | Bin 0 -> 1936 bytes
.../ESP8266_NONOS_SDK/bin/boot_v1.6.bin | Bin 0 -> 3856 bytes
.../ESP8266_NONOS_SDK/bin/boot_v1.7.bin | Bin 0 -> 4080 bytes
.../bin/esp_init_data_default.bin | Bin 0 -> 128 bytes
.../ESP8266_NONOS_SDK/documents/readme.txt | 2 +
.../ESP8266_NONOS_SDK/driver_lib/Makefile | 124 +
.../ESP8266_NONOS_SDK/driver_lib/README.md | 22 +
.../driver_lib/driver/Makefile | 44 +
.../driver_lib/driver/gpio16.c | 66 +
.../driver_lib/driver/hw_timer.c | 162 +
.../driver_lib/driver/i2c_master.c | 330 +
.../ESP8266_NONOS_SDK/driver_lib/driver/key.c | 177 +
.../driver_lib/driver/sdio_slv.c | 457 +
.../ESP8266_NONOS_SDK/driver_lib/driver/spi.c | 487 ++
.../driver_lib/driver/spi_interface.c | 502 ++
.../driver_lib/driver/spi_overlap.c | 422 +
.../driver_lib/driver/uart.c | 796 ++
.../driver_lib/include/driver/gpio16.h | 33 +
.../driver_lib/include/driver/i2c_master.h | 81 +
.../driver_lib/include/driver/key.h | 51 +
.../driver_lib/include/driver/sdio_slv.h | 40 +
.../driver_lib/include/driver/slc_register.h | 300 +
.../driver_lib/include/driver/spi.h | 74 +
.../driver_lib/include/driver/spi_interface.h | 353 +
.../driver_lib/include/driver/spi_overlap.h | 85 +
.../driver_lib/include/driver/spi_register.h | 222 +
.../driver_lib/include/driver/uart.h | 229 +
.../driver_lib/include/driver/uart_register.h | 159 +
.../ESP8266_NONOS_SDK/driver_lib/make_lib.sh | 14 +
.../examples/IoT_Demo/Makefile | 127 +
.../examples/IoT_Demo/driver/Makefile | 44 +
.../examples/IoT_Demo/driver/i2c_master.c | 330 +
.../examples/IoT_Demo/driver/key.c | 177 +
.../examples/IoT_Demo/gen_misc.bat | 147 +
.../examples/IoT_Demo/gen_misc.sh | 163 +
.../IoT_Demo/include/driver/i2c_master.h | 81 +
.../examples/IoT_Demo/include/driver/key.h | 51 +
.../examples/IoT_Demo/include/ssl/cert.h | 60 +
.../IoT_Demo/include/ssl/private_key.h | 54 +
.../examples/IoT_Demo/include/user_config.h | 88 +
.../IoT_Demo/include/user_devicefind.h | 30 +
.../IoT_Demo/include/user_esp_platform.h | 57 +
.../include/user_esp_platform_timer.h | 30 +
.../IoT_Demo/include/user_iot_version.h | 67 +
.../examples/IoT_Demo/include/user_json.h | 41 +
.../examples/IoT_Demo/include/user_light.h | 88 +
.../IoT_Demo/include/user_light_adj.h | 57 +
.../examples/IoT_Demo/include/user_plug.h | 67 +
.../examples/IoT_Demo/include/user_sensor.h | 56 +
.../IoT_Demo/include/user_webserver.h | 69 +
.../examples/IoT_Demo/user/Makefile | 45 +
.../examples/IoT_Demo/user/user_devicefind.c | 134 +
.../IoT_Demo/user/user_esp_platform.c | 1396 +++
.../IoT_Demo/user/user_esp_platform_timer.c | 358 +
.../examples/IoT_Demo/user/user_json.c | 177 +
.../examples/IoT_Demo/user/user_light.c | 155 +
.../examples/IoT_Demo/user/user_light_adj.c | 357 +
.../examples/IoT_Demo/user/user_main.c | 128 +
.../examples/IoT_Demo/user/user_plug.c | 173 +
.../examples/IoT_Demo/user/user_sensor.c | 244 +
.../examples/IoT_Demo/user/user_webserver.c | 1804 ++++
.../examples/at/!!!readme!!!.txt | 42 +
.../ESP8266_NONOS_SDK/examples/at/Makefile | 154 +
.../examples/at/gen_misc.bat | 147 +
.../ESP8266_NONOS_SDK/examples/at/gen_misc.sh | 165 +
.../examples/at/include/user_config.h | 36 +
.../examples/at/user/Makefile | 45 +
.../examples/at/user/at_upgrade.c | 304 +
.../examples/at/user/user_main.c | 187 +
.../examples/at_espconn/!!!readme!!!.txt | 42 +
.../examples/at_espconn/Makefile | 150 +
.../examples/at_espconn/gen_misc.bat | 147 +
.../examples/at_espconn/gen_misc.sh | 165 +
.../examples/at_espconn/include/user_config.h | 36 +
.../examples/at_espconn/user/Makefile | 45 +
.../examples/at_espconn/user/at_upgrade.c | 304 +
.../examples/at_espconn/user/user_main.c | 215 +
.../examples/at_sdio/Makefile | 157 +
.../examples/at_sdio/driver/Makefile | 44 +
.../examples/at_sdio/driver/sdio_slv.c | 493 ++
.../examples/at_sdio/gen_misc.bat | 27 +
.../examples/at_sdio/gen_misc.sh | 165 +
.../at_sdio/include/driver/sdio_slv.h | 43 +
.../at_sdio/include/driver/slc_register.h | 299 +
.../examples/at_sdio/include/user_config.h | 36 +
.../examples/at_sdio/include/version.h | 23 +
.../examples/at_sdio/user/Makefile | 45 +
.../examples/at_sdio/user/at_upgrade.c | 304 +
.../examples/at_sdio/user/user_main.c | 230 +
.../examples/esp_mqtt_proj/Makefile | 131 +
.../examples/esp_mqtt_proj/README.md | 77 +
.../examples/esp_mqtt_proj/gen_misc.bat | 147 +
.../examples/esp_mqtt_proj/gen_misc.sh | 165 +
.../esp_mqtt_proj/include/driver/uart.h | 125 +
.../include/driver/uart_register.h | 147 +
.../esp_mqtt_proj/include/modules/config.h | 61 +
.../esp_mqtt_proj/include/modules/wifi.h | 15 +
.../esp_mqtt_proj/include/mqtt/debug.h | 23 +
.../esp_mqtt_proj/include/mqtt/mqtt.h | 148 +
.../esp_mqtt_proj/include/mqtt/mqtt_msg.h | 130 +
.../esp_mqtt_proj/include/mqtt/proto.h | 32 +
.../esp_mqtt_proj/include/mqtt/queue.h | 44 +
.../esp_mqtt_proj/include/mqtt/ringbuf.h | 19 +
.../esp_mqtt_proj/include/mqtt/typedef.h | 17 +
.../esp_mqtt_proj/include/mqtt/utils.h | 9 +
.../esp_mqtt_proj/include/mqtt_config.h | 46 +
.../esp_mqtt_proj/include/user_config.h | 7 +
.../examples/esp_mqtt_proj/modules/Makefile | 44 +
.../examples/esp_mqtt_proj/modules/config.c | 110 +
.../examples/esp_mqtt_proj/modules/wifi.c | 100 +
.../examples/esp_mqtt_proj/mqtt/Makefile | 44 +
.../esp_mqtt_proj/mqtt/include/debug.h | 23 +
.../esp_mqtt_proj/mqtt/include/mqtt.h | 148 +
.../esp_mqtt_proj/mqtt/include/mqtt_msg.h | 130 +
.../esp_mqtt_proj/mqtt/include/proto.h | 32 +
.../esp_mqtt_proj/mqtt/include/queue.h | 44 +
.../esp_mqtt_proj/mqtt/include/ringbuf.h | 19 +
.../esp_mqtt_proj/mqtt/include/typedef.h | 17 +
.../esp_mqtt_proj/mqtt/include/utils.h | 9 +
.../examples/esp_mqtt_proj/mqtt/mqtt.c | 894 ++
.../examples/esp_mqtt_proj/mqtt/mqtt_msg.c | 473 +
.../examples/esp_mqtt_proj/mqtt/proto.c | 129 +
.../examples/esp_mqtt_proj/mqtt/queue.c | 57 +
.../examples/esp_mqtt_proj/mqtt/ringbuf.c | 67 +
.../examples/esp_mqtt_proj/mqtt/utils.c | 149 +
.../examples/esp_mqtt_proj/user/Makefile | 44 +
.../examples/esp_mqtt_proj/user/user_main.c | 192 +
.../examples/peripheral_test/Makefile | 121 +
.../examples/peripheral_test/gen_misc.bat | 147 +
.../examples/peripheral_test/gen_misc.sh | 165 +
.../peripheral_test/include/spi_test.h | 52 +
.../peripheral_test/include/user_config.h | 29 +
.../examples/peripheral_test/user/Makefile | 45 +
.../examples/peripheral_test/user/spi_test.c | 268 +
.../examples/peripheral_test/user/user_main.c | 94 +
.../ESP8266_NONOS_SDK/examples/readme.txt | 40 +
.../examples/simple_pair/Makefile | 121 +
.../examples/simple_pair/gen_misc.bat | 147 +
.../examples/simple_pair/gen_misc.sh | 165 +
.../simple_pair/include/user_config.h | 29 +
.../examples/simple_pair/user/Makefile | 45 +
.../examples/simple_pair/user/user_main.c | 345 +
.../examples/smart_config/!!!readme!!!.txt | 8 +
.../examples/smart_config/Makefile | 125 +
.../examples/smart_config/gen_misc.bat | 147 +
.../examples/smart_config/gen_misc.sh | 165 +
.../smart_config/include/user_config.h | 29 +
.../smart_config/model two-dimension code.rar | Bin 0 -> 15386 bytes
.../examples/smart_config/user/Makefile | 45 +
.../examples/smart_config/user/user_main.c | 260 +
.../examples/wpa2_enterprise/Makefile | 122 +
.../examples/wpa2_enterprise/gen_misc.bat | 147 +
.../examples/wpa2_enterprise/gen_misc.sh | 165 +
.../wpa2_enterprise/include/user_config.h | 29 +
.../wpa2_enterprise/include/wpa2_pki/ca.h | 89 +
.../include/wpa2_pki/certs/ca.der | Bin 0 -> 992 bytes
.../include/wpa2_pki/certs/ca.key | 16 +
.../include/wpa2_pki/certs/ca.pem | 23 +
.../include/wpa2_pki/certs/client.crt | 70 +
.../include/wpa2_pki/certs/client.key | 27 +
.../include/wpa2_pki/certs/client.p12 | Bin 0 -> 2453 bytes
.../include/wpa2_pki/certs/client.pem | 57 +
.../wpa2_enterprise/include/wpa2_pki/certs/dh | 5 +
.../include/wpa2_pki/certs/server.crt | 70 +
.../include/wpa2_pki/certs/server.key | 27 +
.../include/wpa2_pki/certs/server.p12 | Bin 0 -> 2461 bytes
.../include/wpa2_pki/certs/server.pem | 57 +
.../include/wpa2_pki/client_crt.h | 237 +
.../include/wpa2_pki/client_key.h | 106 +
.../include/wpa2_pki/import_ca_crt_key.sh | 23 +
.../wpa2_enterprise/include/wpa2_pki/str2hex | Bin 0 -> 8778 bytes
.../examples/wpa2_enterprise/user/Makefile | 45 +
.../examples/wpa2_enterprise/user/user_main.c | 145 +
.../ESP8266_NONOS_SDK/examples/wps/Makefile | 123 +
.../examples/wps/driver/Makefile | 44 +
.../examples/wps/driver/key.c | 177 +
.../examples/wps/gen_misc.bat | 147 +
.../examples/wps/gen_misc.sh | 165 +
.../examples/wps/include/driver/key.h | 51 +
.../examples/wps/include/user_config.h | 29 +
.../examples/wps/user/Makefile | 45 +
.../examples/wps/user/user_main.c | 131 +
.../ESP8266_NONOS_SDK/include/airkiss.h | 122 +
.../ESP8266_NONOS_SDK/include/at_custom.h | 172 +
.../ESP8266_NONOS_SDK/include/c_types.h | 114 +
.../ESP8266_NONOS_SDK/include/eagle_soc.h | 279 +
.../ESP8266_NONOS_SDK/include/espconn.h | 747 ++
.../ESP8266_NONOS_SDK/include/espnow.h | 73 +
.../ESP8266_NONOS_SDK/include/ets_sys.h | 130 +
.../ESP8266_NONOS_SDK/include/gpio.h | 119 +
.../ESP8266_NONOS_SDK/include/ip_addr.h | 87 +
.../ESP8266_NONOS_SDK/include/json/json.h | 70 +
.../include/json/jsonparse.h | 94 +
.../ESP8266_NONOS_SDK/include/json/jsontree.h | 145 +
.../ESP8266_NONOS_SDK/include/mem.h | 88 +
.../ESP8266_NONOS_SDK/include/mesh.h | 341 +
.../ESP8266_NONOS_SDK/include/os_type.h | 37 +
.../ESP8266_NONOS_SDK/include/osapi.h | 94 +
.../ESP8266_NONOS_SDK/include/ping.h | 56 +
.../ESP8266_NONOS_SDK/include/pwm.h | 58 +
.../ESP8266_NONOS_SDK/include/queue.h | 236 +
.../ESP8266_NONOS_SDK/include/simple_pair.h | 64 +
.../ESP8266_NONOS_SDK/include/smartconfig.h | 50 +
.../ESP8266_NONOS_SDK/include/sntp.h | 68 +
.../ESP8266_NONOS_SDK/include/spi_flash.h | 61 +
.../ESP8266_NONOS_SDK/include/upgrade.h | 74 +
.../include/user_interface.h | 654 ++
.../include/wpa2_enterprise.h | 65 +
.../ESP8266_NONOS_SDK/ld/eagle.app.v6.ld | 230 +
.../ld/eagle.app.v6.new.1024.app1.ld | 230 +
.../ld/eagle.app.v6.new.1024.app2.ld | 230 +
.../ld/eagle.app.v6.new.2048.ld | 231 +
.../ld/eagle.app.v6.new.512.app1.ld | 230 +
.../ld/eagle.app.v6.new.512.app2.ld | 230 +
.../ld/eagle.app.v6.old.1024.app1.ld | 230 +
.../ld/eagle.app.v6.old.1024.app2.ld | 230 +
.../ld/eagle.app.v6.old.512.app1.ld | 230 +
.../ld/eagle.app.v6.old.512.app2.ld | 230 +
.../ESP8266_NONOS_SDK/ld/eagle.rom.addr.v6.ld | 350 +
.../ESP8266_NONOS_SDK/lib/libairkiss.a | Bin 0 -> 11298 bytes
.../third-party/ESP8266_NONOS_SDK/lib/libat.a | Bin 0 -> 394948 bytes
.../third-party/ESP8266_NONOS_SDK/lib/libc.a | Bin 0 -> 5001068 bytes
.../ESP8266_NONOS_SDK/lib/libcrypto.a | Bin 0 -> 135458 bytes
.../ESP8266_NONOS_SDK/lib/libdriver.a | Bin 0 -> 67252 bytes
.../ESP8266_NONOS_SDK/lib/libespnow.a | Bin 0 -> 72138 bytes
.../ESP8266_NONOS_SDK/lib/libgcc.a | Bin 0 -> 603000 bytes
.../ESP8266_NONOS_SDK/lib/libjson.a | Bin 0 -> 18334 bytes
.../ESP8266_NONOS_SDK/lib/liblwip.a | Bin 0 -> 321736 bytes
.../ESP8266_NONOS_SDK/lib/liblwip_536.a | Bin 0 -> 354288 bytes
.../ESP8266_NONOS_SDK/lib/libmain.a | Bin 0 -> 228174 bytes
.../ESP8266_NONOS_SDK/lib/libmbedtls.a | Bin 0 -> 666800 bytes
.../ESP8266_NONOS_SDK/lib/libmesh.a | Bin 0 -> 198260 bytes
.../ESP8266_NONOS_SDK/lib/libnet80211.a | Bin 0 -> 330530 bytes
.../ESP8266_NONOS_SDK/lib/libphy.a | Bin 0 -> 156962 bytes
.../third-party/ESP8266_NONOS_SDK/lib/libpp.a | Bin 0 -> 237994 bytes
.../ESP8266_NONOS_SDK/lib/libpwm.a | Bin 0 -> 28298 bytes
.../ESP8266_NONOS_SDK/lib/libsmartconfig.a | Bin 0 -> 118416 bytes
.../ESP8266_NONOS_SDK/lib/libssl.a | Bin 0 -> 275704 bytes
.../ESP8266_NONOS_SDK/lib/libupgrade.a | Bin 0 -> 41158 bytes
.../ESP8266_NONOS_SDK/lib/libwpa.a | Bin 0 -> 170764 bytes
.../ESP8266_NONOS_SDK/lib/libwpa2.a | Bin 0 -> 475218 bytes
.../ESP8266_NONOS_SDK/lib/libwps.a | Bin 0 -> 322676 bytes
.../ESP8266_NONOS_SDK/lib/readme.md | 59 +
.../lib/strip_libc_funcs.txt | 15 +
.../lib/strip_libgcc_funcs.txt | 25 +
.../ESP8266_NONOS_SDK/third_party/Makefile | 127 +
.../third_party/include/arch/cc.h | 117 +
.../third_party/include/arch/perf.h | 40 +
.../third_party/include/arch/sys_arch.h | 0
.../third_party/include/lwip/api.h | 284 +
.../third_party/include/lwip/api_msg.h | 174 +
.../third_party/include/lwip/app/dhcpserver.h | 115 +
.../third_party/include/lwip/app/espconn.h | 687 ++
.../include/lwip/app/espconn_buf.h | 60 +
.../include/lwip/app/espconn_tcp.h | 58 +
.../include/lwip/app/espconn_udp.h | 64 +
.../third_party/include/lwip/app/ping.h | 85 +
.../third_party/include/lwip/app/time.h | 49 +
.../third_party/include/lwip/arch.h | 238 +
.../third_party/include/lwip/autoip.h | 119 +
.../third_party/include/lwip/debug.h | 98 +
.../third_party/include/lwip/def.h | 127 +
.../third_party/include/lwip/dhcp.h | 252 +
.../third_party/include/lwip/dns.h | 124 +
.../third_party/include/lwip/err.h | 86 +
.../third_party/include/lwip/icmp.h | 115 +
.../third_party/include/lwip/igmp.h | 106 +
.../third_party/include/lwip/inet.h | 107 +
.../third_party/include/lwip/inet_chksum.h | 90 +
.../third_party/include/lwip/init.h | 73 +
.../third_party/include/lwip/ip.h | 215 +
.../third_party/include/lwip/ip_addr.h | 256 +
.../third_party/include/lwip/ip_frag.h | 88 +
.../third_party/include/lwip/mdns.h | 114 +
.../third_party/include/lwip/mem.h | 166 +
.../third_party/include/lwip/memp.h | 116 +
.../third_party/include/lwip/memp_std.h | 126 +
.../third_party/include/lwip/netbuf.h | 101 +
.../third_party/include/lwip/netdb.h | 124 +
.../third_party/include/lwip/netif.h | 320 +
.../third_party/include/lwip/netifapi.h | 108 +
.../third_party/include/lwip/opt.h | 2043 +++++
.../third_party/include/lwip/pbuf.h | 160 +
.../third_party/include/lwip/puck_def.h | 44 +
.../third_party/include/lwip/raw.h | 98 +
.../third_party/include/lwip/sio.h | 141 +
.../third_party/include/lwip/snmp.h | 367 +
.../third_party/include/lwip/snmp_asn1.h | 101 +
.../third_party/include/lwip/snmp_msg.h | 315 +
.../third_party/include/lwip/snmp_structs.h | 268 +
.../third_party/include/lwip/sntp.h | 60 +
.../third_party/include/lwip/sockets.h | 376 +
.../third_party/include/lwip/stats.h | 292 +
.../third_party/include/lwip/sys.h | 337 +
.../third_party/include/lwip/tcp.h | 377 +
.../third_party/include/lwip/tcp_impl.h | 472 +
.../third_party/include/lwip/tcpip.h | 159 +
.../third_party/include/lwip/timers.h | 98 +
.../third_party/include/lwip/udp.h | 171 +
.../third_party/include/lwipopts.h | 2068 +++++
.../third_party/include/mbedtls/aes.h | 297 +
.../third_party/include/mbedtls/aesni.h | 111 +
.../third_party/include/mbedtls/arc4.h | 113 +
.../third_party/include/mbedtls/asn1.h | 342 +
.../third_party/include/mbedtls/asn1write.h | 239 +
.../third_party/include/mbedtls/base64.h | 88 +
.../third_party/include/mbedtls/bignum.h | 717 ++
.../third_party/include/mbedtls/blowfish.h | 203 +
.../third_party/include/mbedtls/bn_mul.h | 876 ++
.../third_party/include/mbedtls/camellia.h | 235 +
.../third_party/include/mbedtls/ccm.h | 141 +
.../third_party/include/mbedtls/certs.h | 103 +
.../include/mbedtls/check_config.h | 540 ++
.../third_party/include/mbedtls/cipher.h | 698 ++
.../include/mbedtls/cipher_internal.h | 109 +
.../third_party/include/mbedtls/compat-1.3.h | 2634 ++++++
.../third_party/include/mbedtls/config.h | 2511 ++++++
.../third_party/include/mbedtls/config_esp.h | 2524 ++++++
.../third_party/include/mbedtls/ctr_drbg.h | 290 +
.../third_party/include/mbedtls/debug.h | 125 +
.../third_party/include/mbedtls/des.h | 306 +
.../third_party/include/mbedtls/dhm.h | 305 +
.../third_party/include/mbedtls/ecdh.h | 214 +
.../third_party/include/mbedtls/ecdsa.h | 248 +
.../third_party/include/mbedtls/ecjpake.h | 238 +
.../third_party/include/mbedtls/ecp.h | 669 ++
.../third_party/include/mbedtls/entropy.h | 252 +
.../include/mbedtls/entropy_poll.h | 89 +
.../third_party/include/mbedtls/error.h | 107 +
.../third_party/include/mbedtls/gcm.h | 220 +
.../third_party/include/mbedtls/havege.h | 74 +
.../third_party/include/mbedtls/hmac_drbg.h | 299 +
.../include/mbedtls/mbedtls_debug.h | 13 +
.../third_party/include/mbedtls/md.h | 353 +
.../third_party/include/mbedtls/md2.h | 136 +
.../third_party/include/mbedtls/md4.h | 136 +
.../third_party/include/mbedtls/md5.h | 136 +
.../third_party/include/mbedtls/md_internal.h | 114 +
.../include/mbedtls/memory_buffer_alloc.h | 146 +
.../third_party/include/mbedtls/net.h | 225 +
.../third_party/include/mbedtls/oid.h | 570 ++
.../third_party/include/mbedtls/padlock.h | 107 +
.../third_party/include/mbedtls/pem.h | 129 +
.../third_party/include/mbedtls/pk.h | 615 ++
.../third_party/include/mbedtls/pk_internal.h | 114 +
.../third_party/include/mbedtls/pkcs11.h | 173 +
.../third_party/include/mbedtls/pkcs12.h | 119 +
.../third_party/include/mbedtls/pkcs5.h | 94 +
.../third_party/include/mbedtls/platform.h | 217 +
.../third_party/include/mbedtls/ripemd160.h | 138 +
.../third_party/include/mbedtls/rsa.h | 652 ++
.../third_party/include/mbedtls/sha1.h | 136 +
.../third_party/include/mbedtls/sha256.h | 141 +
.../third_party/include/mbedtls/sha512.h | 141 +
.../third_party/include/mbedtls/ssl.h | 2393 ++++++
.../third_party/include/mbedtls/ssl_cache.h | 143 +
.../include/mbedtls/ssl_ciphersuites.h | 321 +
.../third_party/include/mbedtls/ssl_cookie.h | 108 +
.../include/mbedtls/ssl_internal.h | 495 ++
.../third_party/include/mbedtls/ssl_ticket.h | 135 +
.../include/mbedtls/sys/espconn_mbedtls.h | 278 +
.../third_party/include/mbedtls/sys/socket.h | 343 +
.../third_party/include/mbedtls/threading.h | 104 +
.../third_party/include/mbedtls/timing.h | 141 +
.../third_party/include/mbedtls/version.h | 111 +
.../third_party/include/mbedtls/x509.h | 331 +
.../third_party/include/mbedtls/x509_crl.h | 173 +
.../third_party/include/mbedtls/x509_crt.h | 645 ++
.../third_party/include/mbedtls/x509_csr.h | 292 +
.../third_party/include/mbedtls/xtea.h | 139 +
.../third_party/include/netif/etharp.h | 254 +
.../third_party/include/netif/if_llc.h | 173 +
.../third_party/include/netif/ppp_oe.h | 190 +
.../third_party/include/netif/wlan_lwip_if.h | 25 +
.../include/ssl/app/espconn_secure.h | 46 +
.../third_party/include/ssl/app/espconn_ssl.h | 156 +
.../third_party/include/ssl/ssl_bigint.h | 99 +
.../third_party/include/ssl/ssl_bigint_impl.h | 131 +
.../third_party/include/ssl/ssl_cert.h | 43 +
.../third_party/include/ssl/ssl_config.h | 130 +
.../third_party/include/ssl/ssl_crypto.h | 266 +
.../third_party/include/ssl/ssl_crypto_misc.h | 177 +
.../third_party/include/ssl/ssl_os_int.h | 67 +
.../third_party/include/ssl/ssl_os_port.h | 106 +
.../third_party/include/ssl/ssl_private_key.h | 54 +
.../third_party/include/ssl/ssl_ssl.h | 503 ++
.../third_party/include/ssl/ssl_tls1.h | 303 +
.../third_party/include/ssl/ssl_version.h | 1 +
.../third_party/include/user_config.h | 0
.../third_party/lwip/Makefile | 51 +
.../third_party/lwip/api/Makefile | 46 +
.../third_party/lwip/api/api_lib.c | 740 ++
.../third_party/lwip/api/api_msg.c | 1540 ++++
.../third_party/lwip/api/err.c | 75 +
.../third_party/lwip/api/netbuf.c | 245 +
.../third_party/lwip/api/netdb.c | 352 +
.../third_party/lwip/api/netifapi.c | 160 +
.../third_party/lwip/api/sockets.c | 2343 +++++
.../third_party/lwip/api/tcpip.c | 460 +
.../third_party/lwip/app/Makefile | 46 +
.../third_party/lwip/app/dhcpserver.c | 1179 +++
.../third_party/lwip/app/espconn.c | 1366 +++
.../third_party/lwip/app/espconn_buf.c | 222 +
.../third_party/lwip/app/espconn_mdns.c | 134 +
.../third_party/lwip/app/espconn_tcp.c | 1553 ++++
.../third_party/lwip/app/espconn_udp.c | 425 +
.../third_party/lwip/app/netio.c | 369 +
.../third_party/lwip/app/ping.c | 329 +
.../third_party/lwip/core/Makefile | 46 +
.../third_party/lwip/core/def.c | 108 +
.../third_party/lwip/core/dhcp.c | 1818 ++++
.../third_party/lwip/core/dns.c | 988 +++
.../third_party/lwip/core/init.c | 325 +
.../third_party/lwip/core/ipv4/Makefile | 46 +
.../third_party/lwip/core/ipv4/autoip.c | 536 ++
.../third_party/lwip/core/ipv4/icmp.c | 354 +
.../third_party/lwip/core/ipv4/igmp.c | 845 ++
.../third_party/lwip/core/ipv4/inet.c | 42 +
.../third_party/lwip/core/ipv4/inet_chksum.c | 450 +
.../third_party/lwip/core/ipv4/ip.c | 920 ++
.../third_party/lwip/core/ipv4/ip_addr.c | 329 +
.../third_party/lwip/core/ipv4/ip_frag.c | 863 ++
.../third_party/lwip/core/mdns.c | 1136 +++
.../third_party/lwip/core/mem.c | 644 ++
.../third_party/lwip/core/memp.c | 490 ++
.../third_party/lwip/core/netif.c | 762 ++
.../third_party/lwip/core/pbuf.c | 1257 +++
.../third_party/lwip/core/raw.c | 358 +
.../third_party/lwip/core/sntp.c | 1165 +++
.../third_party/lwip/core/stats.c | 176 +
.../third_party/lwip/core/sys.c | 66 +
.../third_party/lwip/core/sys_arch.c | 13 +
.../third_party/lwip/core/tcp.c | 1671 ++++
.../third_party/lwip/core/tcp_in.c | 1637 ++++
.../third_party/lwip/core/tcp_out.c | 1531 ++++
.../third_party/lwip/core/timers.c | 513 ++
.../third_party/lwip/core/udp.c | 977 +++
.../third_party/lwip/netif/Makefile | 46 +
.../third_party/lwip/netif/etharp.c | 1413 +++
.../ESP8266_NONOS_SDK/third_party/make_lib.sh | 26 +
.../third_party/mbedtls/Makefile | 49 +
.../third_party/mbedtls/app/Makefile | 46 +
.../third_party/mbedtls/app/espconn_mbedtls.c | 1270 +++
.../third_party/mbedtls/app/espconn_secure.c | 397 +
.../third_party/mbedtls/app/lwIPFile.c | 123 +
.../third_party/mbedtls/app/lwIPSocket.c | 1011 +++
.../third_party/mbedtls/library/Makefile | 46 +
.../third_party/mbedtls/library/aes.c | 1491 ++++
.../third_party/mbedtls/library/aesni.c | 464 +
.../third_party/mbedtls/library/arc4.c | 205 +
.../third_party/mbedtls/library/asn1parse.c | 392 +
.../third_party/mbedtls/library/asn1write.c | 361 +
.../third_party/mbedtls/library/base64.c | 289 +
.../third_party/mbedtls/library/bignum.c | 2433 ++++++
.../third_party/mbedtls/library/blowfish.c | 656 ++
.../third_party/mbedtls/library/camellia.c | 1072 +++
.../third_party/mbedtls/library/ccm.c | 464 +
.../third_party/mbedtls/library/certs.c | 357 +
.../third_party/mbedtls/library/cipher.c | 886 ++
.../third_party/mbedtls/library/cipher_wrap.c | 1451 ++++
.../third_party/mbedtls/library/ctr_drbg.c | 593 ++
.../third_party/mbedtls/library/debug.c | 367 +
.../third_party/mbedtls/library/des.c | 1061 +++
.../third_party/mbedtls/library/dhm.c | 624 ++
.../third_party/mbedtls/library/ecdh.c | 264 +
.../third_party/mbedtls/library/ecdsa.c | 448 +
.../third_party/mbedtls/library/ecjpake.c | 1103 +++
.../third_party/mbedtls/library/ecp.c | 2090 +++++
.../third_party/mbedtls/library/ecp_curves.c | 1325 +++
.../third_party/mbedtls/library/entropy.c | 493 ++
.../mbedtls/library/entropy_poll.c | 216 +
.../third_party/mbedtls/library/error.c | 700 ++
.../third_party/mbedtls/library/gcm.c | 953 ++
.../third_party/mbedtls/library/havege.c | 243 +
.../third_party/mbedtls/library/hmac_drbg.c | 529 ++
.../third_party/mbedtls/library/md.c | 471 +
.../third_party/mbedtls/library/md2.c | 288 +
.../third_party/mbedtls/library/md4.c | 384 +
.../third_party/mbedtls/library/md5.c | 407 +
.../third_party/mbedtls/library/md_wrap.c | 575 ++
.../mbedtls/library/memory_buffer_alloc.c | 750 ++
.../third_party/mbedtls/library/net.c | 575 ++
.../third_party/mbedtls/library/oid.c | 650 ++
.../third_party/mbedtls/library/padlock.c | 170 +
.../third_party/mbedtls/library/pem.c | 447 +
.../third_party/mbedtls/library/pk.c | 374 +
.../third_party/mbedtls/library/pk_wrap.c | 495 ++
.../third_party/mbedtls/library/pkcs11.c | 240 +
.../third_party/mbedtls/library/pkcs12.c | 365 +
.../third_party/mbedtls/library/pkcs5.c | 405 +
.../third_party/mbedtls/library/pkparse.c | 1293 +++
.../third_party/mbedtls/library/pkwrite.c | 439 +
.../third_party/mbedtls/library/platform.c | 193 +
.../third_party/mbedtls/library/ripemd160.c | 464 +
.../third_party/mbedtls/library/rsa.c | 1705 ++++
.../third_party/mbedtls/library/sha1.c | 451 +
.../third_party/mbedtls/library/sha256.c | 449 +
.../third_party/mbedtls/library/sha512.c | 505 ++
.../third_party/mbedtls/library/ssl_cache.c | 326 +
.../mbedtls/library/ssl_ciphersuites.c | 1853 ++++
.../third_party/mbedtls/library/ssl_cli.c | 3393 ++++++++
.../third_party/mbedtls/library/ssl_cookie.c | 260 +
.../third_party/mbedtls/library/ssl_srv.c | 3884 +++++++++
.../third_party/mbedtls/library/ssl_ticket.c | 489 ++
.../third_party/mbedtls/library/ssl_tls.c | 7625 +++++++++++++++++
.../third_party/mbedtls/library/threading.c | 136 +
.../third_party/mbedtls/library/timing.c | 520 ++
.../third_party/mbedtls/library/version.c | 50 +
.../mbedtls/library/version_features.c | 635 ++
.../third_party/mbedtls/library/x509.c | 1024 +++
.../third_party/mbedtls/library/x509_create.c | 340 +
.../third_party/mbedtls/library/x509_crl.c | 721 ++
.../third_party/mbedtls/library/x509_crt.c | 2412 ++++++
.../third_party/mbedtls/library/x509_csr.c | 417 +
.../mbedtls/library/x509write_crt.c | 456 +
.../mbedtls/library/x509write_csr.c | 256 +
.../third_party/mbedtls/library/xtea.c | 281 +
.../third_party/mbedtls/platform/Makefile | 46 +
.../mbedtls/platform/esp_hardware.c | 51 +
.../third_party/mbedtls/platform/net.c | 440 +
.../ESP8266_NONOS_SDK/tools/README.md | 84 +
.../ESP8266_NONOS_SDK/tools/gen_appbin.py | 286 +
.../ESP8266_NONOS_SDK/tools/make_cacert.py | 64 +
.../ESP8266_NONOS_SDK/tools/make_cert.py | 76 +
.../ESP8266_NONOS_SDK/tools/makefile.sh | 198 +
.../ESP8266_NONOS_SDK/tools/rmfile.sh | 16 +
Sming/third-party/esp-gdbstub/gdbstub.c | 2 +-
.../esp-open-lwip/include/arch/cc.h | 5 +-
.../esp-open-lwip/include/user_config.h | 3 +-
Sming/third-party/lwip2 | 1 -
Sming/third-party/lwip2/Makefile.arduino | 8 +
Sming/third-party/lwip2/Makefile.open | 18 +
Sming/third-party/lwip2/Makefile.sming | 19 +
Sming/third-party/lwip2/README.md | 87 +
Sming/third-party/lwip2/build/api/api_lib.d | 12 +
Sming/third-party/lwip2/build/api/api_lib.o | Bin 0 -> 2052 bytes
Sming/third-party/lwip2/build/api/api_msg.d | 12 +
Sming/third-party/lwip2/build/api/api_msg.o | Bin 0 -> 2052 bytes
Sming/third-party/lwip2/build/api/err.d | 13 +
Sming/third-party/lwip2/build/api/err.o | Bin 0 -> 2044 bytes
Sming/third-party/lwip2/build/api/netbuf.d | 12 +
Sming/third-party/lwip2/build/api/netbuf.o | Bin 0 -> 2052 bytes
Sming/third-party/lwip2/build/api/netdb.d | 12 +
Sming/third-party/lwip2/build/api/netdb.o | Bin 0 -> 2048 bytes
Sming/third-party/lwip2/build/api/netifapi.d | 12 +
Sming/third-party/lwip2/build/api/netifapi.o | Bin 0 -> 2052 bytes
Sming/third-party/lwip2/build/api/sockets.d | 12 +
Sming/third-party/lwip2/build/api/sockets.o | Bin 0 -> 2052 bytes
Sming/third-party/lwip2/build/api/tcpip.d | 12 +
Sming/third-party/lwip2/build/api/tcpip.o | Bin 0 -> 2048 bytes
.../third-party/lwip2/build/apps/sntp/sntp.d | 21 +
.../third-party/lwip2/build/apps/sntp/sntp.o | Bin 0 -> 32304 bytes
Sming/third-party/lwip2/build/core/def.d | 13 +
Sming/third-party/lwip2/build/core/def.o | Bin 0 -> 14992 bytes
Sming/third-party/lwip2/build/core/dns.d | 20 +
Sming/third-party/lwip2/build/core/dns.o | Bin 0 -> 47676 bytes
.../lwip2/build/core/inet_chksum.d | 15 +
.../lwip2/build/core/inet_chksum.o | Bin 0 -> 21132 bytes
Sming/third-party/lwip2/build/core/init.d | 27 +
Sming/third-party/lwip2/build/core/init.o | Bin 0 -> 4628 bytes
Sming/third-party/lwip2/build/core/ip.d | 19 +
Sming/third-party/lwip2/build/core/ip.o | Bin 0 -> 5344 bytes
.../lwip2/build/core/ipv4/autoip.d | 12 +
.../lwip2/build/core/ipv4/autoip.o | Bin 0 -> 2056 bytes
.../third-party/lwip2/build/core/ipv4/dhcp.d | 22 +
.../third-party/lwip2/build/core/ipv4/dhcp.o | Bin 0 -> 86196 bytes
.../lwip2/build/core/ipv4/etharp.d | 22 +
.../lwip2/build/core/ipv4/etharp.o | Bin 0 -> 46748 bytes
.../third-party/lwip2/build/core/ipv4/icmp.d | 20 +
.../third-party/lwip2/build/core/ipv4/icmp.o | Bin 0 -> 16476 bytes
.../third-party/lwip2/build/core/ipv4/igmp.d | 20 +
.../third-party/lwip2/build/core/ipv4/igmp.o | Bin 0 -> 36996 bytes
Sming/third-party/lwip2/build/core/ipv4/ip4.d | 23 +
Sming/third-party/lwip2/build/core/ipv4/ip4.o | Bin 0 -> 33820 bytes
.../lwip2/build/core/ipv4/ip4_addr.d | 17 +
.../lwip2/build/core/ipv4/ip4_addr.o | Bin 0 -> 19832 bytes
.../lwip2/build/core/ipv4/ip4_frag.d | 20 +
.../lwip2/build/core/ipv4/ip4_frag.o | Bin 0 -> 2060 bytes
.../third-party/lwip2/build/core/ipv6/dhcp6.d | 12 +
.../third-party/lwip2/build/core/ipv6/dhcp6.o | Bin 0 -> 2056 bytes
.../lwip2/build/core/ipv6/ethip6.d | 12 +
.../lwip2/build/core/ipv6/ethip6.o | Bin 0 -> 2056 bytes
.../third-party/lwip2/build/core/ipv6/icmp6.d | 12 +
.../third-party/lwip2/build/core/ipv6/icmp6.o | Bin 0 -> 2056 bytes
.../third-party/lwip2/build/core/ipv6/inet6.d | 12 +
.../third-party/lwip2/build/core/ipv6/inet6.o | Bin 0 -> 2056 bytes
Sming/third-party/lwip2/build/core/ipv6/ip6.d | 12 +
Sming/third-party/lwip2/build/core/ipv6/ip6.o | Bin 0 -> 2048 bytes
.../lwip2/build/core/ipv6/ip6_addr.d | 12 +
.../lwip2/build/core/ipv6/ip6_addr.o | Bin 0 -> 2060 bytes
.../lwip2/build/core/ipv6/ip6_frag.d | 20 +
.../lwip2/build/core/ipv6/ip6_frag.o | Bin 0 -> 2060 bytes
.../third-party/lwip2/build/core/ipv6/mld6.d | 12 +
.../third-party/lwip2/build/core/ipv6/mld6.o | Bin 0 -> 2052 bytes
Sming/third-party/lwip2/build/core/ipv6/nd6.d | 12 +
Sming/third-party/lwip2/build/core/ipv6/nd6.o | Bin 0 -> 2048 bytes
Sming/third-party/lwip2/build/core/mem.d | 15 +
Sming/third-party/lwip2/build/core/mem.o | Bin 0 -> 7152 bytes
Sming/third-party/lwip2/build/core/memp.d | 29 +
Sming/third-party/lwip2/build/core/memp.o | Bin 0 -> 14452 bytes
Sming/third-party/lwip2/build/core/netif.d | 24 +
Sming/third-party/lwip2/build/core/netif.o | Bin 0 -> 30220 bytes
Sming/third-party/lwip2/build/core/pbuf.d | 16 +
Sming/third-party/lwip2/build/core/pbuf.o | Bin 0 -> 55172 bytes
Sming/third-party/lwip2/build/core/raw.d | 19 +
Sming/third-party/lwip2/build/core/raw.o | Bin 0 -> 24776 bytes
Sming/third-party/lwip2/build/core/stats.d | 12 +
Sming/third-party/lwip2/build/core/stats.o | Bin 0 -> 2052 bytes
Sming/third-party/lwip2/build/core/sys.d | 13 +
Sming/third-party/lwip2/build/core/sys.o | Bin 0 -> 2044 bytes
Sming/third-party/lwip2/build/core/tcp.d | 21 +
Sming/third-party/lwip2/build/core/tcp.o | Bin 0 -> 98600 bytes
Sming/third-party/lwip2/build/core/tcp_in.d | 21 +
Sming/third-party/lwip2/build/core/tcp_in.o | Bin 0 -> 57356 bytes
Sming/third-party/lwip2/build/core/tcp_out.d | 21 +
Sming/third-party/lwip2/build/core/tcp_out.o | Bin 0 -> 62700 bytes
Sming/third-party/lwip2/build/core/timeouts.d | 27 +
Sming/third-party/lwip2/build/core/timeouts.o | Bin 0 -> 24108 bytes
Sming/third-party/lwip2/build/core/udp.d | 22 +
Sming/third-party/lwip2/build/core/udp.o | Bin 0 -> 42672 bytes
.../lwip2/build/glue-esp/lwip-esp.d | 23 +
.../lwip2/build/glue-esp/lwip-esp.o | Bin 0 -> 54820 bytes
.../lwip2/build/glue-lwip/esp-dhcpserver.d | 33 +
.../lwip2/build/glue-lwip/esp-dhcpserver.o | Bin 0 -> 66792 bytes
.../lwip2/build/glue-lwip/esp-sntp.d | 19 +
.../lwip2/build/glue-lwip/esp-sntp.o | Bin 0 -> 33548 bytes
.../lwip2/build/glue-lwip/esp-time.d | 16 +
.../lwip2/build/glue-lwip/esp-time.o | Bin 0 -> 5916 bytes
.../lwip2/build/glue-lwip/lwip-git.d | 39 +
.../lwip2/build/glue-lwip/lwip-git.o | Bin 0 -> 39592 bytes
Sming/third-party/lwip2/build/glue/doprint.d | 10 +
Sming/third-party/lwip2/build/glue/doprint.o | Bin 0 -> 14632 bytes
Sming/third-party/lwip2/build/glue/uprint.d | 20 +
Sming/third-party/lwip2/build/glue/uprint.o | Bin 0 -> 2036 bytes
.../third-party/lwip2/build/netif/ethernet.d | 21 +
.../third-party/lwip2/build/netif/ethernet.o | Bin 0 -> 13104 bytes
Sming/third-party/lwip2/build/user_config.h | 0
.../lwip2/glue-esp/include-esp/README.md | 1 +
.../lwip2/glue-esp/include-esp/arch/cc.h | 121 +
.../lwip2/glue-esp/include-esp/arch/perf.h | 40 +
.../glue-esp/include-esp/arch/sys_arch.h | 0
.../lwip2/glue-esp/include-esp/lwip/api.h | 284 +
.../lwip2/glue-esp/include-esp/lwip/api_msg.h | 174 +
.../include-esp/lwip/app/dhcpserver.h | 114 +
.../glue-esp/include-esp/lwip/app/espconn.h | 678 ++
.../include-esp/lwip/app/espconn_buf.h | 60 +
.../include-esp/lwip/app/espconn_tcp.h | 55 +
.../include-esp/lwip/app/espconn_udp.h | 64 +
.../glue-esp/include-esp/lwip/app/ping.h | 85 +
.../glue-esp/include-esp/lwip/app/time.h | 53 +
.../lwip2/glue-esp/include-esp/lwip/arch.h | 238 +
.../lwip2/glue-esp/include-esp/lwip/autoip.h | 119 +
.../lwip2/glue-esp/include-esp/lwip/debug.h | 98 +
.../lwip2/glue-esp/include-esp/lwip/def.h | 127 +
.../lwip2/glue-esp/include-esp/lwip/dhcp.h | 252 +
.../lwip2/glue-esp/include-esp/lwip/dns.h | 124 +
.../lwip2/glue-esp/include-esp/lwip/err.h | 86 +
.../lwip2/glue-esp/include-esp/lwip/icmp.h | 115 +
.../lwip2/glue-esp/include-esp/lwip/igmp.h | 106 +
.../lwip2/glue-esp/include-esp/lwip/inet.h | 107 +
.../glue-esp/include-esp/lwip/inet_chksum.h | 90 +
.../lwip2/glue-esp/include-esp/lwip/init.h | 73 +
.../lwip2/glue-esp/include-esp/lwip/ip.h | 215 +
.../lwip2/glue-esp/include-esp/lwip/ip_addr.h | 256 +
.../lwip2/glue-esp/include-esp/lwip/ip_frag.h | 88 +
.../lwip2/glue-esp/include-esp/lwip/mdns.h | 114 +
.../lwip2/glue-esp/include-esp/lwip/mem.h | 143 +
.../lwip2/glue-esp/include-esp/lwip/memp.h | 116 +
.../glue-esp/include-esp/lwip/memp_std.h | 126 +
.../lwip2/glue-esp/include-esp/lwip/netbuf.h | 101 +
.../lwip2/glue-esp/include-esp/lwip/netdb.h | 124 +
.../lwip2/glue-esp/include-esp/lwip/netif.h | 320 +
.../glue-esp/include-esp/lwip/netifapi.h | 108 +
.../lwip2/glue-esp/include-esp/lwip/opt.h | 2043 +++++
.../lwip2/glue-esp/include-esp/lwip/pbuf.h | 160 +
.../glue-esp/include-esp/lwip/puck_def.h | 44 +
.../lwip2/glue-esp/include-esp/lwip/raw.h | 98 +
.../lwip2/glue-esp/include-esp/lwip/sio.h | 141 +
.../lwip2/glue-esp/include-esp/lwip/snmp.h | 367 +
.../glue-esp/include-esp/lwip/snmp_asn1.h | 101 +
.../glue-esp/include-esp/lwip/snmp_msg.h | 315 +
.../glue-esp/include-esp/lwip/snmp_structs.h | 268 +
.../lwip2/glue-esp/include-esp/lwip/sntp.h | 60 +
.../lwip2/glue-esp/include-esp/lwip/sockets.h | 376 +
.../lwip2/glue-esp/include-esp/lwip/stats.h | 292 +
.../lwip2/glue-esp/include-esp/lwip/sys.h | 337 +
.../lwip2/glue-esp/include-esp/lwip/tcp.h | 377 +
.../glue-esp/include-esp/lwip/tcp_impl.h | 492 ++
.../lwip2/glue-esp/include-esp/lwip/tcpip.h | 159 +
.../lwip2/glue-esp/include-esp/lwip/timers.h | 98 +
.../lwip2/glue-esp/include-esp/lwip/udp.h | 184 +
.../lwip2/glue-esp/include-esp/lwipopts.h | 2083 +++++
.../lwip2/glue-esp/include-esp/netif/etharp.h | 254 +
.../lwip2/glue-esp/include-esp/netif/if_llc.h | 173 +
.../lwip2/glue-esp/include-esp/netif/ppp_oe.h | 190 +
.../glue-esp/include-esp/netif/wlan_lwip_if.h | 25 +
Sming/third-party/lwip2/glue-esp/lwip-esp.c | 956 +++
Sming/third-party/lwip2/glue-lwip/arch/cc.h | 141 +
.../lwip2/glue-lwip/arch/sys_arch.h | 5 +
.../lwip2/glue-lwip/esp-dhcpserver.c | 1204 +++
Sming/third-party/lwip2/glue-lwip/esp-sntp.c | 411 +
Sming/third-party/lwip2/glue-lwip/esp-time.c | 109 +
.../lwip2/glue-lwip/lwip-git-hash.h | 6 +
Sming/third-party/lwip2/glue-lwip/lwip-git.c | 398 +
.../third-party/lwip2/glue-lwip/lwip-helper.h | 17 +
.../glue-lwip/lwip/apps-esp/dhcpserver.h | 120 +
Sming/third-party/lwip2/glue-lwip/lwipopts.h | 2991 +++++++
Sming/third-party/lwip2/glue/doprint.c | 179 +
Sming/third-party/lwip2/glue/doprint.h | 27 +
Sming/third-party/lwip2/glue/esp-missing.h | 45 +
Sming/third-party/lwip2/glue/glue.h | 115 +
Sming/third-party/lwip2/glue/uprint.c | 76 +
Sming/third-party/lwip2/glue/uprint.h | 26 +
Sming/third-party/lwip2/include/README.md | 1 +
Sming/third-party/lwip2/include/arch/cc.h | 141 +
.../third-party/lwip2/include/arch/sys_arch.h | 5 +
Sming/third-party/lwip2/include/espconn.h | 0
.../third-party/lwip2/include/lwip-git-hash.h | 6 +
Sming/third-party/lwip2/include/lwip/api.h | 400 +
.../third-party/lwip2/include/lwip/apps/FILES | 2 +
.../third-party/lwip2/include/lwip/apps/fs.h | 103 +
.../lwip2/include/lwip/apps/httpd.h | 236 +
.../lwip2/include/lwip/apps/httpd_opts.h | 323 +
.../lwip2/include/lwip/apps/lwiperf.h | 84 +
.../lwip2/include/lwip/apps/mdns.h | 69 +
.../lwip2/include/lwip/apps/mdns_opts.h | 74 +
.../lwip2/include/lwip/apps/mdns_priv.h | 66 +
.../lwip2/include/lwip/apps/mqtt.h | 244 +
.../lwip2/include/lwip/apps/mqtt_opts.h | 103 +
.../lwip2/include/lwip/apps/netbiosns.h | 43 +
.../lwip2/include/lwip/apps/netbiosns_opts.h | 59 +
.../lwip2/include/lwip/apps/snmp.h | 128 +
.../lwip2/include/lwip/apps/snmp_core.h | 364 +
.../lwip2/include/lwip/apps/snmp_mib2.h | 78 +
.../lwip2/include/lwip/apps/snmp_opts.h | 293 +
.../lwip2/include/lwip/apps/snmp_scalar.h | 113 +
.../lwip2/include/lwip/apps/snmp_table.h | 134 +
.../lwip2/include/lwip/apps/snmp_threadsync.h | 114 +
.../lwip2/include/lwip/apps/snmpv3.h | 90 +
.../lwip2/include/lwip/apps/sntp.h | 76 +
.../lwip2/include/lwip/apps/sntp_opts.h | 173 +
.../lwip2/include/lwip/apps/tftp_opts.h | 105 +
.../lwip2/include/lwip/apps/tftp_server.h | 94 +
Sming/third-party/lwip2/include/lwip/arch.h | 319 +
Sming/third-party/lwip2/include/lwip/autoip.h | 99 +
Sming/third-party/lwip2/include/lwip/debug.h | 167 +
Sming/third-party/lwip2/include/lwip/def.h | 142 +
Sming/third-party/lwip2/include/lwip/dhcp.h | 143 +
Sming/third-party/lwip2/include/lwip/dhcp6.h | 58 +
Sming/third-party/lwip2/include/lwip/dns.h | 130 +
Sming/third-party/lwip2/include/lwip/err.h | 119 +
Sming/third-party/lwip2/include/lwip/errno.h | 193 +
Sming/third-party/lwip2/include/lwip/etharp.h | 106 +
Sming/third-party/lwip2/include/lwip/ethip6.h | 68 +
Sming/third-party/lwip2/include/lwip/icmp.h | 110 +
Sming/third-party/lwip2/include/lwip/icmp6.h | 70 +
Sming/third-party/lwip2/include/lwip/igmp.h | 115 +
Sming/third-party/lwip2/include/lwip/inet.h | 172 +
.../lwip2/include/lwip/inet_chksum.h | 105 +
Sming/third-party/lwip2/include/lwip/init.h | 100 +
Sming/third-party/lwip2/include/lwip/ip.h | 319 +
Sming/third-party/lwip2/include/lwip/ip4.h | 111 +
.../third-party/lwip2/include/lwip/ip4_addr.h | 227 +
.../third-party/lwip2/include/lwip/ip4_frag.h | 100 +
Sming/third-party/lwip2/include/lwip/ip6.h | 93 +
.../third-party/lwip2/include/lwip/ip6_addr.h | 285 +
.../third-party/lwip2/include/lwip/ip6_frag.h | 120 +
.../third-party/lwip2/include/lwip/ip_addr.h | 407 +
Sming/third-party/lwip2/include/lwip/mem.h | 82 +
Sming/third-party/lwip2/include/lwip/memp.h | 153 +
Sming/third-party/lwip2/include/lwip/mld6.h | 99 +
Sming/third-party/lwip2/include/lwip/nd6.h | 84 +
Sming/third-party/lwip2/include/lwip/netbuf.h | 118 +
Sming/third-party/lwip2/include/lwip/netdb.h | 150 +
Sming/third-party/lwip2/include/lwip/netif.h | 474 +
.../third-party/lwip2/include/lwip/netifapi.h | 140 +
Sming/third-party/lwip2/include/lwip/opt.h | 2876 +++++++
Sming/third-party/lwip2/include/lwip/pbuf.h | 263 +
.../lwip2/include/lwip/priv/api_msg.h | 216 +
.../lwip2/include/lwip/priv/memp_priv.h | 183 +
.../lwip2/include/lwip/priv/memp_std.h | 146 +
.../lwip2/include/lwip/priv/nd6_priv.h | 144 +
.../lwip2/include/lwip/priv/tcp_priv.h | 507 ++
.../lwip2/include/lwip/priv/tcpip_priv.h | 160 +
.../lwip2/include/lwip/prot/autoip.h | 78 +
.../lwip2/include/lwip/prot/dhcp.h | 183 +
.../third-party/lwip2/include/lwip/prot/dns.h | 140 +
.../lwip2/include/lwip/prot/etharp.h | 91 +
.../lwip2/include/lwip/prot/ethernet.h | 170 +
.../lwip2/include/lwip/prot/icmp.h | 91 +
.../lwip2/include/lwip/prot/icmp6.h | 170 +
.../lwip2/include/lwip/prot/igmp.h | 90 +
.../third-party/lwip2/include/lwip/prot/ip.h | 51 +
.../third-party/lwip2/include/lwip/prot/ip4.h | 127 +
.../third-party/lwip2/include/lwip/prot/ip6.h | 169 +
.../lwip2/include/lwip/prot/mld6.h | 70 +
.../third-party/lwip2/include/lwip/prot/nd6.h | 277 +
.../third-party/lwip2/include/lwip/prot/tcp.h | 97 +
.../third-party/lwip2/include/lwip/prot/udp.h | 68 +
Sming/third-party/lwip2/include/lwip/raw.h | 118 +
Sming/third-party/lwip2/include/lwip/sio.h | 142 +
Sming/third-party/lwip2/include/lwip/snmp.h | 213 +
.../third-party/lwip2/include/lwip/sockets.h | 593 ++
Sming/third-party/lwip2/include/lwip/stats.h | 491 ++
Sming/third-party/lwip2/include/lwip/sys.h | 455 +
Sming/third-party/lwip2/include/lwip/tcp.h | 433 +
Sming/third-party/lwip2/include/lwip/tcpip.h | 106 +
.../third-party/lwip2/include/lwip/timeouts.h | 121 +
Sming/third-party/lwip2/include/lwip/udp.h | 182 +
Sming/third-party/lwip2/include/lwipopts.h | 2996 +++++++
.../third-party/lwip2/include/netif/etharp.h | 3 +
.../lwip2/include/netif/ethernet.h | 77 +
.../third-party/lwip2/include/netif/lowpan6.h | 86 +
.../lwip2/include/netif/lowpan6_opts.h | 70 +
.../third-party/lwip2/include/netif/ppp/ccp.h | 156 +
.../lwip2/include/netif/ppp/chap-md5.h | 36 +
.../lwip2/include/netif/ppp/chap-new.h | 192 +
.../lwip2/include/netif/ppp/chap_ms.h | 44 +
.../third-party/lwip2/include/netif/ppp/eap.h | 169 +
.../third-party/lwip2/include/netif/ppp/ecp.h | 50 +
.../lwip2/include/netif/ppp/eui64.h | 94 +
.../third-party/lwip2/include/netif/ppp/fsm.h | 175 +
.../lwip2/include/netif/ppp/ipcp.h | 126 +
.../lwip2/include/netif/ppp/ipv6cp.h | 183 +
.../third-party/lwip2/include/netif/ppp/lcp.h | 171 +
.../lwip2/include/netif/ppp/magic.h | 122 +
.../lwip2/include/netif/ppp/mppe.h | 173 +
.../lwip2/include/netif/ppp/polarssl/arc4.h | 81 +
.../lwip2/include/netif/ppp/polarssl/des.h | 92 +
.../lwip2/include/netif/ppp/polarssl/md4.h | 97 +
.../lwip2/include/netif/ppp/polarssl/md5.h | 96 +
.../lwip2/include/netif/ppp/polarssl/sha1.h | 96 +
.../third-party/lwip2/include/netif/ppp/ppp.h | 690 ++
.../lwip2/include/netif/ppp/ppp_impl.h | 629 ++
.../lwip2/include/netif/ppp/ppp_opts.h | 593 ++
.../lwip2/include/netif/ppp/pppapi.h | 137 +
.../lwip2/include/netif/ppp/pppcrypt.h | 136 +
.../lwip2/include/netif/ppp/pppdebug.h | 80 +
.../lwip2/include/netif/ppp/pppoe.h | 179 +
.../lwip2/include/netif/ppp/pppol2tp.h | 201 +
.../lwip2/include/netif/ppp/pppos.h | 118 +
.../lwip2/include/netif/ppp/upap.h | 123 +
.../third-party/lwip2/include/netif/ppp/vj.h | 161 +
.../third-party/lwip2/include/netif/slipif.h | 87 +
Sming/third-party/lwip2/include/posix/errno.h | 33 +
Sming/third-party/lwip2/include/posix/netdb.h | 33 +
.../lwip2/include/posix/sys/socket.h | 33 +
Sming/third-party/lwip2/liblwip2.a | Bin 0 -> 1066588 bytes
.../lwip2/lwip2-src/.gitattributes | 4 +
Sming/third-party/lwip2/lwip2-src/.gitignore | 18 +
Sming/third-party/lwip2/lwip2-src/CHANGELOG | 4276 +++++++++
Sming/third-party/lwip2/lwip2-src/COPYING | 33 +
Sming/third-party/lwip2/lwip2-src/FILES | 5 +
Sming/third-party/lwip2/lwip2-src/README | 100 +
Sming/third-party/lwip2/lwip2-src/UPGRADING | 235 +
Sming/third-party/lwip2/lwip2-src/doc/FILES | 9 +
.../lwip2/lwip2-src/doc/NO_SYS_SampleCode.c | 117 +
.../lwip2/lwip2-src/doc/contrib.txt | 58 +
.../lwip2/lwip2-src/doc/doxygen/generate.bat | 1 +
.../lwip2/lwip2-src/doc/doxygen/generate.sh | 3 +
.../lwip2/lwip2-src/doc/doxygen/lwip.Doxyfile | 2505 ++++++
.../lwip2/lwip2-src/doc/doxygen/main_page.h | 132 +
.../lwip2-src/doc/doxygen/output/index.html | 10 +
.../third-party/lwip2/lwip2-src/doc/mdns.txt | 113 +
.../lwip2/lwip2-src/doc/mqtt_client.txt | 162 +
Sming/third-party/lwip2/lwip2-src/doc/ppp.txt | 529 ++
.../lwip2/lwip2-src/doc/rawapi.txt | 499 ++
.../lwip2/lwip2-src/doc/savannah.txt | 120 +
.../lwip2/lwip2-src/doc/sys_arch.txt | 303 +
Sming/third-party/lwip2/lwip2-src/src/FILES | 15 +
.../lwip2/lwip2-src/src/Filelists.mk | 181 +
.../lwip2/lwip2-src/src/api/api_lib.c | 1010 +++
.../lwip2/lwip2-src/src/api/api_msg.c | 1947 +++++
.../third-party/lwip2/lwip2-src/src/api/err.c | 115 +
.../lwip2/lwip2-src/src/api/netbuf.c | 246 +
.../lwip2/lwip2-src/src/api/netdb.c | 413 +
.../lwip2/lwip2-src/src/api/netifapi.c | 221 +
.../lwip2/lwip2-src/src/api/sockets.c | 2827 ++++++
.../lwip2/lwip2-src/src/api/tcpip.c | 518 ++
.../lwip2/lwip2-src/src/apps/httpd/fs.c | 179 +
.../lwip2-src/src/apps/httpd/fs/404.html | 21 +
.../lwip2-src/src/apps/httpd/fs/img/sics.gif | Bin 0 -> 724 bytes
.../lwip2-src/src/apps/httpd/fs/index.html | 47 +
.../lwip2/lwip2-src/src/apps/httpd/fsdata.c | 298 +
.../lwip2/lwip2-src/src/apps/httpd/fsdata.h | 50 +
.../lwip2/lwip2-src/src/apps/httpd/httpd.c | 2629 ++++++
.../lwip2-src/src/apps/httpd/httpd_structs.h | 114 +
.../src/apps/httpd/makefsdata/makefsdata | 97 +
.../src/apps/httpd/makefsdata/makefsdata.c | 1033 +++
.../src/apps/httpd/makefsdata/readme.txt | 13 +
.../lwip2-src/src/apps/lwiperf/lwiperf.c | 661 ++
.../lwip2/lwip2-src/src/apps/mdns/mdns.c | 2028 +++++
.../lwip2/lwip2-src/src/apps/mqtt/mqtt.c | 1341 +++
.../lwip2-src/src/apps/netbiosns/netbiosns.c | 367 +
.../lwip2/lwip2-src/src/apps/snmp/snmp_asn1.c | 749 ++
.../lwip2/lwip2-src/src/apps/snmp/snmp_asn1.h | 108 +
.../lwip2/lwip2-src/src/apps/snmp/snmp_core.c | 1349 +++
.../lwip2-src/src/apps/snmp/snmp_core_priv.h | 76 +
.../lwip2/lwip2-src/src/apps/snmp/snmp_mib2.c | 116 +
.../lwip2-src/src/apps/snmp/snmp_mib2_icmp.c | 182 +
.../src/apps/snmp/snmp_mib2_interfaces.c | 375 +
.../lwip2-src/src/apps/snmp/snmp_mib2_ip.c | 743 ++
.../lwip2-src/src/apps/snmp/snmp_mib2_snmp.c | 227 +
.../src/apps/snmp/snmp_mib2_system.c | 377 +
.../lwip2-src/src/apps/snmp/snmp_mib2_tcp.c | 594 ++
.../lwip2-src/src/apps/snmp/snmp_mib2_udp.c | 357 +
.../lwip2/lwip2-src/src/apps/snmp/snmp_msg.c | 1668 ++++
.../lwip2/lwip2-src/src/apps/snmp/snmp_msg.h | 194 +
.../lwip2-src/src/apps/snmp/snmp_netconn.c | 121 +
.../src/apps/snmp/snmp_pbuf_stream.c | 156 +
.../src/apps/snmp/snmp_pbuf_stream.h | 73 +
.../lwip2/lwip2-src/src/apps/snmp/snmp_raw.c | 100 +
.../lwip2-src/src/apps/snmp/snmp_scalar.c | 220 +
.../lwip2-src/src/apps/snmp/snmp_table.c | 343 +
.../lwip2-src/src/apps/snmp/snmp_threadsync.c | 219 +
.../lwip2-src/src/apps/snmp/snmp_traps.c | 445 +
.../lwip2/lwip2-src/src/apps/snmp/snmpv3.c | 136 +
.../lwip2-src/src/apps/snmp/snmpv3_dummy.c | 145 +
.../lwip2-src/src/apps/snmp/snmpv3_mbedtls.c | 331 +
.../lwip2-src/src/apps/snmp/snmpv3_priv.h | 66 +
.../lwip2/lwip2-src/src/apps/sntp/sntp.c | 727 ++
.../lwip2-src/src/apps/tftp/tftp_server.c | 417 +
.../lwip2/lwip2-src/src/core/def.c | 222 +
.../lwip2/lwip2-src/src/core/dns.c | 1573 ++++
.../lwip2/lwip2-src/src/core/inet_chksum.c | 609 ++
.../lwip2/lwip2-src/src/core/init.c | 385 +
.../third-party/lwip2/lwip2-src/src/core/ip.c | 124 +
.../lwip2/lwip2-src/src/core/ipv4/autoip.c | 527 ++
.../lwip2/lwip2-src/src/core/ipv4/dhcp.c | 1950 +++++
.../lwip2/lwip2-src/src/core/ipv4/etharp.c | 1206 +++
.../lwip2/lwip2-src/src/core/ipv4/icmp.c | 397 +
.../lwip2/lwip2-src/src/core/ipv4/igmp.c | 800 ++
.../lwip2/lwip2-src/src/core/ipv4/ip4.c | 1086 +++
.../lwip2/lwip2-src/src/core/ipv4/ip4_addr.c | 331 +
.../lwip2/lwip2-src/src/core/ipv4/ip4_frag.c | 831 ++
.../lwip2/lwip2-src/src/core/ipv6/dhcp6.c | 50 +
.../lwip2/lwip2-src/src/core/ipv6/ethip6.c | 118 +
.../lwip2/lwip2-src/src/core/ipv6/icmp6.c | 350 +
.../lwip2/lwip2-src/src/core/ipv6/inet6.c | 53 +
.../lwip2/lwip2-src/src/core/ipv6/ip6.c | 1122 +++
.../lwip2/lwip2-src/src/core/ipv6/ip6_addr.c | 292 +
.../lwip2/lwip2-src/src/core/ipv6/ip6_frag.c | 805 ++
.../lwip2/lwip2-src/src/core/ipv6/mld6.c | 588 ++
.../lwip2/lwip2-src/src/core/ipv6/nd6.c | 2102 +++++
.../lwip2/lwip2-src/src/core/mem.c | 777 ++
.../lwip2/lwip2-src/src/core/memp.c | 496 ++
.../lwip2/lwip2-src/src/core/netif.c | 1265 +++
.../lwip2/lwip2-src/src/core/pbuf.c | 1442 ++++
.../lwip2/lwip2-src/src/core/raw.c | 521 ++
.../lwip2/lwip2-src/src/core/stats.c | 169 +
.../lwip2/lwip2-src/src/core/sys.c | 106 +
.../lwip2/lwip2-src/src/core/tcp.c | 2164 +++++
.../lwip2/lwip2-src/src/core/tcp_in.c | 1818 ++++
.../lwip2/lwip2-src/src/core/tcp_out.c | 1671 ++++
.../lwip2/lwip2-src/src/core/timeouts.c | 433 +
.../lwip2/lwip2-src/src/core/udp.c | 1191 +++
.../lwip2/lwip2-src/src/include/lwip/api.h | 400 +
.../lwip2-src/src/include/lwip/apps/FILES | 2 +
.../lwip2-src/src/include/lwip/apps/fs.h | 103 +
.../lwip2-src/src/include/lwip/apps/httpd.h | 236 +
.../src/include/lwip/apps/httpd_opts.h | 323 +
.../lwip2-src/src/include/lwip/apps/lwiperf.h | 84 +
.../lwip2-src/src/include/lwip/apps/mdns.h | 69 +
.../src/include/lwip/apps/mdns_opts.h | 74 +
.../src/include/lwip/apps/mdns_priv.h | 66 +
.../lwip2-src/src/include/lwip/apps/mqtt.h | 244 +
.../src/include/lwip/apps/mqtt_opts.h | 103 +
.../src/include/lwip/apps/netbiosns.h | 43 +
.../src/include/lwip/apps/netbiosns_opts.h | 59 +
.../lwip2-src/src/include/lwip/apps/snmp.h | 128 +
.../src/include/lwip/apps/snmp_core.h | 364 +
.../src/include/lwip/apps/snmp_mib2.h | 78 +
.../src/include/lwip/apps/snmp_opts.h | 293 +
.../src/include/lwip/apps/snmp_scalar.h | 113 +
.../src/include/lwip/apps/snmp_table.h | 134 +
.../src/include/lwip/apps/snmp_threadsync.h | 114 +
.../lwip2-src/src/include/lwip/apps/snmpv3.h | 90 +
.../lwip2-src/src/include/lwip/apps/sntp.h | 76 +
.../src/include/lwip/apps/sntp_opts.h | 173 +
.../src/include/lwip/apps/tftp_opts.h | 105 +
.../src/include/lwip/apps/tftp_server.h | 94 +
.../lwip2/lwip2-src/src/include/lwip/arch.h | 319 +
.../lwip2/lwip2-src/src/include/lwip/autoip.h | 99 +
.../lwip2/lwip2-src/src/include/lwip/debug.h | 167 +
.../lwip2/lwip2-src/src/include/lwip/def.h | 142 +
.../lwip2/lwip2-src/src/include/lwip/dhcp.h | 143 +
.../lwip2/lwip2-src/src/include/lwip/dhcp6.h | 58 +
.../lwip2/lwip2-src/src/include/lwip/dns.h | 130 +
.../lwip2/lwip2-src/src/include/lwip/err.h | 119 +
.../lwip2/lwip2-src/src/include/lwip/errno.h | 193 +
.../lwip2/lwip2-src/src/include/lwip/etharp.h | 106 +
.../lwip2/lwip2-src/src/include/lwip/ethip6.h | 68 +
.../lwip2/lwip2-src/src/include/lwip/icmp.h | 110 +
.../lwip2/lwip2-src/src/include/lwip/icmp6.h | 70 +
.../lwip2/lwip2-src/src/include/lwip/igmp.h | 115 +
.../lwip2/lwip2-src/src/include/lwip/inet.h | 172 +
.../lwip2-src/src/include/lwip/inet_chksum.h | 105 +
.../lwip2/lwip2-src/src/include/lwip/init.h | 100 +
.../lwip2/lwip2-src/src/include/lwip/ip.h | 319 +
.../lwip2/lwip2-src/src/include/lwip/ip4.h | 111 +
.../lwip2-src/src/include/lwip/ip4_addr.h | 227 +
.../lwip2-src/src/include/lwip/ip4_frag.h | 100 +
.../lwip2/lwip2-src/src/include/lwip/ip6.h | 93 +
.../lwip2-src/src/include/lwip/ip6_addr.h | 285 +
.../lwip2-src/src/include/lwip/ip6_frag.h | 120 +
.../lwip2-src/src/include/lwip/ip_addr.h | 407 +
.../lwip2/lwip2-src/src/include/lwip/mem.h | 82 +
.../lwip2/lwip2-src/src/include/lwip/memp.h | 153 +
.../lwip2/lwip2-src/src/include/lwip/mld6.h | 99 +
.../lwip2/lwip2-src/src/include/lwip/nd6.h | 84 +
.../lwip2/lwip2-src/src/include/lwip/netbuf.h | 118 +
.../lwip2/lwip2-src/src/include/lwip/netdb.h | 150 +
.../lwip2/lwip2-src/src/include/lwip/netif.h | 474 +
.../lwip2-src/src/include/lwip/netifapi.h | 140 +
.../lwip2/lwip2-src/src/include/lwip/opt.h | 2876 +++++++
.../lwip2/lwip2-src/src/include/lwip/pbuf.h | 263 +
.../lwip2-src/src/include/lwip/priv/api_msg.h | 216 +
.../src/include/lwip/priv/memp_priv.h | 183 +
.../src/include/lwip/priv/memp_std.h | 146 +
.../src/include/lwip/priv/nd6_priv.h | 144 +
.../src/include/lwip/priv/tcp_priv.h | 507 ++
.../src/include/lwip/priv/tcpip_priv.h | 160 +
.../lwip2-src/src/include/lwip/prot/autoip.h | 78 +
.../lwip2-src/src/include/lwip/prot/dhcp.h | 183 +
.../lwip2-src/src/include/lwip/prot/dns.h | 140 +
.../lwip2-src/src/include/lwip/prot/etharp.h | 91 +
.../src/include/lwip/prot/ethernet.h | 170 +
.../lwip2-src/src/include/lwip/prot/icmp.h | 91 +
.../lwip2-src/src/include/lwip/prot/icmp6.h | 170 +
.../lwip2-src/src/include/lwip/prot/igmp.h | 90 +
.../lwip2-src/src/include/lwip/prot/ip.h | 51 +
.../lwip2-src/src/include/lwip/prot/ip4.h | 127 +
.../lwip2-src/src/include/lwip/prot/ip6.h | 169 +
.../lwip2-src/src/include/lwip/prot/mld6.h | 70 +
.../lwip2-src/src/include/lwip/prot/nd6.h | 277 +
.../lwip2-src/src/include/lwip/prot/tcp.h | 97 +
.../lwip2-src/src/include/lwip/prot/udp.h | 68 +
.../lwip2/lwip2-src/src/include/lwip/raw.h | 118 +
.../lwip2/lwip2-src/src/include/lwip/sio.h | 142 +
.../lwip2/lwip2-src/src/include/lwip/snmp.h | 213 +
.../lwip2-src/src/include/lwip/sockets.h | 593 ++
.../lwip2/lwip2-src/src/include/lwip/stats.h | 491 ++
.../lwip2/lwip2-src/src/include/lwip/sys.h | 455 +
.../lwip2/lwip2-src/src/include/lwip/tcp.h | 433 +
.../lwip2/lwip2-src/src/include/lwip/tcpip.h | 106 +
.../lwip2-src/src/include/lwip/timeouts.h | 121 +
.../lwip2/lwip2-src/src/include/lwip/udp.h | 182 +
.../lwip2-src/src/include/netif/etharp.h | 3 +
.../lwip2-src/src/include/netif/ethernet.h | 77 +
.../lwip2-src/src/include/netif/lowpan6.h | 86 +
.../src/include/netif/lowpan6_opts.h | 70 +
.../lwip2-src/src/include/netif/ppp/ccp.h | 156 +
.../src/include/netif/ppp/chap-md5.h | 36 +
.../src/include/netif/ppp/chap-new.h | 192 +
.../lwip2-src/src/include/netif/ppp/chap_ms.h | 44 +
.../lwip2-src/src/include/netif/ppp/eap.h | 169 +
.../lwip2-src/src/include/netif/ppp/ecp.h | 50 +
.../lwip2-src/src/include/netif/ppp/eui64.h | 94 +
.../lwip2-src/src/include/netif/ppp/fsm.h | 175 +
.../lwip2-src/src/include/netif/ppp/ipcp.h | 126 +
.../lwip2-src/src/include/netif/ppp/ipv6cp.h | 183 +
.../lwip2-src/src/include/netif/ppp/lcp.h | 171 +
.../lwip2-src/src/include/netif/ppp/magic.h | 122 +
.../lwip2-src/src/include/netif/ppp/mppe.h | 173 +
.../src/include/netif/ppp/polarssl/arc4.h | 81 +
.../src/include/netif/ppp/polarssl/des.h | 92 +
.../src/include/netif/ppp/polarssl/md4.h | 97 +
.../src/include/netif/ppp/polarssl/md5.h | 96 +
.../src/include/netif/ppp/polarssl/sha1.h | 96 +
.../lwip2-src/src/include/netif/ppp/ppp.h | 690 ++
.../src/include/netif/ppp/ppp_impl.h | 629 ++
.../src/include/netif/ppp/ppp_opts.h | 593 ++
.../lwip2-src/src/include/netif/ppp/pppapi.h | 137 +
.../src/include/netif/ppp/pppcrypt.h | 136 +
.../src/include/netif/ppp/pppdebug.h | 80 +
.../lwip2-src/src/include/netif/ppp/pppoe.h | 179 +
.../src/include/netif/ppp/pppol2tp.h | 201 +
.../lwip2-src/src/include/netif/ppp/pppos.h | 118 +
.../lwip2-src/src/include/netif/ppp/upap.h | 123 +
.../lwip2-src/src/include/netif/ppp/vj.h | 161 +
.../lwip2-src/src/include/netif/slipif.h | 87 +
.../lwip2/lwip2-src/src/include/posix/errno.h | 33 +
.../lwip2/lwip2-src/src/include/posix/netdb.h | 33 +
.../lwip2-src/src/include/posix/sys/socket.h | 33 +
.../lwip2/lwip2-src/src/netif/FILES | 24 +
.../lwip2/lwip2-src/src/netif/ethernet.c | 314 +
.../lwip2/lwip2-src/src/netif/ethernetif.c | 335 +
.../lwip2/lwip2-src/src/netif/lowpan6.c | 1193 +++
.../lwip2-src/src/netif/ppp/PPPD_FOLLOWUP | 473 +
.../lwip2/lwip2-src/src/netif/ppp/auth.c | 2510 ++++++
.../lwip2/lwip2-src/src/netif/ppp/ccp.c | 1740 ++++
.../lwip2/lwip2-src/src/netif/ppp/chap-md5.c | 126 +
.../lwip2/lwip2-src/src/netif/ppp/chap-new.c | 677 ++
.../lwip2/lwip2-src/src/netif/ppp/chap_ms.c | 962 +++
.../lwip2/lwip2-src/src/netif/ppp/demand.c | 465 +
.../lwip2/lwip2-src/src/netif/ppp/eap.c | 2423 ++++++
.../lwip2/lwip2-src/src/netif/ppp/ecp.c | 191 +
.../lwip2/lwip2-src/src/netif/ppp/eui64.c | 56 +
.../lwip2/lwip2-src/src/netif/ppp/fsm.c | 799 ++
.../lwip2/lwip2-src/src/netif/ppp/ipcp.c | 2418 ++++++
.../lwip2/lwip2-src/src/netif/ppp/ipv6cp.c | 1533 ++++
.../lwip2/lwip2-src/src/netif/ppp/lcp.c | 2790 ++++++
.../lwip2/lwip2-src/src/netif/ppp/magic.c | 294 +
.../lwip2/lwip2-src/src/netif/ppp/mppe.c | 412 +
.../lwip2/lwip2-src/src/netif/ppp/multilink.c | 609 ++
.../lwip2-src/src/netif/ppp/polarssl/README | 22 +
.../lwip2-src/src/netif/ppp/polarssl/arc4.c | 101 +
.../lwip2-src/src/netif/ppp/polarssl/des.c | 422 +
.../lwip2-src/src/netif/ppp/polarssl/md4.c | 281 +
.../lwip2-src/src/netif/ppp/polarssl/md5.c | 300 +
.../lwip2-src/src/netif/ppp/polarssl/sha1.c | 335 +
.../lwip2/lwip2-src/src/netif/ppp/ppp.c | 1647 ++++
.../lwip2/lwip2-src/src/netif/ppp/pppapi.c | 427 +
.../lwip2/lwip2-src/src/netif/ppp/pppcrypt.c | 66 +
.../lwip2/lwip2-src/src/netif/ppp/pppoe.c | 1191 +++
.../lwip2/lwip2-src/src/netif/ppp/pppol2tp.c | 1131 +++
.../lwip2/lwip2-src/src/netif/ppp/pppos.c | 875 ++
.../lwip2/lwip2-src/src/netif/ppp/upap.c | 677 ++
.../lwip2/lwip2-src/src/netif/ppp/utils.c | 959 +++
.../lwip2/lwip2-src/src/netif/ppp/vj.c | 695 ++
.../lwip2/lwip2-src/src/netif/slipif.c | 555 ++
.../lwip2/lwip2-src/test/fuzz/Makefile | 53 +
.../lwip2/lwip2-src/test/fuzz/README | 34 +
.../lwip2/lwip2-src/test/fuzz/config.h | 0
.../lwip2/lwip2-src/test/fuzz/fuzz.c | 136 +
.../test/fuzz/inputs/arp/arp_req.bin | Bin 0 -> 42 bytes
.../test/fuzz/inputs/icmp/icmp_ping.bin | Bin 0 -> 98 bytes
.../inputs/ipv6/neighbor_solicitation.bin | Bin 0 -> 86 bytes
.../test/fuzz/inputs/ipv6/router_adv.bin | Bin 0 -> 118 bytes
.../test/fuzz/inputs/tcp/tcp_syn.bin | Bin 0 -> 74 bytes
.../test/fuzz/inputs/udp/udp_port_5000.bin | Bin 0 -> 50 bytes
.../lwip2/lwip2-src/test/fuzz/lwipopts.h | 68 +
.../lwip2-src/test/fuzz/output_to_pcap.sh | 31 +
.../lwip2/lwip2-src/test/unit/core/test_mem.c | 121 +
.../lwip2/lwip2-src/test/unit/core/test_mem.h | 8 +
.../lwip2-src/test/unit/core/test_pbuf.c | 239 +
.../lwip2-src/test/unit/core/test_pbuf.h | 8 +
.../lwip2-src/test/unit/dhcp/test_dhcp.c | 1024 +++
.../lwip2-src/test/unit/dhcp/test_dhcp.h | 8 +
.../lwip2-src/test/unit/etharp/test_etharp.c | 269 +
.../lwip2-src/test/unit/etharp/test_etharp.h | 8 +
.../lwip2/lwip2-src/test/unit/lwip_check.h | 37 +
.../lwip2-src/test/unit/lwip_unittests.c | 70 +
.../lwip2/lwip2-src/test/unit/lwipopts.h | 62 +
.../lwip2-src/test/unit/mdns/test_mdns.c | 915 ++
.../lwip2-src/test/unit/mdns/test_mdns.h | 8 +
.../lwip2-src/test/unit/tcp/tcp_helper.c | 314 +
.../lwip2-src/test/unit/tcp/tcp_helper.h | 52 +
.../lwip2/lwip2-src/test/unit/tcp/test_tcp.c | 744 ++
.../lwip2/lwip2-src/test/unit/tcp/test_tcp.h | 8 +
.../lwip2-src/test/unit/tcp/test_tcp_oos.c | 1049 +++
.../lwip2-src/test/unit/tcp/test_tcp_oos.h | 8 +
.../lwip2/lwip2-src/test/unit/udp/test_udp.c | 68 +
.../lwip2/lwip2-src/test/unit/udp/test_udp.h | 8 +
.../lwip2/makefiles/Makefile.build-lwip2 | 56 +
.../third-party/lwip2/makefiles/Makefile.defs | 10 +
.../third-party/lwip2/makefiles/Makefile.glue | 14 +
.../lwip2/makefiles/Makefile.glue-esp | 12 +
.../lwip2/makefiles/Makefile.lwip2 | 30 +
.../lwip2/makefiles/Makefile.rules | 11 +
.../lwip2/makefiles/make-lwip-hash | 15 +
.../lwip2/makefiles/patch-non-local-includes | 9 +
Sming/third-party/pwm/pwm.c | 11 +-
1179 files changed, 342329 insertions(+), 14 deletions(-)
delete mode 160000 Sming/third-party/ESP8266_NONOS_SDK
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/License
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/README.md
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/VERSION
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/bin/at/1024+1024/user1.2048.new.5.bin
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/bin/at/1024+1024/user2.2048.new.5.bin
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/bin/at/512+512/user1.1024.new.2.bin
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/bin/at/512+512/user2.1024.new.2.bin
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/bin/at/README.md
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/bin/at_sdio/1024+1024/user1.2048.new.5.bin
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/bin/at_sdio/1024+1024/user2.2048.new.5.bin
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/bin/at_sdio/512+512/user1.1024.new.2.bin
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/bin/at_sdio/512+512/user2.1024.new.2.bin
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/bin/at_sdio/README.md
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/bin/blank.bin
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/bin/boot_v1.2.bin
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/bin/boot_v1.6.bin
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/bin/boot_v1.7.bin
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/bin/esp_init_data_default.bin
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/documents/readme.txt
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/README.md
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/driver/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/driver/gpio16.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/driver/hw_timer.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/driver/i2c_master.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/driver/key.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/driver/sdio_slv.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/driver/spi.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/driver/spi_interface.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/driver/spi_overlap.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/driver/uart.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/include/driver/gpio16.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/include/driver/i2c_master.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/include/driver/key.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/include/driver/sdio_slv.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/include/driver/slc_register.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/include/driver/spi.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/include/driver/spi_interface.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/include/driver/spi_overlap.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/include/driver/spi_register.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/include/driver/uart.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/include/driver/uart_register.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/driver_lib/make_lib.sh
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/driver/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/driver/i2c_master.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/driver/key.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/gen_misc.bat
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/gen_misc.sh
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/include/driver/i2c_master.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/include/driver/key.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/include/ssl/cert.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/include/ssl/private_key.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/include/user_config.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/include/user_devicefind.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/include/user_esp_platform.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/include/user_esp_platform_timer.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/include/user_iot_version.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/include/user_json.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/include/user_light.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/include/user_light_adj.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/include/user_plug.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/include/user_sensor.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/include/user_webserver.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/user/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/user/user_devicefind.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/user/user_esp_platform.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/user/user_esp_platform_timer.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/user/user_json.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/user/user_light.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/user/user_light_adj.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/user/user_main.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/user/user_plug.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/user/user_sensor.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/IoT_Demo/user/user_webserver.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at/!!!readme!!!.txt
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at/gen_misc.bat
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at/gen_misc.sh
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at/include/user_config.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at/user/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at/user/at_upgrade.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at/user/user_main.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at_espconn/!!!readme!!!.txt
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at_espconn/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at_espconn/gen_misc.bat
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at_espconn/gen_misc.sh
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at_espconn/include/user_config.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at_espconn/user/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at_espconn/user/at_upgrade.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/examples/at_espconn/user/user_main.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at_sdio/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at_sdio/driver/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at_sdio/driver/sdio_slv.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at_sdio/gen_misc.bat
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at_sdio/gen_misc.sh
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at_sdio/include/driver/sdio_slv.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at_sdio/include/driver/slc_register.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at_sdio/include/user_config.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at_sdio/include/version.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at_sdio/user/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/at_sdio/user/at_upgrade.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/examples/at_sdio/user/user_main.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/README.md
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/gen_misc.bat
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/gen_misc.sh
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/include/driver/uart.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/include/driver/uart_register.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/include/modules/config.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/include/modules/wifi.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/include/mqtt/debug.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/include/mqtt/mqtt.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/include/mqtt/mqtt_msg.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/include/mqtt/proto.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/include/mqtt/queue.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/include/mqtt/ringbuf.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/include/mqtt/typedef.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/include/mqtt/utils.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/include/mqtt_config.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/include/user_config.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/modules/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/modules/config.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/modules/wifi.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/mqtt/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/mqtt/include/debug.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/mqtt/include/mqtt.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/mqtt/include/mqtt_msg.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/mqtt/include/proto.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/mqtt/include/queue.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/mqtt/include/ringbuf.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/mqtt/include/typedef.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/mqtt/include/utils.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/mqtt/mqtt.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/mqtt/mqtt_msg.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/mqtt/proto.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/mqtt/queue.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/mqtt/ringbuf.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/mqtt/utils.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/user/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/esp_mqtt_proj/user/user_main.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/peripheral_test/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/peripheral_test/gen_misc.bat
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/examples/peripheral_test/gen_misc.sh
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/peripheral_test/include/spi_test.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/peripheral_test/include/user_config.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/peripheral_test/user/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/peripheral_test/user/spi_test.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/examples/peripheral_test/user/user_main.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/readme.txt
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/simple_pair/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/simple_pair/gen_misc.bat
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/examples/simple_pair/gen_misc.sh
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/simple_pair/include/user_config.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/simple_pair/user/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/simple_pair/user/user_main.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/smart_config/!!!readme!!!.txt
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/smart_config/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/smart_config/gen_misc.bat
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/examples/smart_config/gen_misc.sh
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/smart_config/include/user_config.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/smart_config/model two-dimension code.rar
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/smart_config/user/Makefile
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/examples/smart_config/user/user_main.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/gen_misc.bat
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/gen_misc.sh
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/include/user_config.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/include/wpa2_pki/ca.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/include/wpa2_pki/certs/ca.der
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/include/wpa2_pki/certs/ca.key
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/include/wpa2_pki/certs/ca.pem
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/include/wpa2_pki/certs/client.crt
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/include/wpa2_pki/certs/client.key
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/include/wpa2_pki/certs/client.p12
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/include/wpa2_pki/certs/client.pem
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/include/wpa2_pki/certs/dh
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/include/wpa2_pki/certs/server.crt
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/include/wpa2_pki/certs/server.key
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/include/wpa2_pki/certs/server.p12
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/include/wpa2_pki/certs/server.pem
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/include/wpa2_pki/client_crt.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/include/wpa2_pki/client_key.h
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/include/wpa2_pki/import_ca_crt_key.sh
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/include/wpa2_pki/str2hex
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/user/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wpa2_enterprise/user/user_main.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wps/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wps/driver/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wps/driver/key.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wps/gen_misc.bat
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/examples/wps/gen_misc.sh
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wps/include/driver/key.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wps/include/user_config.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wps/user/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/examples/wps/user/user_main.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/airkiss.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/at_custom.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/c_types.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/eagle_soc.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/espconn.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/espnow.h
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/include/ets_sys.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/gpio.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/ip_addr.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/json/json.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/json/jsonparse.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/json/jsontree.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/mem.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/mesh.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/os_type.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/osapi.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/ping.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/pwm.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/queue.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/simple_pair.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/smartconfig.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/sntp.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/spi_flash.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/upgrade.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/user_interface.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/include/wpa2_enterprise.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/ld/eagle.app.v6.ld
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/ld/eagle.app.v6.new.1024.app1.ld
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/ld/eagle.app.v6.new.1024.app2.ld
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/ld/eagle.app.v6.new.2048.ld
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/ld/eagle.app.v6.new.512.app1.ld
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/ld/eagle.app.v6.new.512.app2.ld
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/ld/eagle.app.v6.old.1024.app1.ld
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/ld/eagle.app.v6.old.1024.app2.ld
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/ld/eagle.app.v6.old.512.app1.ld
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/ld/eagle.app.v6.old.512.app2.ld
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/ld/eagle.rom.addr.v6.ld
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/lib/libairkiss.a
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/lib/libat.a
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/lib/libc.a
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/lib/libcrypto.a
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/lib/libdriver.a
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/lib/libespnow.a
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/lib/libgcc.a
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/lib/libjson.a
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/lib/liblwip.a
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/lib/liblwip_536.a
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/lib/libmain.a
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/lib/libmbedtls.a
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/lib/libmesh.a
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/lib/libnet80211.a
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/lib/libphy.a
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/lib/libpp.a
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/lib/libpwm.a
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/lib/libsmartconfig.a
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/lib/libssl.a
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/lib/libupgrade.a
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/lib/libwpa.a
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/lib/libwpa2.a
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/lib/libwps.a
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/lib/readme.md
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/lib/strip_libc_funcs.txt
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/lib/strip_libgcc_funcs.txt
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/arch/cc.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/arch/perf.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/arch/sys_arch.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/api.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/api_msg.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/app/dhcpserver.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/app/espconn.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/app/espconn_buf.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/app/espconn_tcp.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/app/espconn_udp.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/app/ping.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/app/time.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/arch.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/autoip.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/debug.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/def.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/dhcp.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/dns.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/err.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/icmp.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/igmp.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/inet.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/inet_chksum.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/init.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/ip.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/ip_addr.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/ip_frag.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/mdns.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/mem.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/memp.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/memp_std.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/netbuf.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/netdb.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/netif.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/netifapi.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/opt.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/pbuf.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/puck_def.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/raw.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/sio.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/snmp.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/snmp_asn1.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/snmp_msg.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/snmp_structs.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/sntp.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/sockets.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/stats.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/sys.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/tcp.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/tcp_impl.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/tcpip.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/timers.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwip/udp.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/lwipopts.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/aes.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/aesni.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/arc4.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/asn1.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/asn1write.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/base64.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/bignum.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/blowfish.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/bn_mul.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/camellia.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/ccm.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/certs.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/check_config.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/cipher.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/cipher_internal.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/compat-1.3.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/config.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/config_esp.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/ctr_drbg.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/debug.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/des.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/dhm.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/ecdh.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/ecdsa.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/ecjpake.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/ecp.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/entropy.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/entropy_poll.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/error.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/gcm.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/havege.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/hmac_drbg.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/mbedtls_debug.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/md.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/md2.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/md4.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/md5.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/md_internal.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/memory_buffer_alloc.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/net.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/oid.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/padlock.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/pem.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/pk.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/pk_internal.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/pkcs11.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/pkcs12.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/pkcs5.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/platform.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/ripemd160.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/rsa.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/sha1.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/sha256.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/sha512.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/ssl.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/ssl_cache.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/ssl_ciphersuites.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/ssl_cookie.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/ssl_internal.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/ssl_ticket.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/sys/espconn_mbedtls.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/sys/socket.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/threading.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/timing.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/version.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/x509.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/x509_crl.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/x509_crt.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/x509_csr.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/mbedtls/xtea.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/netif/etharp.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/netif/if_llc.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/netif/ppp_oe.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/netif/wlan_lwip_if.h
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/ssl/app/espconn_secure.h
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/ssl/app/espconn_ssl.h
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/ssl/ssl_bigint.h
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/ssl/ssl_bigint_impl.h
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/ssl/ssl_cert.h
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/ssl/ssl_config.h
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/ssl/ssl_crypto.h
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/ssl/ssl_crypto_misc.h
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/ssl/ssl_os_int.h
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/ssl/ssl_os_port.h
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/ssl/ssl_private_key.h
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/ssl/ssl_ssl.h
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/ssl/ssl_tls1.h
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/ssl/ssl_version.h
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/include/user_config.h
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/Makefile
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/api/Makefile
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/api/api_lib.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/api/api_msg.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/api/err.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/api/netbuf.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/api/netdb.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/api/netifapi.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/api/sockets.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/api/tcpip.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/app/Makefile
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/app/dhcpserver.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/app/espconn.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/app/espconn_buf.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/app/espconn_mdns.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/app/espconn_tcp.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/app/espconn_udp.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/app/netio.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/app/ping.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/Makefile
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/def.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/dhcp.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/dns.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/init.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/ipv4/Makefile
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/ipv4/autoip.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/ipv4/icmp.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/ipv4/igmp.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/ipv4/inet.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/ipv4/inet_chksum.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/ipv4/ip.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/ipv4/ip_addr.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/ipv4/ip_frag.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/mdns.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/mem.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/memp.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/netif.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/pbuf.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/raw.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/sntp.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/stats.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/sys.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/sys_arch.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/tcp.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/tcp_in.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/tcp_out.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/timers.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/core/udp.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/netif/Makefile
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/lwip/netif/etharp.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/third_party/make_lib.sh
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/app/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/app/espconn_mbedtls.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/app/espconn_secure.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/app/lwIPFile.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/app/lwIPSocket.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/aes.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/aesni.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/arc4.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/asn1parse.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/asn1write.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/base64.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/bignum.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/blowfish.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/camellia.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/ccm.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/certs.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/cipher.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/cipher_wrap.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/ctr_drbg.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/debug.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/des.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/dhm.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/ecdh.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/ecdsa.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/ecjpake.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/ecp.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/ecp_curves.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/entropy.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/entropy_poll.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/error.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/gcm.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/havege.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/hmac_drbg.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/md.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/md2.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/md4.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/md5.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/md_wrap.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/memory_buffer_alloc.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/net.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/oid.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/padlock.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/pem.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/pk.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/pk_wrap.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/pkcs11.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/pkcs12.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/pkcs5.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/pkparse.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/pkwrite.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/platform.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/ripemd160.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/rsa.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/sha1.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/sha256.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/sha512.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/ssl_cache.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/ssl_ciphersuites.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/ssl_cli.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/ssl_cookie.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/ssl_srv.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/ssl_ticket.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/ssl_tls.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/threading.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/timing.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/version.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/version_features.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/x509.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/x509_create.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/x509_crl.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/x509_crt.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/x509_csr.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/x509write_crt.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/x509write_csr.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/library/xtea.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/platform/Makefile
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/platform/esp_hardware.c
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/third_party/mbedtls/platform/net.c
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/tools/README.md
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/tools/gen_appbin.py
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/tools/make_cacert.py
create mode 100644 Sming/third-party/ESP8266_NONOS_SDK/tools/make_cert.py
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/tools/makefile.sh
create mode 100755 Sming/third-party/ESP8266_NONOS_SDK/tools/rmfile.sh
delete mode 160000 Sming/third-party/lwip2
create mode 100644 Sming/third-party/lwip2/Makefile.arduino
create mode 100644 Sming/third-party/lwip2/Makefile.open
create mode 100644 Sming/third-party/lwip2/Makefile.sming
create mode 100644 Sming/third-party/lwip2/README.md
create mode 100644 Sming/third-party/lwip2/build/api/api_lib.d
create mode 100644 Sming/third-party/lwip2/build/api/api_lib.o
create mode 100644 Sming/third-party/lwip2/build/api/api_msg.d
create mode 100644 Sming/third-party/lwip2/build/api/api_msg.o
create mode 100644 Sming/third-party/lwip2/build/api/err.d
create mode 100644 Sming/third-party/lwip2/build/api/err.o
create mode 100644 Sming/third-party/lwip2/build/api/netbuf.d
create mode 100644 Sming/third-party/lwip2/build/api/netbuf.o
create mode 100644 Sming/third-party/lwip2/build/api/netdb.d
create mode 100644 Sming/third-party/lwip2/build/api/netdb.o
create mode 100644 Sming/third-party/lwip2/build/api/netifapi.d
create mode 100644 Sming/third-party/lwip2/build/api/netifapi.o
create mode 100644 Sming/third-party/lwip2/build/api/sockets.d
create mode 100644 Sming/third-party/lwip2/build/api/sockets.o
create mode 100644 Sming/third-party/lwip2/build/api/tcpip.d
create mode 100644 Sming/third-party/lwip2/build/api/tcpip.o
create mode 100644 Sming/third-party/lwip2/build/apps/sntp/sntp.d
create mode 100644 Sming/third-party/lwip2/build/apps/sntp/sntp.o
create mode 100644 Sming/third-party/lwip2/build/core/def.d
create mode 100644 Sming/third-party/lwip2/build/core/def.o
create mode 100644 Sming/third-party/lwip2/build/core/dns.d
create mode 100644 Sming/third-party/lwip2/build/core/dns.o
create mode 100644 Sming/third-party/lwip2/build/core/inet_chksum.d
create mode 100644 Sming/third-party/lwip2/build/core/inet_chksum.o
create mode 100644 Sming/third-party/lwip2/build/core/init.d
create mode 100644 Sming/third-party/lwip2/build/core/init.o
create mode 100644 Sming/third-party/lwip2/build/core/ip.d
create mode 100644 Sming/third-party/lwip2/build/core/ip.o
create mode 100644 Sming/third-party/lwip2/build/core/ipv4/autoip.d
create mode 100644 Sming/third-party/lwip2/build/core/ipv4/autoip.o
create mode 100644 Sming/third-party/lwip2/build/core/ipv4/dhcp.d
create mode 100644 Sming/third-party/lwip2/build/core/ipv4/dhcp.o
create mode 100644 Sming/third-party/lwip2/build/core/ipv4/etharp.d
create mode 100644 Sming/third-party/lwip2/build/core/ipv4/etharp.o
create mode 100644 Sming/third-party/lwip2/build/core/ipv4/icmp.d
create mode 100644 Sming/third-party/lwip2/build/core/ipv4/icmp.o
create mode 100644 Sming/third-party/lwip2/build/core/ipv4/igmp.d
create mode 100644 Sming/third-party/lwip2/build/core/ipv4/igmp.o
create mode 100644 Sming/third-party/lwip2/build/core/ipv4/ip4.d
create mode 100644 Sming/third-party/lwip2/build/core/ipv4/ip4.o
create mode 100644 Sming/third-party/lwip2/build/core/ipv4/ip4_addr.d
create mode 100644 Sming/third-party/lwip2/build/core/ipv4/ip4_addr.o
create mode 100644 Sming/third-party/lwip2/build/core/ipv4/ip4_frag.d
create mode 100644 Sming/third-party/lwip2/build/core/ipv4/ip4_frag.o
create mode 100644 Sming/third-party/lwip2/build/core/ipv6/dhcp6.d
create mode 100644 Sming/third-party/lwip2/build/core/ipv6/dhcp6.o
create mode 100644 Sming/third-party/lwip2/build/core/ipv6/ethip6.d
create mode 100644 Sming/third-party/lwip2/build/core/ipv6/ethip6.o
create mode 100644 Sming/third-party/lwip2/build/core/ipv6/icmp6.d
create mode 100644 Sming/third-party/lwip2/build/core/ipv6/icmp6.o
create mode 100644 Sming/third-party/lwip2/build/core/ipv6/inet6.d
create mode 100644 Sming/third-party/lwip2/build/core/ipv6/inet6.o
create mode 100644 Sming/third-party/lwip2/build/core/ipv6/ip6.d
create mode 100644 Sming/third-party/lwip2/build/core/ipv6/ip6.o
create mode 100644 Sming/third-party/lwip2/build/core/ipv6/ip6_addr.d
create mode 100644 Sming/third-party/lwip2/build/core/ipv6/ip6_addr.o
create mode 100644 Sming/third-party/lwip2/build/core/ipv6/ip6_frag.d
create mode 100644 Sming/third-party/lwip2/build/core/ipv6/ip6_frag.o
create mode 100644 Sming/third-party/lwip2/build/core/ipv6/mld6.d
create mode 100644 Sming/third-party/lwip2/build/core/ipv6/mld6.o
create mode 100644 Sming/third-party/lwip2/build/core/ipv6/nd6.d
create mode 100644 Sming/third-party/lwip2/build/core/ipv6/nd6.o
create mode 100644 Sming/third-party/lwip2/build/core/mem.d
create mode 100644 Sming/third-party/lwip2/build/core/mem.o
create mode 100644 Sming/third-party/lwip2/build/core/memp.d
create mode 100644 Sming/third-party/lwip2/build/core/memp.o
create mode 100644 Sming/third-party/lwip2/build/core/netif.d
create mode 100644 Sming/third-party/lwip2/build/core/netif.o
create mode 100644 Sming/third-party/lwip2/build/core/pbuf.d
create mode 100644 Sming/third-party/lwip2/build/core/pbuf.o
create mode 100644 Sming/third-party/lwip2/build/core/raw.d
create mode 100644 Sming/third-party/lwip2/build/core/raw.o
create mode 100644 Sming/third-party/lwip2/build/core/stats.d
create mode 100644 Sming/third-party/lwip2/build/core/stats.o
create mode 100644 Sming/third-party/lwip2/build/core/sys.d
create mode 100644 Sming/third-party/lwip2/build/core/sys.o
create mode 100644 Sming/third-party/lwip2/build/core/tcp.d
create mode 100644 Sming/third-party/lwip2/build/core/tcp.o
create mode 100644 Sming/third-party/lwip2/build/core/tcp_in.d
create mode 100644 Sming/third-party/lwip2/build/core/tcp_in.o
create mode 100644 Sming/third-party/lwip2/build/core/tcp_out.d
create mode 100644 Sming/third-party/lwip2/build/core/tcp_out.o
create mode 100644 Sming/third-party/lwip2/build/core/timeouts.d
create mode 100644 Sming/third-party/lwip2/build/core/timeouts.o
create mode 100644 Sming/third-party/lwip2/build/core/udp.d
create mode 100644 Sming/third-party/lwip2/build/core/udp.o
create mode 100644 Sming/third-party/lwip2/build/glue-esp/lwip-esp.d
create mode 100644 Sming/third-party/lwip2/build/glue-esp/lwip-esp.o
create mode 100644 Sming/third-party/lwip2/build/glue-lwip/esp-dhcpserver.d
create mode 100644 Sming/third-party/lwip2/build/glue-lwip/esp-dhcpserver.o
create mode 100644 Sming/third-party/lwip2/build/glue-lwip/esp-sntp.d
create mode 100644 Sming/third-party/lwip2/build/glue-lwip/esp-sntp.o
create mode 100644 Sming/third-party/lwip2/build/glue-lwip/esp-time.d
create mode 100644 Sming/third-party/lwip2/build/glue-lwip/esp-time.o
create mode 100644 Sming/third-party/lwip2/build/glue-lwip/lwip-git.d
create mode 100644 Sming/third-party/lwip2/build/glue-lwip/lwip-git.o
create mode 100644 Sming/third-party/lwip2/build/glue/doprint.d
create mode 100644 Sming/third-party/lwip2/build/glue/doprint.o
create mode 100644 Sming/third-party/lwip2/build/glue/uprint.d
create mode 100644 Sming/third-party/lwip2/build/glue/uprint.o
create mode 100644 Sming/third-party/lwip2/build/netif/ethernet.d
create mode 100644 Sming/third-party/lwip2/build/netif/ethernet.o
create mode 100644 Sming/third-party/lwip2/build/user_config.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/README.md
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/arch/cc.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/arch/perf.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/arch/sys_arch.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/api.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/api_msg.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/app/dhcpserver.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/app/espconn.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/app/espconn_buf.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/app/espconn_tcp.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/app/espconn_udp.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/app/ping.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/app/time.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/arch.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/autoip.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/debug.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/def.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/dhcp.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/dns.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/err.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/icmp.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/igmp.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/inet.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/inet_chksum.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/init.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/ip.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/ip_addr.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/ip_frag.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/mdns.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/mem.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/memp.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/memp_std.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/netbuf.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/netdb.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/netif.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/netifapi.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/opt.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/pbuf.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/puck_def.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/raw.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/sio.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/snmp.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/snmp_asn1.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/snmp_msg.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/snmp_structs.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/sntp.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/sockets.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/stats.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/sys.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/tcp.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/tcp_impl.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/tcpip.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/timers.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwip/udp.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/lwipopts.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/netif/etharp.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/netif/if_llc.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/netif/ppp_oe.h
create mode 100644 Sming/third-party/lwip2/glue-esp/include-esp/netif/wlan_lwip_if.h
create mode 100644 Sming/third-party/lwip2/glue-esp/lwip-esp.c
create mode 100644 Sming/third-party/lwip2/glue-lwip/arch/cc.h
create mode 100644 Sming/third-party/lwip2/glue-lwip/arch/sys_arch.h
create mode 100644 Sming/third-party/lwip2/glue-lwip/esp-dhcpserver.c
create mode 100644 Sming/third-party/lwip2/glue-lwip/esp-sntp.c
create mode 100644 Sming/third-party/lwip2/glue-lwip/esp-time.c
create mode 100644 Sming/third-party/lwip2/glue-lwip/lwip-git-hash.h
create mode 100644 Sming/third-party/lwip2/glue-lwip/lwip-git.c
create mode 100644 Sming/third-party/lwip2/glue-lwip/lwip-helper.h
create mode 100644 Sming/third-party/lwip2/glue-lwip/lwip/apps-esp/dhcpserver.h
create mode 100644 Sming/third-party/lwip2/glue-lwip/lwipopts.h
create mode 100644 Sming/third-party/lwip2/glue/doprint.c
create mode 100644 Sming/third-party/lwip2/glue/doprint.h
create mode 100644 Sming/third-party/lwip2/glue/esp-missing.h
create mode 100644 Sming/third-party/lwip2/glue/glue.h
create mode 100644 Sming/third-party/lwip2/glue/uprint.c
create mode 100644 Sming/third-party/lwip2/glue/uprint.h
create mode 100644 Sming/third-party/lwip2/include/README.md
create mode 100644 Sming/third-party/lwip2/include/arch/cc.h
create mode 100644 Sming/third-party/lwip2/include/arch/sys_arch.h
create mode 100644 Sming/third-party/lwip2/include/espconn.h
create mode 100644 Sming/third-party/lwip2/include/lwip-git-hash.h
create mode 100644 Sming/third-party/lwip2/include/lwip/api.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/FILES
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/fs.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/httpd.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/httpd_opts.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/lwiperf.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/mdns.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/mdns_opts.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/mdns_priv.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/mqtt.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/mqtt_opts.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/netbiosns.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/netbiosns_opts.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/snmp.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/snmp_core.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/snmp_mib2.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/snmp_opts.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/snmp_scalar.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/snmp_table.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/snmp_threadsync.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/snmpv3.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/sntp.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/sntp_opts.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/tftp_opts.h
create mode 100644 Sming/third-party/lwip2/include/lwip/apps/tftp_server.h
create mode 100644 Sming/third-party/lwip2/include/lwip/arch.h
create mode 100644 Sming/third-party/lwip2/include/lwip/autoip.h
create mode 100644 Sming/third-party/lwip2/include/lwip/debug.h
create mode 100644 Sming/third-party/lwip2/include/lwip/def.h
create mode 100644 Sming/third-party/lwip2/include/lwip/dhcp.h
create mode 100644 Sming/third-party/lwip2/include/lwip/dhcp6.h
create mode 100644 Sming/third-party/lwip2/include/lwip/dns.h
create mode 100644 Sming/third-party/lwip2/include/lwip/err.h
create mode 100644 Sming/third-party/lwip2/include/lwip/errno.h
create mode 100644 Sming/third-party/lwip2/include/lwip/etharp.h
create mode 100644 Sming/third-party/lwip2/include/lwip/ethip6.h
create mode 100644 Sming/third-party/lwip2/include/lwip/icmp.h
create mode 100644 Sming/third-party/lwip2/include/lwip/icmp6.h
create mode 100644 Sming/third-party/lwip2/include/lwip/igmp.h
create mode 100644 Sming/third-party/lwip2/include/lwip/inet.h
create mode 100644 Sming/third-party/lwip2/include/lwip/inet_chksum.h
create mode 100644 Sming/third-party/lwip2/include/lwip/init.h
create mode 100644 Sming/third-party/lwip2/include/lwip/ip.h
create mode 100644 Sming/third-party/lwip2/include/lwip/ip4.h
create mode 100644 Sming/third-party/lwip2/include/lwip/ip4_addr.h
create mode 100644 Sming/third-party/lwip2/include/lwip/ip4_frag.h
create mode 100644 Sming/third-party/lwip2/include/lwip/ip6.h
create mode 100644 Sming/third-party/lwip2/include/lwip/ip6_addr.h
create mode 100644 Sming/third-party/lwip2/include/lwip/ip6_frag.h
create mode 100644 Sming/third-party/lwip2/include/lwip/ip_addr.h
create mode 100644 Sming/third-party/lwip2/include/lwip/mem.h
create mode 100644 Sming/third-party/lwip2/include/lwip/memp.h
create mode 100644 Sming/third-party/lwip2/include/lwip/mld6.h
create mode 100644 Sming/third-party/lwip2/include/lwip/nd6.h
create mode 100644 Sming/third-party/lwip2/include/lwip/netbuf.h
create mode 100644 Sming/third-party/lwip2/include/lwip/netdb.h
create mode 100644 Sming/third-party/lwip2/include/lwip/netif.h
create mode 100644 Sming/third-party/lwip2/include/lwip/netifapi.h
create mode 100644 Sming/third-party/lwip2/include/lwip/opt.h
create mode 100644 Sming/third-party/lwip2/include/lwip/pbuf.h
create mode 100644 Sming/third-party/lwip2/include/lwip/priv/api_msg.h
create mode 100644 Sming/third-party/lwip2/include/lwip/priv/memp_priv.h
create mode 100644 Sming/third-party/lwip2/include/lwip/priv/memp_std.h
create mode 100644 Sming/third-party/lwip2/include/lwip/priv/nd6_priv.h
create mode 100644 Sming/third-party/lwip2/include/lwip/priv/tcp_priv.h
create mode 100644 Sming/third-party/lwip2/include/lwip/priv/tcpip_priv.h
create mode 100644 Sming/third-party/lwip2/include/lwip/prot/autoip.h
create mode 100644 Sming/third-party/lwip2/include/lwip/prot/dhcp.h
create mode 100644 Sming/third-party/lwip2/include/lwip/prot/dns.h
create mode 100644 Sming/third-party/lwip2/include/lwip/prot/etharp.h
create mode 100644 Sming/third-party/lwip2/include/lwip/prot/ethernet.h
create mode 100644 Sming/third-party/lwip2/include/lwip/prot/icmp.h
create mode 100644 Sming/third-party/lwip2/include/lwip/prot/icmp6.h
create mode 100644 Sming/third-party/lwip2/include/lwip/prot/igmp.h
create mode 100644 Sming/third-party/lwip2/include/lwip/prot/ip.h
create mode 100644 Sming/third-party/lwip2/include/lwip/prot/ip4.h
create mode 100644 Sming/third-party/lwip2/include/lwip/prot/ip6.h
create mode 100644 Sming/third-party/lwip2/include/lwip/prot/mld6.h
create mode 100644 Sming/third-party/lwip2/include/lwip/prot/nd6.h
create mode 100644 Sming/third-party/lwip2/include/lwip/prot/tcp.h
create mode 100644 Sming/third-party/lwip2/include/lwip/prot/udp.h
create mode 100644 Sming/third-party/lwip2/include/lwip/raw.h
create mode 100644 Sming/third-party/lwip2/include/lwip/sio.h
create mode 100644 Sming/third-party/lwip2/include/lwip/snmp.h
create mode 100644 Sming/third-party/lwip2/include/lwip/sockets.h
create mode 100644 Sming/third-party/lwip2/include/lwip/stats.h
create mode 100644 Sming/third-party/lwip2/include/lwip/sys.h
create mode 100644 Sming/third-party/lwip2/include/lwip/tcp.h
create mode 100644 Sming/third-party/lwip2/include/lwip/tcpip.h
create mode 100644 Sming/third-party/lwip2/include/lwip/timeouts.h
create mode 100644 Sming/third-party/lwip2/include/lwip/udp.h
create mode 100644 Sming/third-party/lwip2/include/lwipopts.h
create mode 100644 Sming/third-party/lwip2/include/netif/etharp.h
create mode 100644 Sming/third-party/lwip2/include/netif/ethernet.h
create mode 100644 Sming/third-party/lwip2/include/netif/lowpan6.h
create mode 100644 Sming/third-party/lwip2/include/netif/lowpan6_opts.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/ccp.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/chap-md5.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/chap-new.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/chap_ms.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/eap.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/ecp.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/eui64.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/fsm.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/ipcp.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/ipv6cp.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/lcp.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/magic.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/mppe.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/polarssl/arc4.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/polarssl/des.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/polarssl/md4.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/polarssl/md5.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/polarssl/sha1.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/ppp.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/ppp_impl.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/ppp_opts.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/pppapi.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/pppcrypt.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/pppdebug.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/pppoe.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/pppol2tp.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/pppos.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/upap.h
create mode 100644 Sming/third-party/lwip2/include/netif/ppp/vj.h
create mode 100644 Sming/third-party/lwip2/include/netif/slipif.h
create mode 100644 Sming/third-party/lwip2/include/posix/errno.h
create mode 100644 Sming/third-party/lwip2/include/posix/netdb.h
create mode 100644 Sming/third-party/lwip2/include/posix/sys/socket.h
create mode 100644 Sming/third-party/lwip2/liblwip2.a
create mode 100644 Sming/third-party/lwip2/lwip2-src/.gitattributes
create mode 100644 Sming/third-party/lwip2/lwip2-src/.gitignore
create mode 100644 Sming/third-party/lwip2/lwip2-src/CHANGELOG
create mode 100644 Sming/third-party/lwip2/lwip2-src/COPYING
create mode 100644 Sming/third-party/lwip2/lwip2-src/FILES
create mode 100644 Sming/third-party/lwip2/lwip2-src/README
create mode 100644 Sming/third-party/lwip2/lwip2-src/UPGRADING
create mode 100644 Sming/third-party/lwip2/lwip2-src/doc/FILES
create mode 100644 Sming/third-party/lwip2/lwip2-src/doc/NO_SYS_SampleCode.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/doc/contrib.txt
create mode 100644 Sming/third-party/lwip2/lwip2-src/doc/doxygen/generate.bat
create mode 100755 Sming/third-party/lwip2/lwip2-src/doc/doxygen/generate.sh
create mode 100644 Sming/third-party/lwip2/lwip2-src/doc/doxygen/lwip.Doxyfile
create mode 100644 Sming/third-party/lwip2/lwip2-src/doc/doxygen/main_page.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/doc/doxygen/output/index.html
create mode 100644 Sming/third-party/lwip2/lwip2-src/doc/mdns.txt
create mode 100644 Sming/third-party/lwip2/lwip2-src/doc/mqtt_client.txt
create mode 100644 Sming/third-party/lwip2/lwip2-src/doc/ppp.txt
create mode 100644 Sming/third-party/lwip2/lwip2-src/doc/rawapi.txt
create mode 100644 Sming/third-party/lwip2/lwip2-src/doc/savannah.txt
create mode 100644 Sming/third-party/lwip2/lwip2-src/doc/sys_arch.txt
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/FILES
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/Filelists.mk
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/api/api_lib.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/api/api_msg.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/api/err.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/api/netbuf.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/api/netdb.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/api/netifapi.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/api/sockets.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/api/tcpip.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/httpd/fs.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/httpd/fs/404.html
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/httpd/fs/img/sics.gif
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/httpd/fs/index.html
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/httpd/fsdata.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/httpd/fsdata.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/httpd/httpd.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/httpd/httpd_structs.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/httpd/makefsdata/makefsdata
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/httpd/makefsdata/makefsdata.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/httpd/makefsdata/readme.txt
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/lwiperf/lwiperf.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/mdns/mdns.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/mqtt/mqtt.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/netbiosns/netbiosns.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmp_asn1.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmp_asn1.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmp_core.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmp_core_priv.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmp_mib2.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmp_mib2_icmp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmp_mib2_interfaces.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmp_mib2_ip.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmp_mib2_snmp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmp_mib2_system.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmp_mib2_tcp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmp_mib2_udp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmp_msg.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmp_msg.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmp_netconn.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmp_pbuf_stream.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmp_pbuf_stream.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmp_raw.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmp_scalar.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmp_table.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmp_threadsync.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmp_traps.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmpv3.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmpv3_dummy.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmpv3_mbedtls.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/snmp/snmpv3_priv.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/sntp/sntp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/apps/tftp/tftp_server.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/def.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/dns.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/inet_chksum.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/init.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/ip.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/ipv4/autoip.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/ipv4/dhcp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/ipv4/etharp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/ipv4/icmp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/ipv4/igmp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/ipv4/ip4.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/ipv4/ip4_addr.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/ipv4/ip4_frag.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/ipv6/dhcp6.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/ipv6/ethip6.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/ipv6/icmp6.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/ipv6/inet6.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/ipv6/ip6.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/ipv6/ip6_addr.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/ipv6/ip6_frag.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/ipv6/mld6.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/ipv6/nd6.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/mem.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/memp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/netif.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/pbuf.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/raw.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/stats.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/sys.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/tcp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/tcp_in.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/tcp_out.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/timeouts.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/core/udp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/api.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/FILES
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/fs.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/httpd.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/httpd_opts.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/lwiperf.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/mdns.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/mdns_opts.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/mdns_priv.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/mqtt.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/mqtt_opts.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/netbiosns.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/netbiosns_opts.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/snmp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/snmp_core.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/snmp_mib2.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/snmp_opts.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/snmp_scalar.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/snmp_table.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/snmp_threadsync.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/snmpv3.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/sntp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/sntp_opts.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/tftp_opts.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/apps/tftp_server.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/arch.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/autoip.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/debug.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/def.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/dhcp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/dhcp6.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/dns.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/err.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/errno.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/etharp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/ethip6.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/icmp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/icmp6.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/igmp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/inet.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/inet_chksum.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/init.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/ip.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/ip4.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/ip4_addr.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/ip4_frag.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/ip6.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/ip6_addr.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/ip6_frag.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/ip_addr.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/mem.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/memp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/mld6.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/nd6.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/netbuf.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/netdb.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/netif.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/netifapi.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/opt.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/pbuf.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/priv/api_msg.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/priv/memp_priv.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/priv/memp_std.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/priv/nd6_priv.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/priv/tcp_priv.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/priv/tcpip_priv.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/prot/autoip.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/prot/dhcp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/prot/dns.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/prot/etharp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/prot/ethernet.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/prot/icmp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/prot/icmp6.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/prot/igmp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/prot/ip.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/prot/ip4.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/prot/ip6.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/prot/mld6.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/prot/nd6.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/prot/tcp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/prot/udp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/raw.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/sio.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/snmp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/sockets.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/stats.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/sys.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/tcp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/tcpip.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/timeouts.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/lwip/udp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/etharp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ethernet.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/lowpan6.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/lowpan6_opts.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/ccp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/chap-md5.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/chap-new.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/chap_ms.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/eap.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/ecp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/eui64.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/fsm.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/ipcp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/ipv6cp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/lcp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/magic.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/mppe.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/polarssl/arc4.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/polarssl/des.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/polarssl/md4.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/polarssl/md5.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/polarssl/sha1.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/ppp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/ppp_impl.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/ppp_opts.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/pppapi.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/pppcrypt.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/pppdebug.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/pppoe.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/pppol2tp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/pppos.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/upap.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/ppp/vj.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/netif/slipif.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/posix/errno.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/posix/netdb.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/include/posix/sys/socket.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/FILES
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ethernet.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ethernetif.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/lowpan6.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/PPPD_FOLLOWUP
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/auth.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/ccp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/chap-md5.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/chap-new.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/chap_ms.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/demand.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/eap.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/ecp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/eui64.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/fsm.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/ipcp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/ipv6cp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/lcp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/magic.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/mppe.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/multilink.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/polarssl/README
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/polarssl/arc4.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/polarssl/des.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/polarssl/md4.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/polarssl/md5.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/polarssl/sha1.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/ppp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/pppapi.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/pppcrypt.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/pppoe.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/pppol2tp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/pppos.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/upap.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/utils.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/ppp/vj.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/src/netif/slipif.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/fuzz/Makefile
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/fuzz/README
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/fuzz/config.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/fuzz/fuzz.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/fuzz/inputs/arp/arp_req.bin
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/fuzz/inputs/icmp/icmp_ping.bin
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/fuzz/inputs/ipv6/neighbor_solicitation.bin
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/fuzz/inputs/ipv6/router_adv.bin
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/fuzz/inputs/tcp/tcp_syn.bin
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/fuzz/inputs/udp/udp_port_5000.bin
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/fuzz/lwipopts.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/fuzz/output_to_pcap.sh
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/unit/core/test_mem.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/unit/core/test_mem.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/unit/core/test_pbuf.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/unit/core/test_pbuf.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/unit/dhcp/test_dhcp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/unit/dhcp/test_dhcp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/unit/etharp/test_etharp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/unit/etharp/test_etharp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/unit/lwip_check.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/unit/lwip_unittests.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/unit/lwipopts.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/unit/mdns/test_mdns.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/unit/mdns/test_mdns.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/unit/tcp/tcp_helper.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/unit/tcp/tcp_helper.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/unit/tcp/test_tcp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/unit/tcp/test_tcp.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/unit/tcp/test_tcp_oos.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/unit/tcp/test_tcp_oos.h
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/unit/udp/test_udp.c
create mode 100644 Sming/third-party/lwip2/lwip2-src/test/unit/udp/test_udp.h
create mode 100644 Sming/third-party/lwip2/makefiles/Makefile.build-lwip2
create mode 100644 Sming/third-party/lwip2/makefiles/Makefile.defs
create mode 100644 Sming/third-party/lwip2/makefiles/Makefile.glue
create mode 100644 Sming/third-party/lwip2/makefiles/Makefile.glue-esp
create mode 100644 Sming/third-party/lwip2/makefiles/Makefile.lwip2
create mode 100644 Sming/third-party/lwip2/makefiles/Makefile.rules
create mode 100755 Sming/third-party/lwip2/makefiles/make-lwip-hash
create mode 100755 Sming/third-party/lwip2/makefiles/patch-non-local-includes
diff --git a/Sming/third-party/ESP8266_NONOS_SDK b/Sming/third-party/ESP8266_NONOS_SDK
deleted file mode 160000
index 61248df5f6..0000000000
--- a/Sming/third-party/ESP8266_NONOS_SDK
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 61248df5f6d45d130313b412f7492f581fd4cadf
diff --git a/Sming/third-party/ESP8266_NONOS_SDK/License b/Sming/third-party/ESP8266_NONOS_SDK/License
new file mode 100644
index 0000000000..8a9fade8bd
--- /dev/null
+++ b/Sming/third-party/ESP8266_NONOS_SDK/License
@@ -0,0 +1,24 @@
+ESPRESSIF MIT License
+
+Copyright (c) 2015
+
+Permission is hereby granted for use on ESPRESSIF SYSTEMS ESP8266 only, in which case, it is free of charge, to any person obtaining a copy of this software and associated documentation files (the ¡°Software¡±), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED ¡°AS IS¡±, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+ÀÖöÎ MIT Ðí¿ÉÖ¤
+
+°æȨ (c) 2015 <ÀÖöÎÐÅÏ¢¿Æ¼¼£¨ÉϺ££©ÓÐÏÞ¹«Ë¾>
+
+¸ÃÐí¿ÉÖ¤ÊÚȨ½öÏÞÓÚÀÖöÎÐÅÏ¢¿Æ¼¼ ESP8266 ²úÆ·µÄÓ¦Óÿª·¢¡£ÔÚ´ËÇé¿öÏ£¬¸ÃÐí¿ÉÖ¤Ãâ·ÑÊÚȨÈκλñµÃ¸ÃÈí¼þ¼°ÆäÏà¹ØÎĵµ£¨Í³³ÆΪ¡°Èí¼þ¡±£©µÄÈËÎÞÏÞÖƵؾӪ¸ÃÈí¼þ£¬°üÀ¨ÎÞÏÞÖƵÄʹÓᢸ´ÖÆ¡¢Ð޸ġ¢ºÏ²¢¡¢³ö°æ·¢ÐС¢É¢²¼¡¢ÔÙÊÚȨ¡¢¼°··ÊÛÈí¼þ¼°Èí¼þ¸±±¾µÄȨÀû¡£±»ÊÚȨÈËÔÚÏíÊÜÕâЩȨÀûµÄͬʱ£¬Ðè·þ´ÓÏÂÃæµÄÌõ¼þ£º
+
+ÔÚÈí¼þºÍÈí¼þµÄËùÓи±±¾Öж¼±ØÐë°üº¬ÒÔÉϵİæȨÉùÃ÷ºÍÊÚȨÉùÃ÷¡£
+
+¸ÃÈí¼þ°´±¾À´µÄÑù×ÓÌṩ£¬Ã»ÓÐÈκÎÃ÷È·»ò°µº¬µÄµ£±££¬°üÀ¨µ«²»½öÏÞÓÚ¹ØÓÚÊÔÏúÐÔ¡¢ÊʺÏijһÌض¨ÓÃ;ºÍ·ÇÇÖȨµÄ±£Ö¤¡£×÷ÕߺͰæȨ³ÖÓÐÈËÔÚÈκÎÇé¿öϾù²»¾ÍÓÉÈí¼þ»òÈí¼þʹÓÃÒýÆðµÄÒÔºÏͬÐÎʽ¡¢ÃñÊÂÇÖȨ»òÆäËü·½Ê½Ìá³öµÄÈκÎË÷Åâ¡¢Ë𺦻òÆäËüÔðÈθºÔð¡£
+
+
+
+
diff --git a/Sming/third-party/ESP8266_NONOS_SDK/Makefile b/Sming/third-party/ESP8266_NONOS_SDK/Makefile
new file mode 100644
index 0000000000..11df45c3bd
--- /dev/null
+++ b/Sming/third-party/ESP8266_NONOS_SDK/Makefile
@@ -0,0 +1,396 @@
+# copyright (c) 2010 Espressif System
+#
+ifndef PDIR
+
+endif
+
+ifeq ($(COMPILE), gcc)
+ AR = xtensa-lx106-elf-ar
+ CC = xtensa-lx106-elf-gcc
+ NM = xtensa-lx106-elf-nm
+ CPP = xtensa-lx106-elf-cpp
+ OBJCOPY = xtensa-lx106-elf-objcopy
+ OBJDUMP = xtensa-lx106-elf-objdump
+else
+ AR = xt-ar
+ CC = xt-xcc
+ NM = xt-nm
+ CPP = xt-cpp
+ OBJCOPY = xt-objcopy
+ OBJDUMP = xt-objdump
+endif
+
+BOOT?=none
+APP?=0
+SPI_SPEED?=40
+SPI_MODE?=QIO
+SPI_SIZE_MAP?=0
+
+ifeq ($(BOOT), new)
+ boot = new
+else
+ ifeq ($(BOOT), old)
+ boot = old
+ else
+ boot = none
+ endif
+endif
+
+ifeq ($(APP), 1)
+ app = 1
+else
+ ifeq ($(APP), 2)
+ app = 2
+ else
+ app = 0
+ endif
+endif
+
+ifeq ($(SPI_SPEED), 26.7)
+ freqdiv = 1
+else
+ ifeq ($(SPI_SPEED), 20)
+ freqdiv = 2
+ else
+ ifeq ($(SPI_SPEED), 80)
+ freqdiv = 15
+ else
+ freqdiv = 0
+ endif
+ endif
+endif
+
+
+ifeq ($(SPI_MODE), QOUT)
+ mode = 1
+else
+ ifeq ($(SPI_MODE), DIO)
+ mode = 2
+ else
+ ifeq ($(SPI_MODE), DOUT)
+ mode = 3
+ else
+ mode = 0
+ endif
+ endif
+endif
+
+addr = 0x01000
+
+ifeq ($(SPI_SIZE_MAP), 1)
+ size_map = 1
+ flash = 256
+else
+ ifeq ($(SPI_SIZE_MAP), 2)
+ size_map = 2
+ flash = 1024
+ ifeq ($(app), 2)
+ addr = 0x81000
+ endif
+ else
+ ifeq ($(SPI_SIZE_MAP), 3)
+ size_map = 3
+ flash = 2048
+ ifeq ($(app), 2)
+ addr = 0x81000
+ endif
+ else
+ ifeq ($(SPI_SIZE_MAP), 4)
+ size_map = 4
+ flash = 4096
+ ifeq ($(app), 2)
+ addr = 0x81000
+ endif
+ else
+ ifeq ($(SPI_SIZE_MAP), 5)
+ size_map = 5
+ flash = 2048
+ ifeq ($(app), 2)
+ addr = 0x101000
+ endif
+ else
+ ifeq ($(SPI_SIZE_MAP), 6)
+ size_map = 6
+ flash = 4096
+ ifeq ($(app), 2)
+ addr = 0x101000
+ endif
+ else
+ ifeq ($(SPI_SIZE_MAP), 8)
+ size_map = 8
+ flash = 8192
+ ifeq ($(app), 2)
+ addr = 0x101000
+ endif
+ else
+ ifeq ($(SPI_SIZE_MAP), 9)
+ size_map = 9
+ flash = 16384
+ ifeq ($(app), 2)
+ addr = 0x101000
+ endif
+ else
+ size_map = 0
+ flash = 512
+ ifeq ($(app), 2)
+ addr = 0x41000
+ endif
+ endif
+ endif
+ endif
+ endif
+ endif
+ endif
+ endif
+endif
+
+LD_FILE = $(LDDIR)/eagle.app.v6.ld
+
+ifneq ($(boot), none)
+ifneq ($(app),0)
+ ifneq ($(findstring $(size_map), 6 8 9),)
+ LD_FILE = $(LDDIR)/eagle.app.v6.$(boot).2048.ld
+ else
+ ifeq ($(size_map), 5)
+ LD_FILE = $(LDDIR)/eagle.app.v6.$(boot).2048.ld
+ else
+ ifeq ($(size_map), 4)
+ LD_FILE = $(LDDIR)/eagle.app.v6.$(boot).1024.app$(app).ld
+ else
+ ifeq ($(size_map), 3)
+ LD_FILE = $(LDDIR)/eagle.app.v6.$(boot).1024.app$(app).ld
+ else
+ ifeq ($(size_map), 2)
+ LD_FILE = $(LDDIR)/eagle.app.v6.$(boot).1024.app$(app).ld
+ else
+ ifeq ($(size_map), 0)
+ LD_FILE = $(LDDIR)/eagle.app.v6.$(boot).512.app$(app).ld
+ endif
+ endif
+ endif
+ endif
+ endif
+ endif
+ BIN_NAME = user$(app).$(flash).$(boot).$(size_map)
+endif
+else
+ app = 0
+endif
+
+CSRCS ?= $(wildcard *.c)
+ASRCs ?= $(wildcard *.s)
+ASRCS ?= $(wildcard *.S)
+SUBDIRS ?= $(patsubst %/,%,$(dir $(wildcard */Makefile)))
+
+ODIR := .output
+OBJODIR := $(ODIR)/$(TARGET)/$(FLAVOR)/obj
+
+OBJS := $(CSRCS:%.c=$(OBJODIR)/%.o) \
+ $(ASRCs:%.s=$(OBJODIR)/%.o) \
+ $(ASRCS:%.S=$(OBJODIR)/%.o)
+
+DEPS := $(CSRCS:%.c=$(OBJODIR)/%.d) \
+ $(ASRCs:%.s=$(OBJODIR)/%.d) \
+ $(ASRCS:%.S=$(OBJODIR)/%.d)
+
+LIBODIR := $(ODIR)/$(TARGET)/$(FLAVOR)/lib
+OLIBS := $(GEN_LIBS:%=$(LIBODIR)/%)
+
+IMAGEODIR := $(ODIR)/$(TARGET)/$(FLAVOR)/image
+OIMAGES := $(GEN_IMAGES:%=$(IMAGEODIR)/%)
+
+BINODIR := $(ODIR)/$(TARGET)/$(FLAVOR)/bin
+OBINS := $(GEN_BINS:%=$(BINODIR)/%)
+
+CCFLAGS += \
+ -g \
+ -Wpointer-arith \
+ -Wundef \
+ -Werror \
+ -Wl,-EL \
+ -fno-inline-functions \
+ -nostdlib \
+ -mlongcalls \
+ -mtext-section-literals \
+ -ffunction-sections \
+ -fdata-sections \
+ -fno-builtin-printf
+# -Wall
+
+CFLAGS = $(CCFLAGS) $(DEFINES) $(EXTRA_CCFLAGS) $(INCLUDES)
+DFLAGS = $(CCFLAGS) $(DDEFINES) $(EXTRA_CCFLAGS) $(INCLUDES)
+
+
+#############################################################
+# Functions
+#
+
+define ShortcutRule
+$(1): .subdirs $(2)/$(1)
+endef
+
+define MakeLibrary
+DEP_LIBS_$(1) = $$(foreach lib,$$(filter %.a,$$(COMPONENTS_$(1))),$$(dir $$(lib))$$(LIBODIR)/$$(notdir $$(lib)))
+DEP_OBJS_$(1) = $$(foreach obj,$$(filter %.o,$$(COMPONENTS_$(1))),$$(dir $$(obj))$$(OBJODIR)/$$(notdir $$(obj)))
+$$(LIBODIR)/$(1).a: $$(OBJS) $$(DEP_OBJS_$(1)) $$(DEP_LIBS_$(1)) $$(DEPENDS_$(1))
+ @mkdir -p $$(LIBODIR)
+ $$(if $$(filter %.a,$$?),mkdir -p $$(EXTRACT_DIR)_$(1))
+ $$(if $$(filter %.a,$$?),cd $$(EXTRACT_DIR)_$(1); $$(foreach lib,$$(filter %.a,$$?),$$(AR) xo $$(UP_EXTRACT_DIR)/$$(lib);))
+ $$(AR) ru $$@ $$(filter %.o,$$?) $$(if $$(filter %.a,$$?),$$(EXTRACT_DIR)_$(1)/*.o)
+ $$(if $$(filter %.a,$$?),$$(RM) -r $$(EXTRACT_DIR)_$(1))
+endef
+
+define MakeImage
+DEP_LIBS_$(1) = $$(foreach lib,$$(filter %.a,$$(COMPONENTS_$(1))),$$(dir $$(lib))$$(LIBODIR)/$$(notdir $$(lib)))
+DEP_OBJS_$(1) = $$(foreach obj,$$(filter %.o,$$(COMPONENTS_$(1))),$$(dir $$(obj))$$(OBJODIR)/$$(notdir $$(obj)))
+$$(IMAGEODIR)/$(1).out: $$(OBJS) $$(DEP_OBJS_$(1)) $$(DEP_LIBS_$(1)) $$(DEPENDS_$(1))
+ @mkdir -p $$(IMAGEODIR)
+ $$(CC) $$(LDFLAGS) $$(if $$(LINKFLAGS_$(1)),$$(LINKFLAGS_$(1)),$$(LINKFLAGS_DEFAULT) $$(OBJS) $$(DEP_OBJS_$(1)) $$(DEP_LIBS_$(1))) -o $$@
+endef
+
+$(BINODIR)/%.bin: $(IMAGEODIR)/%.out
+ @mkdir -p $(BINODIR)
+
+ifeq ($(APP), 0)
+ @$(RM) -r ../bin/eagle.S ../bin/eagle.dump
+ @$(OBJDUMP) -x -s $< > ../bin/eagle.dump
+ @$(OBJDUMP) -S $< > ../bin/eagle.S
+else
+ mkdir -p ../bin/upgrade
+ @$(RM) -r ../bin/upgrade/$(BIN_NAME).S ../bin/upgrade/$(BIN_NAME).dump
+ @$(OBJDUMP) -x -s $< > ../bin/upgrade/$(BIN_NAME).dump
+ @$(OBJDUMP) -S $< > ../bin/upgrade/$(BIN_NAME).S
+endif
+
+ @$(OBJCOPY) --only-section .text -O binary $< eagle.app.v6.text.bin
+ @$(OBJCOPY) --only-section .data -O binary $< eagle.app.v6.data.bin
+ @$(OBJCOPY) --only-section .rodata -O binary $< eagle.app.v6.rodata.bin
+ @$(OBJCOPY) --only-section .irom0.text -O binary $< eagle.app.v6.irom0text.bin
+
+ @echo ""
+ @echo "!!!"
+
+ifeq ($(app), 0)
+ @python ../tools/gen_appbin.py $< 0 $(mode) $(freqdiv) $(size_map) $(app)
+ @mv eagle.app.flash.bin ../bin/eagle.flash.bin
+ @mv eagle.app.v6.irom0text.bin ../bin/eagle.irom0text.bin
+ @rm eagle.app.v6.*
+ @echo "No boot needed."
+ @echo "Generate eagle.flash.bin and eagle.irom0text.bin successully in folder bin."
+ @echo "eagle.flash.bin-------->0x00000"
+ @echo "eagle.irom0text.bin---->0x10000"
+else
+ ifneq ($(boot), new)
+ @python ../tools/gen_appbin.py $< 1 $(mode) $(freqdiv) $(size_map) $(app)
+ @echo "Support boot_v1.1 and +"
+ else
+ @python ../tools/gen_appbin.py $< 2 $(mode) $(freqdiv) $(size_map) $(app)
+
+ ifeq ($(size_map), 6)
+ @echo "Support boot_v1.4 and +"
+ else
+ ifeq ($(size_map), 5)
+ @echo "Support boot_v1.4 and +"
+ else
+ @echo "Support boot_v1.2 and +"
+ endif
+ endif
+ endif
+
+ @mv eagle.app.flash.bin ../bin/upgrade/$(BIN_NAME).bin
+ @rm eagle.app.v6.*
+ @echo "Generate $(BIN_NAME).bin successully in folder bin/upgrade."
+ @echo "boot.bin------------>0x00000"
+ @echo "$(BIN_NAME).bin--->$(addr)"
+endif
+
+ @echo "!!!"
+
+#############################################################
+# Rules base
+# Should be done in top-level makefile only
+#
+
+all: .subdirs $(OBJS) $(OLIBS) $(OIMAGES) $(OBINS) $(SPECIAL_MKTARGETS)
+
+clean:
+ $(foreach d, $(SUBDIRS), $(MAKE) -C $(d) clean;)
+ $(RM) -r $(ODIR)/$(TARGET)/$(FLAVOR)
+
+clobber: $(SPECIAL_CLOBBER)
+ $(foreach d, $(SUBDIRS), $(MAKE) -C $(d) clobber;)
+ $(RM) -r $(ODIR)
+
+.subdirs:
+ @set -e; $(foreach d, $(SUBDIRS), $(MAKE) -C $(d);)
+
+#.subdirs:
+# $(foreach d, $(SUBDIRS), $(MAKE) -C $(d))
+
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(MAKECMDGOALS),clobber)
+ifdef DEPS
+sinclude $(DEPS)
+endif
+endif
+endif
+
+$(OBJODIR)/%.o: %.c
+ @mkdir -p $(OBJODIR);
+ $(CC) $(if $(findstring $<,$(DSRCS)),$(DFLAGS),$(CFLAGS)) $(COPTS_$(*F)) -o $@ -c $<
+
+$(OBJODIR)/%.d: %.c
+ @mkdir -p $(OBJODIR);
+ @echo DEPEND: $(CC) -M $(CFLAGS) $<
+ @set -e; rm -f $@; \
+ $(CC) -M $(CFLAGS) $< > $@.$$$$; \
+ sed 's,\($*\.o\)[ :]*,$(OBJODIR)/\1 $@ : ,g' < $@.$$$$ > $@; \
+ rm -f $@.$$$$
+
+$(OBJODIR)/%.o: %.s
+ @mkdir -p $(OBJODIR);
+ $(CC) $(CFLAGS) -o $@ -c $<
+
+$(OBJODIR)/%.d: %.s
+ @mkdir -p $(OBJODIR); \
+ set -e; rm -f $@; \
+ $(CC) -M $(CFLAGS) $< > $@.$$$$; \
+ sed 's,\($*\.o\)[ :]*,$(OBJODIR)/\1 $@ : ,g' < $@.$$$$ > $@; \
+ rm -f $@.$$$$
+
+$(OBJODIR)/%.o: %.S
+ @mkdir -p $(OBJODIR);
+ $(CC) $(CFLAGS) -D__ASSEMBLER__ -o $@ -c $<
+
+$(OBJODIR)/%.d: %.S
+ @mkdir -p $(OBJODIR); \
+ set -e; rm -f $@; \
+ $(CC) -M $(CFLAGS) $< > $@.$$$$; \
+ sed 's,\($*\.o\)[ :]*,$(OBJODIR)/\1 $@ : ,g' < $@.$$$$ > $@; \
+ rm -f $@.$$$$
+
+$(foreach lib,$(GEN_LIBS),$(eval $(call ShortcutRule,$(lib),$(LIBODIR))))
+
+$(foreach image,$(GEN_IMAGES),$(eval $(call ShortcutRule,$(image),$(IMAGEODIR))))
+
+$(foreach bin,$(GEN_BINS),$(eval $(call ShortcutRule,$(bin),$(BINODIR))))
+
+$(foreach lib,$(GEN_LIBS),$(eval $(call MakeLibrary,$(basename $(lib)))))
+
+$(foreach image,$(GEN_IMAGES),$(eval $(call MakeImage,$(basename $(image)))))
+
+#############################################################
+# Recursion Magic - Don't touch this!!
+#
+# Each subtree potentially has an include directory
+# corresponding to the common APIs applicable to modules
+# rooted at that subtree. Accordingly, the INCLUDE PATH
+# of a module can only contain the include directories up
+# its parent path, and not its siblings
+#
+# Required for each makefile to inherit from the parent
+#
+
+INCLUDES := $(INCLUDES) -I $(PDIR)include -I $(PDIR)include/$(TARGET) -I $(PDIR)driver_lib/include
+PDIR := ../$(PDIR)
+sinclude $(PDIR)Makefile
diff --git a/Sming/third-party/ESP8266_NONOS_SDK/README.md b/Sming/third-party/ESP8266_NONOS_SDK/README.md
new file mode 100644
index 0000000000..eef92c6302
--- /dev/null
+++ b/Sming/third-party/ESP8266_NONOS_SDK/README.md
@@ -0,0 +1,3 @@
+# ESP8266_NONOS_SDK
+
+All documentations @ http://espressif.com/en/support/download/documents?keys=&field_type_tid%5B%5D=14
diff --git a/Sming/third-party/ESP8266_NONOS_SDK/VERSION b/Sming/third-party/ESP8266_NONOS_SDK/VERSION
new file mode 100644
index 0000000000..f08c7393ed
--- /dev/null
+++ b/Sming/third-party/ESP8266_NONOS_SDK/VERSION
@@ -0,0 +1,23 @@
+gwen:
+ at : 9422289
+ crypto : ce90efd
+ espnow : ce90efd
+ json : ce90efd
+ main : 9422289
+ mesh : b19a6f7
+ net80211 : deb1901
+ pp : deb1901
+ smartconfig : b19a6f7
+ ssl : b19a6f7
+ upgrade : b19a6f7
+ wpa : deb1901
+ wpa2 : b19a6f7
+ wps : b19a6f7
+
+phy:
+ phy : 1136
+
+gitlab:
+ driver : 68fc7b06
+ lwip : 110cb9d7
+ mbedtls : 8e8090b6
\ No newline at end of file
diff --git a/Sming/third-party/ESP8266_NONOS_SDK/bin/at/1024+1024/user1.2048.new.5.bin b/Sming/third-party/ESP8266_NONOS_SDK/bin/at/1024+1024/user1.2048.new.5.bin
new file mode 100644
index 0000000000000000000000000000000000000000..1cb68279fe2847e51e6267335647996ef841e519
GIT binary patch
literal 427060
zcmagH3tW@e`2c**o4mQe2_ymI1*~~rFa(=e5^W0|)Fcu_3mv4DYNs8E7%x+&%vSsV
zs|7UFc5Fkmwyt!G)Lz%F$~xO_whd?yS8RdWRy%FgwN^VXfQTrP^F8NHP`Cg0{XTy^
zp96Il!y?e@Fzllj*tT4*Qj@xmR_e@u2bXeuKKOo
zrL#ju)UYs6JxC!^IdOB<8Y7D=-0baVDXxi|%k#A?vT(De2iiTkEi&yagyc9nEm=jU
zspe`O9qGuiIT1NthoEoiY4u{xi?a3`0}mM*IpH$3^;6eQJszMT7zL$b5ZQNG+*c{l
z!*6(iy4UH1^HdbS;>S!3XvSFy|M?y6PsZmF;Rov8HGy!pGnB~j53D}X<1_4+_onbC
zQd+*H{2HB=g!g8&>jHO8P+@(GRvKqk0-d%SLN^zGV&enV_mfiDxK6UM>dGTnHgG@J^0gmwVXc`
z?;#sqq^2al>eY8Mh?blw`k^S>qHYQ{HV3Pl=jAocyT74mLru|Bl|@y)qK#ZpHCI$4
z9H*IB+#wq?eGOdx&Y2`m6gz7Ou@h}HSU%=pfkWRC}
zZ|Z5}I6DbB>_Mt;IeAETOgLvd)l1cw`-X~W_ciCe4Qeuhq`Mru3jkt??uTWyf_Y4BI
z6Vzzz&k}3gzr8~w8@M1E@Nj;8l5mvTgAP{^xr#R6e@e@PDoK@xJVk2vPUN_vry9PY
z4Vl(8d*!6Crl`uV9xWWEmg%^Yl@&grMKb(pv>LbE$t`z?$7vJS+e|j?oy2jjUhx~s
zx%P0@yZ8P=PLk|Jn+6=XBa2LREx()p7i|@Ax4@kiWc~@`Z6DBVnK>zY3jRPE@LuZL
z^@7+s48sn)xIrgF45Ne?3RG^E!ybuTng+NEh-$E_?C(T`>kQpFF_eWEy4$W&&KH82
zks3Tx8lk~?;TMZ^WwWH3G~U}YK>hSt3R
zzm*e1RclzYl?y}g*EKOzp3m}K3q#^ggzc<@Kz`~i?4>AKr-i+A@|bYVsm6zN=WK_$
z3o;CYMCb(9tEM=fhGv;zBpJg95$fbZ%KKH&x_H;q2Wx(8*Buqk+HOLi
zs&S&DJK5+c`Qt=KIfNj5XTh%)LeC#2IyxcjhENY-C4>?PSrD`kdR~Hj2)iNFLs$u+
z1cC#C5dwm6650zv=tc+
z7iFQ43)GwVK}=C_x29
zNRfaFG)OT66--C9(@@(_kRlruOhvU>s6dGn7SskU@TfqJ6ed(4qS`x90Y-{(sK9`P
z5XE1yPKA%CUC{LW)OhkS<8sY6*KFsU$4U=*
zpV2)j;C5Cpe4LRq;m;KBXP>qIrovkkhotyfD!fVYhf@4|D!fkd-=z3yD!fYZds6&c
zD(s^8T`7K?3QZL6k>baw5Ty9eQv6FQ{DI;>N%7CA&`9y?QoNH2zo+;WDSns=FHqbh
z#s5Kt?G*n}iXWuHHi{di_yH<3P`pEmw@{&;;_XuWBP#rs;;mBr?^LLxxL%6CPlabG
z{*4s>D-||V{Hzpjra~>nPfPK4sIZCRO;Y?ViV)jl(mn$^W&>J3-K^=Mj0r(H{37@V
zM61d+M5`w-05_SR+jEU(y~%b*gLymbyWKmqXooJkftt+E@3|byosTQKagBLf<-w}m
zo3+8s#wJeYZxxkK-N?kzW_|8zEsP|G?}u4M*o=U&~^`t-IXd9aG~S
zOUA5)^hp_uo*T##vl@hP_F&b0I%8(YXx<6~Zv@)#5%7#u7=P$>IX?S~G=~M^C;^r4
zesQ9sWv
zwDGVUIYOM)aRm6%yAV25T8A0-%=@rsPEJG);~3zplaV8+(K=pNYaMgqv<@+-*0*$a
zd*$a!581AHTfU%bA&=k-4ETVk1pix#i4Z$0#q1E1xMgZ9#Qw$7QoA8`ipBB>(6(<_
zERZv{*B7xS;^XY=)E3(EF*P(ywitjt$cc*>m`OZHP#tVONkBE
z8Omn{Y&)pn7pehG}}cR0X$DJ2olL!4JUFlVt$`l><
znybTajS63qLmi@Q*gs^LYa)q40Z;%oE+L=dd91(iZ;(QR{8}?dR+4+p7`ZQl*pxL|
z3=J7hTkWB1h6R&%J3@wc@2W2e85U0R6|Kxmv=aAYlqBM*w9oMiAJltfrC;ke$jO)*
z$1j8|YM-pdzmj^HOzjC~yi$r=sGY3D%cb}vh_Av+rMMa5m3R@0zp!fGj-4s=^*Ga`
zswf{di7K4M#_87^g*zyIj1?0FRiJ59VYTg@VR5oHTjpt6ojt|t%C-Js7-eN$K~r>DSvLF65&xO4G!k+B5xHhF2Gv)Bq;~#L
zUf$p1XM%xm`5(Hzi}aq00Ft!|DD?oKf`xUEr?C>(E35Ez_5thoD;oYv-gPu$)!+e^
zWYx4B9Jb#viX@X!_%chW3I2)=Vsy>2aBE_)^1*x%uhkPwshmHTb9b0b7T%vb#&1b%
zNL=dAR1(VrS8D27E*Zsy#-$by~eegFhNo<$z#gij-8u1+7~P`mA@
z^K9v$S0(6MvNSz_L0MUH!~PFL7GuveqvxH^T*0S&!Fj$1Mc0Gro(I!_XzXW$bH9rf
zy%F*Od9jA9;u6eNn{m}(hMjqWVx7tNj%D51-}*WdsCTUGA9O&5ST$f?VZA?
zuXOe$vwj8o9$(uvwj?W>Dtx&G|46QL&t@?qU
z+#GuPJ#(CxnF^i60c-kyr?6tmL)LZ%x=CHNds4Fw*{+7)KZa
z9M;UiME><`mm8@-uRUsOhaJT<+A5e6;EK5h;;cu8AA=v$m<|)TO1(Fz^D13+omN&P
ztn`Nrb~zW+lFRmor&iX#=TVuigs(q4UVAWT4or4ogl|8Y~n=A6`{ay#&Kj!
zV}nUMns5aif`4W#IySEByQzbhWpQE<2VNN`{0qcsR#P|yN@yIB1HpSwY6%p@F&r67
zcBMf5)m+h7<+~c;Yl{CVEq)LZNRyq6bACzVrp%Jv+w@`~b~&C@oS~gChaMPvA%uTI
z9OiJ&rpCvFL%J5Q8fZA8?k-Xps#K>2C=*g@#&uM(-;LwS^hy_r`%w-P7#kpfHPU`w&AubG%y;$
zE)c$DY>sco1-&$I2iJCqx-&Rf1y@mAS*yG9ih#~
z5y+j8#IpIraY0e3cmCRB`S%zbJ
z?7p9#`hgO1w6ybhy?s3TA!%Gz8f%dJ1)r9hbg(A#(2OjcC%4Z>DIK9u|G__gIzkp$
zCq}jxU~p>8f1<-jqGQvNzr=yFv&PnPM@W8*CegOsAV#?
z9AxZPuZr_31E15DfgwMa1oELo4RJ4%2)Jdnf%q{16s8*Dz=i$+9UamERD>qW8-DV@jbGkm2YsdkZ#VADhS
zx~eHU#}s3hXsjKDfKg@Quo)c}OM9q~tS4M~dA_ghRQbfMV8&2kpj2<|K2yS-G2VA(
zC3mJ|@|k+>OqIDn0hD2bi&WXkQ@6LMz^DiiR(F#wayxOs5aoi^ZP#e&SJcC=PaP;R
z=D%uJF4D_OGMt(oqGz~&5@2C`8Eiig91su$SJN!U`kiXqIq$L33)~4ATg6{fTo+xt
zj&8!WJCBy0^{Q;rmb0C>9$T;z*8%iIR!lrM&23{be~xza!Mgn~bu~SNf67*;?IOK#
zkr`89&1bR%m@&EAfQT517@Fekp<%=Hcvt9#;k!8DD~eafaAYa8;KkEeg@SLW|BgHO
zGxUZibW*%HR>B7*p1}7=eSATMe^Bg=<@^kCYH^lS_cMBG&voGd&C}pVS$203=Lvr7
zBDk~sO6OW#wKp>cpPh%=xaZq?r-U-
z-(SxZ@-(2@Vpp_v-bb(}IOHPe1)+1ZvvcK@$|7Y=k)ol9gI?-icb1n|_=<2-k*vP{
z3UQa@8ykw`t|AoceDi;G9vDFG1GMd1pvSRob(jlx(Y+Qq;o9O*=^fWiq8!k=K@&n#
zT@!29DS!~vawvq7*;gBU5xrxjv2tPU%?*TNbklv9;)Ls|m+#e&H;LmoV=Zzd`;+4{
zP67*#ZIO(VmlYiH7;8&Prus+yK=cZbX@EZt*yC&+`H;k^v-01Z7VBo4>a`24c|c;KM;8`g%3tmD84V9UC$CNadl
z>%TzkKFMg(r_fdgewnr9ej8}>&FuwdYy1hTl8saQO=-WMk@URx5S>HHXB+2|5|o_r
zeFA92LYU%KR;oY^3UY?9pW=^V{kKB@YC@)GA!ES_Dtrj`zi3Xubt?QFEP%I_BYGn;
zwq2&eUa$bh(%JZ<>4#}2z;DVF;A0xf*A6ntqa)NQFn#qp(&5T3UtZ?Ki;MXYhl;n%*RR5-$liYun$Zrbv>#Ofw{(BHM8D7RbTY5Fs22v$Lvn#rEvW^Mgu)`;lV|w8#J)Brjr&$G4cxP$z}do@a;3u!@rypFU~#BGHT0HvWH6rVv;GOO}nzI(PnPr$9-PSaH8Sf7mQ!
zIyD?)o)1*
z!H!~b@zG6flS{k&hT;YlgNy_LPKAxSsHmvvi6#WlsM}=6Xqp@U-!#4^`TvyTN8Mgd
zewU<6&Er9Q*naJihLm;x0^o_pK$ggsODqpq`KZ)ct3;k)@R5e`R-PCj%ViA2Fs?j+
zFGj)2NYe-s^gn1m1*&PwS|G#UL?zutaE;kl~n`}S721Ct!nXzMJOJzIFo>pZ{
z3$cWJ&^@%ffHy-(Pe6{&A_j}jLpxh`4XU@a7l9z!PCUj5hFspj^J`NVb1zudY>(e8
zd;SH*`?;^n-y8Q6ORKGM*tN@zm$7BdtbVITm0QfsNhMQqxVd_>B{N+;HPsU}5!bbv
zt8H7L^n-XID_u!cKBDvxg^TcZBCjFpXRt`(GIhc~DM#YfLNg&B*qVsu4QB&M*il+T
z5})znz%{7avTji5rnrX1RYl~{CP(-CMMC!VrUyD3xSe(`=pQ@Pp9JSv!u({it
z@p=d-1n0f*D_mo0aOoAM(5P`9U-EDW&u2ptuF%rU)Ondk)8M^Mh;|#ce=QoNa7oB{b&AMdFxQAlg8-ZE1-wDZ`W!(8|N$eHo7KYbqGI@h_x
z`=kyGI-okMZJDJxAQ#(r*5mbqFt*H9u#>F>|Bv)hP4)lk&kdAnsglwA3t}-EMm{e^UC4W=xU@pSlU3WE>C6wd`9ghAP^?YY}|DxSQjc2ewoh$oi
zyay6gEsu^mnH>iIfvq&rzkrGA>m4;S;pG3Qjh+32mMN{D%q=35eyTw)12pH*((_ed
zFD;khzYR5tBH}S;rC&RA~)ipsoU|@B>o{4useMU`2h?mrY@W&yM1DjI}pT;7S=r)LQ{1|JetX>B6
zIq--K&VrvCs%x+#S;uq_m!teX-sOmBv>X8z0AeWVi~(2W|S3c>Y5(UdP5KhlXQ&LmFRnTzKs;XLKCW8A1Txz=N{G
zT%9lcff)o2s~O1C<2PKdJcRQZv=4J{)eslipGh9D;7_hXN~(uUFDAH!$%A#RAe1eE
z(vRZ%S?O>FZU>E(4;!#sgGctHZLGB677RvJ93+$hjAWV~+s|&maM3ZcE{4f*YPjGNV!qp}s+Z$J7lHu!Y5XBlIyQ$IyiV&w!?R8*cRNG9ciB^p*
zAI7v5L%%>7Y{?e{Y09J@HZs#byAJ=CP<`5s6%;=uvVC^xLcq7emt
zn0yoYz!L>uV;}~wU#IR1)FkrZ^HAd=K0lx;F_cHlDDd56#bt`d!1(heJKV`brE2G4
zZop;7y9NQ#bAs2d0&Im!KjjeA%F0$E1
z);CM)TvlkiwZ4-P?ijEmV~+0LR8y$oB3)>vW^pX4?ycE5Oe(
z((G)fuJlR!4#1As4XLwml|;btTTR7W>C(Z)IJTNAKsY}*Cp
zJ@`ph{Uy(ryB36yWO*PmGb#wvydWY3OPFUDyV3YYi9>%-fhRAd}^lz?MaHj57ffDFtP;(wE4ko
zS?0r5Xt0xz4!L0$F8Sf53%!o6=?=?*UH{HE*rVB86q
z(6=)C{(1O`=p1O8D|YU|xD&sX?p?;UO+bbY
zrAd6!;8QXpy9vNmgg3I)gQXP}wxd^Kt9SGYq=8LPbBn+prQ8W@N4W=+CfGi`((1^K
z6+O&~=4ozXD&J0lxh{vM=U``SC2nz65HN;7go1wtH^Ui=Hb8d1u3WrhAZ)6$6EUl
zxqbh4fPC>%LEckz4=loLsBSNMLu`H1?pO!5%sz(sc^Xn7ej^iGXX1|7CW|wVHSJ=0G>i`pf?fjt9WVu$j&p
zETXn2-Sf;kw
zyD_&vWS8Zh0B1|X0u=!*q2@Dh!)L}F)z9ei62UFjA~#yPCRsDLh}{w%)w5R1?0j~$
zc}tO8O02-YW{EdWyAsQZ)}MSwwvJSUEIpH~Vz;zR8(B6eUC1cg*hXn%NvNo2R2_0T&zUk6Iwe+&*IYw>kr=X
z^++ms5rOda1)LYfsSwgZU=(gd%aZXPYB(-8iL(rqa=(>#pP;oy1gAwH8oCg%yNwY)
zX8_mj-Gi>+B0Q5#)%N)H?&&pc2IL?AAmCNktBkt#R=nQ>^6fTa+9W>oh5kzeUNtLd7}sRRgDphMEXo80ijH
zgidrF!*M4>O_em%Zg9H=*=GXV4qQU@!FoBIRa~O24^{(d()Wwj32^Fo6pIVyf;W2H
z3Hu3&y?n!p3k&;!EV6`k_-mHnJVJL9o#z`k06*1DyWM}E_7P)MZ
z+do&>_usfL3rhsO`@s#)=Od+mxdOyY02z1TuamqLq1u#pZ}W}8Hhp-+y#qj0_8U=r8r
zr~<DlKtS&-ed)$VLuX0Fk(sDq$7^5p4biyfc37b%+U^uO?y)rU}SE3Ut6mF8D
z@B@@om<5}j=IA7H|0XcH1lG@6l?)RBqlq++Z6j@LV{K#$t`Ti8oI|1h)Ild4_N!RY
zn1u*2j|&OsG0waU$}<>Z+(QwQIN#93gZlD)zd_{fvZZDF<)G^w8a8pIc*13~18Bah
zbB=>EKI3wCnNaS&`qB&3cBCJ6pDS$`&Kn&LwiE4X!@|nTSy`+7$vX1oy?e(KS)eXm
zAp=FcfP+P2o+7_ydq*ePtHRHwgSj6)3_3WB2|Qrrm({qvi0_LSmML&+KQlLV@?efO
ziKT|qa&XEChlc$e1F7?RpD$ew6t{Wcq0<>KM+
zMiF1?Q#l%py2d5K`99{b7MPW$P$3aLSJreLOavPAfDwn-h7rE&GrPprF?b*QvYqO)
zr^)SUQ=h-A2QNe3$N>e1>VzkX@b3+52i-KZur&wg5aY++nX8(PDR)$iCvZ27wZV`>thy=
zDr`5Vi@^zX`@z2QH$#<(LG3RXptV=8?dC3Wnv4s_-MjiFm=7jo(Px&+a35)3}^6$tKd2ZB%jE@PdOjKJkGOu
z{8XC9nycOxpwV*`PPly}Aee{Pit(@5RBV5znXs6tN3XlE~(g8mbS(2=xexQ<5C*t_
z)0(}a682k*q|PIRM#mxa2n2o0?qjFU_4awShq}})pc^-6z2>VqJHhVSRn=EOP@V#)
zmJ>X5BrS$9s07=SeK8ummi73b_Dcl5*QXD!xpfySBHD_owym5lzMso`puAojU}eZJbQ
zhd2mT-(dUxQ31=86qjN37!L^8L8^Q%0bEOz+g1EmwENSw1#yTYpw3M82vW@k0YRoEs&s_*jL;L1G0TW2g*4=tYq;=Y$c07
zvdhMc#2Y`QY(XOM1@}RrtT_oz>O^jXSo|SJ7Tb>YN=w^U{Bb2&LaNrV?zrNRn0j}{
z6qO4u5x&c{*^n<-0Xh@+4abF6W(&TO4aXON3WGa)VK}z-UhvEV6B4s$t5RH+v3t`k
zW*xRlAn6w7RQpGzhD{N(E*lqKD1CXrqV#GnmLFc{trv
zlE~SNY_6;i+@@+<>2fYQ2gRpAf4~p?7AUcn0TN(XR(To#U#anD=f>4&0Dg;~eqPs*dUw+|T+=^RHjUd5
z+z~Py8zAu?RM$QZ0`alxwqH>P@L@H0jcOrC{493rCF7rr7}m*6`h0_4j*s^NTQ+I4
zi7z|@nDH1;kBYCjg3Is^Yy;T9ty$kaef2F(Oh4d+Q%()mFq9Wb2
z>k|D@+&9^DRMY)SS5$7^1$2C-1Vi8*Ol*d$v!BAIKl@mqB4YTn%CF}X0y2PuV4|(P
zhtb##5!Zr+BI@j0P_f;^lhl*PgC48Nz{`CTUHhI$A(!&`>C=F0511LRW=>ns1
zRO0xLy$Xl3;^D%R_XF`)U@NQMX*EXcrx{f`Zh1O1LQ=Osaifz2?M74Mztloq#0p{o
z7Fg+y=4=55VbuT~;wMdv_E-Qt&afN?c>`eKRDxvck}oBC*MSJYh3Ss42bpub+X?cy
z3j9l=LNl2tJbcYL)C(usoP23VLpILhw{rPQ3wY!MtSZ1JBk|-f1q$@~c(}duJNN^>
z*M^l~-NBVXRGGgt{3?(p_ix9yftJ@{U)K*L%4X^za&du|xz{0E8gM}Pkj6j|0xJ^Q
z1UM~&UnK-Jgw60>2caIqOTfQQ9&<7~>A6y{_$!L}I<7HkU|u3DRNXd%hp&5(3ts(U
zcQK$_0y>p&TOuq;BQd4UGg*Fa%Jun+Uhdl43w)*POK>dfS7{8D*JkQ=;IiF=q}2&7
zBYjL-%hVW}ui7s5x4Mw?Qwl!q=UM7nP3CBoX0i6X!S+MH^AH=v-`ODAKBrx66mHwX
zU&W8KD@<$8(riqorWo;CtU$KTtSL?~>+u`Xm*(_zRa+M