Skip to content

Commit c972d86

Browse files
committed
Update to sdk 2.2
Initial commit for #2225 . Replay patches from Espressif's repository at https://github.com/espressif/ESP8266_NONOS_SDK between tags v2.1.0 and v2.2.0: 0001-sync-from-ccca00f2.patch Superseded by existing changes, but lines reordered in app/driver/key.c to minimize divergences. 0002-sync-from-3f38ad5a.patch Upstream files only 0003-Update-links.patch Not meaningful to NodeMCU 0004-sync-from-01990ad0.patch 0005-sync-from-cdf6877d.patch Upstream files only 0006-sync-from-f29e744c.patch Upstream files only, user_interface.h override non-conflicting 0009-feat-lwip-Move-lwip-source-code-to-third_party-folde.patch Merged change to lwip/app/espconn_udp.c; rest is just moves or appears to not apply. 0010-feat-mbedtls-Add-mbedtls-source-code-in-third_party-.patch Does not apply; we use our own mbedtls 0011-added-C-support.patch Merged to Makefile 0012-feat-mbedtls-Rebuild-libmbedtls.patch Already applied 0013-fix-at-Fix-some-bugs-of-AT.patch Upstream files only 0014-feat-err_t-Redefine-err_t-to-s32_t.patch Merged to app/include/arch/cc.h and ./app/include/lwip/app/espconn.h; the rest is upstream files. 0015-fix-wpa-Fix-wpa-wpa2-ptk-gtk-reinstallation-vulnerab.patch 0016-fix-wifi-Remove-group-key-entry-before-connecting-to.patch 0017-feat-lib-Remove-time-function-in-libmain.patch Upstream files only 0018-feat-espconn-Modification-for-espconn.patch Merged to app/include/lwip/app/espconn.h, app/include/lwip/app/espconn_tcp.h, app/lwip/app/espconn.c, app/lwip/app/espconn_tcp.c 0019-feat-at-Use-new-espconn_recv-to-fix-tcp-server-issue.patch 0020-feat-examples-Update-mqtt-demo-and-auto-bin-generate.patch Upstream files only 0021-wifi-Add-scan-threshold-and-dwell-time.patch 0022-feat-wifi-Add-country-code-API.patch 0023-feat-wifi-Record-more-information-of-scanned-ap.patch Upstream files only, user_interface.h override non-conflicting 0024-fix-example-Fix-IoT_Demo-user-sector-error.patch Upstream files only 0025-fix-lwip-Fix-sequence-number-error-of-RST-ACK.patch Merged app/lwip/core/tcp_in.c 0026-fix-mbedtls-Fix-memory-leak.patch Merged app/mbedtls/app/lwIPSocket.c 0027-fix-mbedtls-Fix-call-send-callback-function-failed.patch Merged app/mbedtls/app/espconn_mbedtls.c 0028-feat-Add-USE_OPTIMIZE_PRINTF-in-third_party-Makefile.patch Merged app/Makefile 0029-fix-api-Fix-ets_delay_us-declaration.patch Upstream files only, osapi.h override non-conflicting 0030-fix-wifi-Remove-max_tx_power-in-wifi_country_t-in-li.patch 0031-fix-wifi-Fix-softAP-wrong-behavior-after-call-system.patch 0032-fix-wifi-bugfix-of-scan-fail-after-connected-if-max-.patch 0033-feat-at-Enable-scan-time-scan-type-and-add-scan-resu.patch 0034-feat-at-Add-command-AT-CWCOUNTRY.patch 0035-fix-at-Fix-that-AT-CIPSTART-causes-busy-if-the-serve.patch Upstream files only 0036-feat-mbedtls-Speed-up-mbedtls-handshake-process.patch Merged app/mbedtls/app/espconn_mbedtls.c 0037-fix-api-Fix-os_calloc-declaration.patch Merged app/include/lwip/mem.h; sdk-overrides/include/mem.h non-conflicting. 0038-fix-mbedtls-Fix-disconnect-callback-function-never-b.patch Merged app/mbedtls/app/espconn_mbedtls.c; minor revision to logic in 6576af9. Whitespace fixes. 0039-feat-at-Add-country-code-start-channel-in-AT-CWCOUNT.patch 0040-fix-net80211-Fix-Null-pointer-in-ieee80211_rfid_locp.patch Upstream files only 0041-feat-wifi-Add-new-esp_init_data_default-v08-bin.patch Upstream files only, but impacts Makefile 0042-fix-mbedtls-Fix-load-cert-fail-when-the-private-key-.patch Merged app/mbedtls/app/espconn_mbedtls.c 0043-fix-wifi-The-start-channel-can-be-any-valid-channel.patch 0044-fix-wifi-Fix-scan-do-not-start-after-connect.patch 0045-feat-wifi-Add-keep-connection-for-station-to-keep-co.patch 0046-feat-at-Update-AT-version-to-1.6.0.0.patch 0047-fix-at-Fix-GSLP-too-long-time.patch 0048-fix-at-Fix-the-message-is-incorrect-when-creating-UD.patch 0049-feat-at-Add-AT-CIPSERVERMAXCONN.patch Upstream files only 0050-feat-system-Add-softap-distributes-station-ip-event.patch Upstream files only, user_interface.h override non-conflicting 0051-feat-example-Use-libmbedtls.a-instead-of-libssl.a-in.patch Upstream files only 0052-feat-mesh-Remove-mesh-support.patch Upstream files only, but go ahead and remove comment from ld/nodemcu.ld. 0053-fix-example-Fix-forget-to-add-integer-parameter-when.patch Upstream files only 0054-fix-mbedtls-Fix-reconnect_callback-is-not-triggered-.patch Merged app/mbedtls/app/espconn_mbedtls.c 0055-feat-at-Add-AT-SYSMSG-to-enable-some-report-informat.patch 0056-fix-at-Fix-the-incorrect-link-id-when-client-connect.patch 0057-fix-at-Fix-the-bug-that-it-should-be-error-when-the-.patch 0058-fix-smartconfig-Fix-the-smartconfig-scan-time-issue.patch 0059-fix-lwip-Fix-the-bug-of-lwip-output.patch Upstream files only 0060-fix-lwip-Fix-the-length-of-TCP-data-in-one-packet-is.patch 0061-fix-lwip-Fix-send-TCP-data-with-two-or-more-pbuf.patch Merged app/lwip/core/tcp_out.c 0062-fix-wifi-Fix-assert-happen-when-smartconfig-start-th.patch Upstream files only 0063-fix-mbedtls-Fix-memory-leak-when-ESP8266-as-SSL-TLS-.patch Merged app/mbedtls/app/espconn_mbedtls.c 0064-fix-mbedtls-Fix-already-freed-and-exception-bug-when.patch Merged app/mbedtls/app/lwIPSocket.c 0065-fix-at-Fix-bug-that-there-is-no-result-when-sending-.patch 0066-feat-example-Add-AT-bin-version.patch 0067-feat-version-Update-version-to-2.2.0-and-add-version.patch 0068-feat-bin-Update-AT-bin-for-SDK-2.2.0.patch Upstream files only Apply local changes to build: app/include/lwip/app/espconn.h pulls changes (and license decl) from upstream SDK. Makefile is altered to use this file ahead of the SDK's. Remove lwip's sntp support, since it was never really wired in anyway. See #2042 for more information. Patch Makefile to strip time.o, the consumer of lwip's sntp functionality, from libmain.a, resulting in much easier-to-understand error messages. This has consequences for mbedtls. The simplest thing to do, which is, impressively, not a change in behavior, is to completely disable TLS certificate time validation; a later patch can optionally couple this to RTCTIME support. Similarly, it happens that the sqlite3 import was calling time(), but this was not going to work out well for it. Just stub it out to always return unix timestamp 0, as would have happened anyway. Changes unprocessed: 0007-sync-from-080c37e1.patch 0008-feat-lib-Compile-some-libraries-with-ffunction-secti.patch These two make changes to the linker script; perhaps they are worth porting over, but I have not done so here. This is build-tested (ADC, BIT, COLOR_UTILS, CRON, CRYPTO, DHT, ENCODER, FILE, GPIO, HTTP, I2C, MQTT, NET, NODE, OW, PCM, PERF, PWM, RTCFIFO, RTCMEM, RTCTIME, SNTP, SPI, SQLITE3, STRUCT, TLS, TMR, UART, WIFI, WS2812, WS2812_EFFECTS) and boots, but only limited run-time testing has been performed. Testing done does, however, include having made a few TLS connections through the HTTP module, so things are not hopelessly broken, at the very least.
1 parent 4367e6e commit c972d86

File tree

23 files changed

+407
-1343
lines changed

23 files changed

+407
-1343
lines changed

Makefile

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.NOTPARALLEL:
44

55
# SDK version NodeMCU is locked to
6-
SDK_VER:=2.1.0
6+
SDK_VER:=2.2.0
77

88
# no patch: SDK_BASE_VER equals SDK_VER and sdk dir depends on sdk_extracted
99
SDK_BASE_VER:=$(SDK_VER)
@@ -13,13 +13,13 @@ SDK_DIR_DEPENDS:=sdk_extracted
1313
#SDK_DIR_DEPENDS:=sdk_patched
1414

1515
SDK_FILE_VER:=$(SDK_BASE_VER)
16-
SDK_FILE_SHA1:=66a4272894dc1bcec19f5f8bf79fee80f60a021b
16+
SDK_FILE_SHA1:=8b63f1066d3560ff77f119e8ba30a9c39e7baaad
1717
#SDK_PATCH_VER:=$(SDK_VER)_patch_20160704
1818
#SDK_PATCH_SHA1:=388d9e91df74e3b49fca126da482cf822cf1ebf1
1919
# Ensure we search "our" SDK before the tool-chain's SDK (if any)
2020
TOP_DIR:=$(abspath $(dir $(lastword $(MAKEFILE_LIST))))
2121
SDK_DIR:=$(TOP_DIR)/sdk/esp_iot_sdk_v$(SDK_VER)
22-
CCFLAGS:= -I$(TOP_DIR)/sdk-overrides/include -I$(SDK_DIR)/include
22+
CCFLAGS:= -I$(TOP_DIR)/sdk-overrides/include -I$(TOP_DIR)/app/include/lwip/app -I$(SDK_DIR)/include
2323
LDFLAGS:= -L$(SDK_DIR)/lib -L$(SDK_DIR)/ld $(LDFLAGS)
2424

2525
ifdef DEBUG
@@ -39,6 +39,7 @@ ifeq ($(OS),Windows_NT)
3939
# It is xcc
4040
AR = xt-ar
4141
CC = xt-xcc
42+
CXX = xt-xcc
4243
NM = xt-nm
4344
CPP = xt-cpp
4445
OBJCOPY = xt-objcopy
@@ -50,6 +51,7 @@ ifeq ($(OS),Windows_NT)
5051
CCFLAGS += -ffunction-sections -fno-jump-tables -fdata-sections
5152
AR = xtensa-lx106-elf-ar
5253
CC = xtensa-lx106-elf-gcc
54+
CXX = xtensa-lx106-elf-g++
5355
NM = xtensa-lx106-elf-nm
5456
CPP = xtensa-lx106-elf-cpp
5557
OBJCOPY = xtensa-lx106-elf-objcopy
@@ -77,6 +79,7 @@ else
7779
CCFLAGS += -ffunction-sections -fno-jump-tables -fdata-sections
7880
AR = xtensa-lx106-elf-ar
7981
CC = $(WRAPCC) xtensa-lx106-elf-gcc
82+
CXX = $(WRAPCC) xtensa-lx106-elf-g++
8083
NM = xtensa-lx106-elf-nm
8184
CPP = $(WRAPCC) xtensa-lx106-elf-gcc -E
8285
OBJCOPY = xtensa-lx106-elf-objcopy
@@ -104,6 +107,7 @@ ESPTOOL ?= ../tools/esptool.py
104107

105108

106109
CSRCS ?= $(wildcard *.c)
110+
CXXSRCS ?= $(wildcard *.cpp)
107111
ASRCs ?= $(wildcard *.s)
108112
ASRCS ?= $(wildcard *.S)
109113
SUBDIRS ?= $(patsubst %/,%,$(dir $(filter-out tools/Makefile,$(wildcard */Makefile))))
@@ -112,10 +116,12 @@ ODIR := .output
112116
OBJODIR := $(ODIR)/$(TARGET)/$(FLAVOR)/obj
113117

114118
OBJS := $(CSRCS:%.c=$(OBJODIR)/%.o) \
119+
$(CXXSRCS:%.cpp=$(OBJODIR)/%.o) \
115120
$(ASRCs:%.s=$(OBJODIR)/%.o) \
116121
$(ASRCS:%.S=$(OBJODIR)/%.o)
117122

118123
DEPS := $(CSRCS:%.c=$(OBJODIR)/%.d) \
124+
$(CXXSCRS:%.cpp=$(OBJODIR)/%.d) \
119125
$(ASRCs:%.s=$(OBJODIR)/%.d) \
120126
$(ASRCS:%.S=$(OBJODIR)/%.d)
121127

@@ -206,9 +212,11 @@ sdk_patched: sdk_extracted $(TOP_DIR)/sdk/.patched-$(SDK_VER)
206212

207213
$(TOP_DIR)/sdk/.extracted-$(SDK_BASE_VER): $(TOP_DIR)/cache/v$(SDK_FILE_VER).zip
208214
mkdir -p "$(dir $@)"
209-
(cd "$(dir $@)" && rm -fr esp_iot_sdk_v$(SDK_VER) ESP8266_NONOS_SDK-$(SDK_VER) && unzip $(TOP_DIR)/cache/v$(SDK_FILE_VER).zip ESP8266_NONOS_SDK-$(SDK_VER)/lib/* ESP8266_NONOS_SDK-$(SDK_VER)/ld/eagle.rom.addr.v6.ld ESP8266_NONOS_SDK-$(SDK_VER)/include/* ESP8266_NONOS_SDK-$(SDK_VER)/bin/esp_init_data_default.bin)
215+
(cd "$(dir $@)" && rm -fr esp_iot_sdk_v$(SDK_VER) ESP8266_NONOS_SDK-$(SDK_VER) && unzip $(TOP_DIR)/cache/v$(SDK_FILE_VER).zip ESP8266_NONOS_SDK-$(SDK_VER)/lib/* ESP8266_NONOS_SDK-$(SDK_VER)/ld/eagle.rom.addr.v6.ld ESP8266_NONOS_SDK-$(SDK_VER)/include/* ESP8266_NONOS_SDK-$(SDK_VER)/bin/esp_init_data_default_v05.bin)
210216
mv $(dir $@)/ESP8266_NONOS_SDK-$(SDK_VER) $(dir $@)/esp_iot_sdk_v$(SDK_VER)
211-
rm -f $(SDK_DIR)/lib/liblwip.a
217+
rm -f $(SDK_DIR)/lib/liblwip.a $(SDK_DIR)/lib/libssl.a $(SDK_DIR)/lib/libmbedtls.a
218+
ar d $(SDK_DIR)/lib/libmain.a time.o
219+
ar d $(SDK_DIR)/lib/libc.a lib_a-time.o
212220
touch $@
213221

214222
$(TOP_DIR)/sdk/.patched-$(SDK_VER): $(TOP_DIR)/cache/esp_iot_sdk_v$(SDK_PATCH_VER).zip
@@ -306,6 +314,17 @@ $(OBJODIR)/%.d: %.c
306314
sed 's,\($*\.o\)[ :]*,$(OBJODIR)/\1 $@ : ,g' < $@.$$$$ > $@; \
307315
rm -f $@.$$$$
308316

317+
$(OBJODIR)/%.o: %.cpp
318+
@mkdir -p $(OBJODIR);
319+
$(CXX) $(if $(findstring $<,$(DSRCS)),$(DFLAGS),$(CFLAGS)) $(COPTS_$(*F)) -o $@ -c $<
320+
321+
$(OBJODIR)/%.d: %.cpp
322+
@mkdir -p $(OBJODIR);
323+
@echo DEPEND: $(CXX) -M $(CFLAGS) $<
324+
@set -e; rm -f $@; \
325+
sed 's,\($*\.o\)[ :]*,$(OBJODIR)/\1 $@ : ,g' < $@.$$$$ > $@; \
326+
rm -f $@.$$$$
327+
309328
$(OBJODIR)/%.o: %.s
310329
@mkdir -p $(OBJODIR);
311330
$(CC) $(CFLAGS) -o $@ -c $<

app/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ CONFIGURATION_DEFINES = -D__ets__ \
166166
-DLWIP_OPEN_SRC \
167167
-DPBUF_RSV_FOR_WLAN \
168168
-DEBUF_LWIP \
169+
-DUSE_OPTIMIZE_PRINTF \
169170
-DMBEDTLS_USER_CONFIG_FILE=\"user_mbedtls.h\" \
170171

171172
DEFINES += \

app/driver/key.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ key_50ms_cb(struct single_key_param *single_key)
132132
LOCAL void
133133
key_intr_handler(void *arg)
134134
{
135-
struct keys_param *keys = arg;
136135
uint8 i;
137136
uint32 gpio_status = GPIO_REG_READ(GPIO_STATUS_ADDRESS);
137+
struct keys_param *keys = arg;
138138

139139
for (i = 0; i < keys->key_num; i++) {
140140
if (gpio_status & BIT(keys->single_key[i]->gpio_id)) {

app/include/arch/cc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ typedef uint32_t mem_ptr_t;
6565
#define U32_F "d"
6666
#define X32_F "x"
6767

68-
68+
#define LWIP_ERR_T s32_t
6969

7070
//#define PACK_STRUCT_FIELD(x) x __attribute__((packed))
7171
#define PACK_STRUCT_FIELD(x) x

app/include/lwip/app/espconn.h

Lines changed: 211 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
1+
/*
2+
* ESPRESSIF MIT License
3+
*
4+
* Copyright (c) 2016 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
5+
*
6+
* Permission is hereby granted for use on ESPRESSIF SYSTEMS ESP8266 only, in which case,
7+
* it is free of charge, to any person obtaining a copy of this software and associated
8+
* documentation files (the "Software"), to deal in the Software without restriction, including
9+
* without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
10+
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished
11+
* to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all copies or
14+
* substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
*
23+
*/
24+
125
#ifndef __ESPCONN_H__
226
#define __ESPCONN_H__
327

28+
#include "lwip/err.h"
429
#include "lwip/dns.h"
530
#include "os_type.h"
631
#include "lwip/app/espconn_buf.h"
@@ -37,8 +62,7 @@ typedef void (* espconn_reconnect_callback)(void *arg, sint8 err);
3762
#define ESPCONN_NODATA -17 /* No data can be read */
3863

3964
#define ESPCONN_HANDSHAKE -28 /* ssl handshake failed */
40-
#define ESPCONN_RESP_TIMEOUT -29 /* ssl handshake no response*/
41-
#define ESPCONN_PROTO_MSG -61 /* ssl application invalid */
65+
#define ESPCONN_SSL_INVALID_DATA -61 /* ssl application invalid */
4266

4367
#define ESPCONN_SSL 0x01
4468
#define ESPCONN_NORM 0x00
@@ -121,6 +145,7 @@ enum espconn_option{
121145
ESPCONN_NODELAY = 0x02,
122146
ESPCONN_COPY = 0x04,
123147
ESPCONN_KEEPALIVE = 0x08,
148+
ESPCONN_MANUALRECV = 0x10,
124149
ESPCONN_END
125150
};
126151

@@ -461,6 +486,17 @@ extern sint8 espconn_regist_sentcb(struct espconn *espconn, espconn_sent_callbac
461486
*******************************************************************************/
462487
extern sint8 espconn_regist_write_finish(struct espconn *espconn, espconn_connect_callback write_finish_fn);
463488

489+
/******************************************************************************
490+
* FunctionName : espconn_send
491+
* Description : sent data for client or server
492+
* Parameters : espconn -- espconn to set for client or server
493+
* psent -- data to send
494+
* length -- length of data to send
495+
* Returns : none
496+
*******************************************************************************/
497+
extern sint8 espconn_send(struct espconn *espconn, uint8 *psent, uint16 length);
498+
499+
464500
/******************************************************************************
465501
* FunctionName : espconn_sent
466502
* Description : sent data for client or server
@@ -573,7 +609,163 @@ extern sint8 espconn_get_keepalive(struct espconn *espconn, uint8 level, void *o
573609
* - ESPCONN_ARG: dns client not initialized or invalid hostname
574610
*******************************************************************************/
575611

576-
extern sint8 espconn_gethostbyname(struct espconn *pespconn, const char *name, ip_addr_t *addr, dns_found_callback found);
612+
extern err_t espconn_gethostbyname(struct espconn *pespconn, const char *name, ip_addr_t *addr, dns_found_callback found);
613+
614+
/******************************************************************************
615+
* FunctionName : espconn_abort
616+
* Description : Forcely abort with host
617+
* Parameters : espconn -- the espconn used to connect with the host
618+
* Returns : result
619+
*******************************************************************************/
620+
621+
extern sint8 espconn_abort(struct espconn *espconn);
622+
623+
/******************************************************************************
624+
* FunctionName : espconn_encry_connect
625+
* Description : The function given as connection
626+
* Parameters : espconn -- the espconn used to connect with the host
627+
* Returns : none
628+
*******************************************************************************/
629+
630+
extern sint8 espconn_secure_connect(struct espconn *espconn);
631+
632+
/******************************************************************************
633+
* FunctionName : espconn_encry_disconnect
634+
* Description : The function given as the disconnection
635+
* Parameters : espconn -- the espconn used to disconnect with the host
636+
* Returns : none
637+
*******************************************************************************/
638+
639+
extern sint8 espconn_secure_disconnect(struct espconn *espconn);
640+
641+
/******************************************************************************
642+
* FunctionName : espconn_secure_send
643+
* Description : sent data for client or server
644+
* Parameters : espconn -- espconn to set for client or server
645+
* psent -- data to send
646+
* length -- length of data to send
647+
* Returns : none
648+
*******************************************************************************/
649+
650+
extern sint8 espconn_secure_send(struct espconn *espconn, uint8 *psent, uint16 length);
651+
652+
/******************************************************************************
653+
* FunctionName : espconn_encry_sent
654+
* Description : sent data for client or server
655+
* Parameters : espconn -- espconn to set for client or server
656+
* psent -- data to send
657+
* length -- length of data to send
658+
* Returns : none
659+
*******************************************************************************/
660+
661+
extern sint8 espconn_secure_sent(struct espconn *espconn, uint8 *psent, uint16 length);
662+
663+
/******************************************************************************
664+
* FunctionName : espconn_secure_set_size
665+
* Description : set the buffer size for client or server
666+
* Parameters : level -- set for client or server
667+
* 1: client,2:server,3:client and server
668+
* size -- buffer size
669+
* Returns : true or false
670+
*******************************************************************************/
671+
672+
extern bool espconn_secure_set_size(uint8 level, uint16 size);
673+
674+
/******************************************************************************
675+
* FunctionName : espconn_secure_get_size
676+
* Description : get buffer size for client or server
677+
* Parameters : level -- set for client or server
678+
* 1: client,2:server,3:client and server
679+
* Returns : buffer size for client or server
680+
*******************************************************************************/
681+
682+
extern sint16 espconn_secure_get_size(uint8 level);
683+
684+
/******************************************************************************
685+
* FunctionName : espconn_secure_ca_enable
686+
* Description : enable the certificate authenticate and set the flash sector
687+
* as client or server
688+
* Parameters : level -- set for client or server
689+
* 1: client,2:server,3:client and server
690+
* flash_sector -- flash sector for save certificate
691+
* Returns : result true or false
692+
*******************************************************************************/
693+
694+
extern bool espconn_secure_ca_enable(uint8 level, uint32 flash_sector );
695+
696+
/******************************************************************************
697+
* FunctionName : espconn_secure_ca_disable
698+
* Description : disable the certificate authenticate as client or server
699+
* Parameters : level -- set for client or server
700+
* 1: client,2:server,3:client and server
701+
* Returns : result true or false
702+
*******************************************************************************/
703+
704+
extern bool espconn_secure_ca_disable(uint8 level);
705+
706+
707+
/******************************************************************************
708+
* FunctionName : espconn_secure_cert_req_enable
709+
* Description : enable the client certificate authenticate and set the flash sector
710+
* as client or server
711+
* Parameters : level -- set for client or server
712+
* 1: client,2:server,3:client and server
713+
* flash_sector -- flash sector for save certificate
714+
* Returns : result true or false
715+
*******************************************************************************/
716+
717+
extern bool espconn_secure_cert_req_enable(uint8 level, uint32 flash_sector );
718+
719+
/******************************************************************************
720+
* FunctionName : espconn_secure_ca_disable
721+
* Description : disable the client certificate authenticate as client or server
722+
* Parameters : level -- set for client or server
723+
* 1: client,2:server,3:client and server
724+
* Returns : result true or false
725+
*******************************************************************************/
726+
727+
extern bool espconn_secure_cert_req_disable(uint8 level);
728+
729+
/******************************************************************************
730+
* FunctionName : espconn_secure_set_default_certificate
731+
* Description : Load the certificates in memory depending on compile-time
732+
* and user options.
733+
* Parameters : certificate -- Load the certificate
734+
* length -- Load the certificate length
735+
* Returns : result true or false
736+
*******************************************************************************/
737+
738+
extern bool espconn_secure_set_default_certificate(const uint8* certificate, uint16 length);
739+
740+
/******************************************************************************
741+
* FunctionName : espconn_secure_set_default_private_key
742+
* Description : Load the key in memory depending on compile-time
743+
* and user options.
744+
* Parameters : private_key -- Load the key
745+
* length -- Load the key length
746+
* Returns : result true or false
747+
*******************************************************************************/
748+
749+
extern bool espconn_secure_set_default_private_key(const uint8* private_key, uint16 length);
750+
751+
/******************************************************************************
752+
* FunctionName : espconn_secure_accept
753+
* Description : The function given as the listen
754+
* Parameters : espconn -- the espconn used to listen the connection
755+
* Returns : result
756+
*******************************************************************************/
757+
758+
extern sint8 espconn_secure_accept(struct espconn *espconn);
759+
760+
/******************************************************************************
761+
* FunctionName : espconn_secure_accepts
762+
* Description : delete the secure server host
763+
* Parameters : espconn -- the espconn used to listen the connection
764+
* Returns : result
765+
*******************************************************************************/
766+
767+
extern sint8 espconn_secure_delete(struct espconn *espconn);
768+
577769

578770
/******************************************************************************
579771
* FunctionName : espconn_igmp_join
@@ -593,6 +785,22 @@ extern sint8 espconn_igmp_join(ip_addr_t *host_ip, ip_addr_t *multicast_ip);
593785
*******************************************************************************/
594786
extern sint8 espconn_igmp_leave(ip_addr_t *host_ip, ip_addr_t *multicast_ip);
595787

788+
/******************************************************************************
789+
* FunctionName : espconn_recv_hold
790+
* Description : hold tcp receive
791+
* Parameters : espconn -- espconn to hold
792+
* Returns : none
793+
*******************************************************************************/
794+
extern sint8 espconn_recv_hold(struct espconn *pespconn);
795+
796+
/******************************************************************************
797+
* FunctionName : espconn_recv_unhold
798+
* Description : unhold tcp receive
799+
* Parameters : espconn -- espconn to unhold
800+
* Returns : none
801+
*******************************************************************************/
802+
extern sint8 espconn_recv_unhold(struct espconn *pespconn);
803+
596804
/******************************************************************************
597805
* FunctionName : espconn_mdns_init
598806
* Description : register a device with mdns

app/include/lwip/app/espconn_tcp.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
#define espconn_keepalive_enable(pcb) ((pcb)->so_options |= SOF_KEEPALIVE)
1414
#define espconn_keepalive_disable(pcb) ((pcb)->so_options &= ~SOF_KEEPALIVE)
1515

16+
#define espconn_manual_recv_disabled(espconn) (((espconn)->pcommon.espconn_opt & ESPCONN_MANUALRECV) != 0)
17+
#define espconn_manual_recv_enabled(espconn) (((espconn)->pcommon.espconn_opt & ESPCONN_MANUALRECV) == 0)
18+
1619
/******************************************************************************
1720
* FunctionName : espconn_kill_oldest_pcb
1821
* Description : A oldest incoming connection has been killed.

0 commit comments

Comments
 (0)