Skip to content

Commit eb2bbfa

Browse files
committed
Merge pull request #113 from Links2004/esp8266
update the SDK to 1.0.1_15_04_24, and some more
2 parents 86bf010 + 951ab8e commit eb2bbfa

File tree

15 files changed

+277
-10
lines changed

15 files changed

+277
-10
lines changed

hardware/esp8266com/esp8266/cores/esp8266/Arduino.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ extern "C" {
3333
#include <string.h>
3434
#include <math.h>
3535

36+
#include "stdlib_noniso.h"
3637
#include "binary.h"
3738
#include "pgmspace.h"
3839

39-
40-
4140
void yield(void);
4241

4342
#define HIGH 0x1

hardware/esp8266com/esp8266/cores/esp8266/HardwareSerial.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ UARTnr_t uart_get_debug();
101101
// ####################################################################################################
102102
// ####################################################################################################
103103

104-
void ICACHE_FLASH_ATTR uart_interrupt_handler(uart_t* uart) {
104+
void uart_interrupt_handler(uart_t* uart) {
105105

106106
// -------------- UART 0 --------------
107107
uint32_t status = READ_PERI_REG(UART_INT_ST(0));

hardware/tools/esp8266/sdk/changelog.txt

+60
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,63 @@
1+
esp_iot_sdk_v1.0.1_15_04_24 Release Note
2+
-------------------------------------------
3+
4+
Resolved Issues(Bugs below are eligible for Bug Bounty Program):
5+
1. SSL connection may fail if SSL packet size larger than 2kBytes [PeteW ]
6+
2. UDP remote IP to be 0.0.0.0 may cause reset [Jerry S]
7+
3. Optimize wifi_get_ip_info to fix loss of wireless connectivity problem
8+
4. Air-Kiss restart [Orgmar]
9+
10+
Optimization:
11+
1. Optimized IOT_Espressif_EspTouch.APK (apply for access from Espressif) for improved compatibility. [???]
12+
2. TCP server can not open again immediately with the same port [624908539]
13+
3. Update UART driver for parity bit value may be incorrect [1062583993]
14+
4. Add define of �ICACHE_RODATA_ATTR� for Symbol 'ICACHE_RODATA_ATTR' could not be resolved. [???]
15+
5. Add API wifi_softap_dhcps_set_offer_option to enable/disable ESP8266 softAP DHCP server default gateway. [xyz769]
16+
6. AT register_uart_rx_intr may enter callback twice. [???]
17+
7.optimize document that WPA password length range : 8 ~ 64 bytes [785057041]
18+
8. ESP8266 softAP DHCP server record 8 DHCP client's IP at most [ygjeon]
19+
9. To set static IP (wifi_set_ip_info) has to disable DHCP first(wifi_softap_dhcps_stop or wifi_station_dhcpc_stop)
20+
10.Add example of wifi_softap_set_dhcps_lease
21+
11. smartconfig_start can only be called in ESP8266 station mode
22+
23+
Added APIs:
24+
1. Wi-Fi related APIs:
25+
wifi_station_set_reconnect_policy: enable/disable reconnect when ESP8266 disconnect from router,default to be enable reconnect.
26+
wifi_set_event_handler_cb: set event handler of ESP8266 softAP or station status change.
27+
wifi_softap_dhcps_set_offer_option: enable/disable get router information from ESP8266 softAP, default to be enable.
28+
2. SNTP APIs:
29+
sntp_get_current_timestamp: get current timestamp from Jan 01, 1970, 00:00 (GMT)
30+
sntp_get_real_time: char,get real time (GTM + 8 time zone)
31+
sntp_init: initialize SNTP
32+
sntp_stop: stop SNTP
33+
sntp_setserver: set SNTP server by IP
34+
sntp_getserver: get SNTP server IP
35+
sntp_setservername: set SNTP server by domain name
36+
sntp_getservername: get domain name of SNTP server set by sntp_setservername
37+
3. MDNS APIs:
38+
espconn_mdns_init: initialize mDNS
39+
espconn_mdns_close: close mDNS
40+
espconn_mdns_server_register: register mDNS server
41+
espconn_mdns_server_unregister: unregister mDNS server
42+
espconn_mdns_get_servername: get mDNS server name
43+
espconn_mdns_set_servername: set mDNS server name
44+
espconn_mdns_set_hostname: get mDNS host name
45+
espconn_mdns_get_hostname: set mDNS host name
46+
espconn_mdns_disable: disable mDNS
47+
espconn_mdns_enable: endisable mDNS
48+
49+
AT_v0.23 Release Note:
50+
Optimized:
51+
1.AT+CWJAP add parameter "bssid", for several APs may have the same SSID
52+
53+
New AT commands:
54+
1. AT+CIPSENDBUF: write data into TCP-send-buffer; non-blocking. Background task automatically handles transmission. Has much higher throughput.
55+
2. AT+CIPBUFRESET: resets segment count in TCP-send-buffer
56+
3. AT+CIPBUFSTATUS: checks status of TCP-send-buffer
57+
4. AT+CIPCHECKSEGID: checks if a specific segment in TCP-send-buffer has sent successfully
58+
59+
60+
161
esp_iot_sdk_v1.0.1_b2_15_04_10 release note
262
-------------------------------------------
363

hardware/tools/esp8266/sdk/include/espconn.h

+107
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,23 @@ enum {
111111
ESPCONN_MAX
112112
};
113113

114+
struct espconn_packet{
115+
uint16 sent_length; /* sent length successful*/
116+
uint16 snd_buf_size; /* Available buffer size for sending */
117+
uint16 snd_queuelen; /* Available buffer space for sending */
118+
uint16 total_queuelen; /* total Available buffer space for sending */
119+
uint32 packseqno; /* seqno to be sent */
120+
uint32 packseq_nxt; /* seqno expected */
121+
uint32 packnum;
122+
};
123+
124+
struct mdns_info {
125+
char *host_name;
126+
char *server_name;
127+
uint16 server_port;
128+
unsigned long ipAddr;
129+
char *txt_data;
130+
};
114131
/******************************************************************************
115132
* FunctionName : espconn_connect
116133
* Description : The function given as the connect
@@ -213,6 +230,16 @@ sint8 espconn_regist_time(struct espconn *espconn, uint32 interval, uint8 type_f
213230

214231
sint8 espconn_get_connection_info(struct espconn *pespconn, remot_info **pcon_info, uint8 typeflags);
215232

233+
/******************************************************************************
234+
* FunctionName : espconn_get_packet_info
235+
* Description : get the packet info with host
236+
* Parameters : espconn -- the espconn used to disconnect the connection
237+
* infoarg -- the packet info
238+
* Returns : the errur code
239+
*******************************************************************************/
240+
241+
sint8 espconn_get_packet_info(struct espconn *espconn, struct espconn_packet* infoarg);
242+
216243
/******************************************************************************
217244
* FunctionName : espconn_regist_sentcb
218245
* Description : Used to specify the function that should be called when data
@@ -471,5 +498,85 @@ sint8 espconn_recv_hold(struct espconn *pespconn);
471498
*******************************************************************************/
472499
sint8 espconn_recv_unhold(struct espconn *pespconn);
473500

501+
/******************************************************************************
502+
* FunctionName : espconn_mdns_init
503+
* Description : register a device with mdns
504+
* Parameters : ipAddr -- the ip address of device
505+
* hostname -- the hostname of device
506+
* Returns : none
507+
*******************************************************************************/
508+
509+
void espconn_mdns_init(struct mdns_info *info);
510+
/******************************************************************************
511+
* FunctionName : espconn_mdns_close
512+
* Description : close a device with mdns
513+
* Parameters : a
514+
* Returns : none
515+
*******************************************************************************/
516+
517+
void espconn_mdns_close(void);
518+
/******************************************************************************
519+
* FunctionName : espconn_mdns_server_register
520+
* Description : register a device with mdns
521+
* Parameters : a
522+
* Returns : none
523+
*******************************************************************************/
524+
void espconn_mdns_server_register(void);
525+
526+
/******************************************************************************
527+
* FunctionName : espconn_mdns_server_unregister
528+
* Description : unregister a device with mdns
529+
* Parameters : a
530+
* Returns : none
531+
*******************************************************************************/
532+
void espconn_mdns_server_unregister(void);
533+
534+
/******************************************************************************
535+
* FunctionName : espconn_mdns_get_servername
536+
* Description : get server name of device with mdns
537+
* Parameters : a
538+
* Returns : none
539+
*******************************************************************************/
540+
541+
char* espconn_mdns_get_servername(void);
542+
/******************************************************************************
543+
* FunctionName : espconn_mdns_set_servername
544+
* Description : set server name of device with mdns
545+
* Parameters : a
546+
* Returns : none
547+
*******************************************************************************/
548+
void espconn_mdns_set_servername(const char *name);
549+
550+
/******************************************************************************
551+
* FunctionName : espconn_mdns_set_hostname
552+
* Description : set host name of device with mdns
553+
* Parameters : a
554+
* Returns : none
555+
*******************************************************************************/
556+
void espconn_mdns_set_hostname(char *name);
557+
558+
/******************************************************************************
559+
* FunctionName : espconn_mdns_get_hostname
560+
* Description : get host name of device with mdns
561+
* Parameters : a
562+
* Returns : none
563+
*******************************************************************************/
564+
char* espconn_mdns_get_hostname(void);
565+
566+
/******************************************************************************
567+
* FunctionName : espconn_mdns_disable
568+
* Description : disable a device with mdns
569+
* Parameters : a
570+
* Returns : none
571+
*******************************************************************************/
572+
void espconn_mdns_disable(void);
573+
574+
/******************************************************************************
575+
* FunctionName : espconn_mdns_enable
576+
* Description : disable a device with mdns
577+
* Parameters : a
578+
* Returns : none
579+
*******************************************************************************/
580+
void espconn_mdns_enable(void);
474581
#endif
475582

hardware/tools/esp8266/sdk/include/user_interface.h

+103-2
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ bool wifi_station_scan(struct scan_config *config, scan_done_cb_t cb);
181181
uint8 wifi_station_get_auto_connect(void);
182182
bool wifi_station_set_auto_connect(uint8 set);
183183

184+
bool wifi_station_set_reconnect_policy(bool set);
185+
184186
enum {
185187
STATION_IDLE = 0,
186188
STATION_CONNECTING,
@@ -229,8 +231,14 @@ struct station_info {
229231
};
230232

231233
struct dhcps_lease {
232-
uint32 start_ip;
233-
uint32 end_ip;
234+
struct ip_addr start_ip;
235+
struct ip_addr end_ip;
236+
};
237+
238+
enum dhcps_offer_option{
239+
OFFER_START = 0x00,
240+
OFFER_ROUTER = 0x01,
241+
OFFER_END
234242
};
235243

236244
struct station_info * wifi_softap_get_station_info(void);
@@ -241,6 +249,7 @@ bool wifi_softap_dhcps_start(void);
241249
bool wifi_softap_dhcps_stop(void);
242250
bool wifi_softap_set_dhcps_lease(struct dhcps_lease *please);
243251
enum dhcp_status wifi_softap_dhcps_status(void);
252+
bool wifi_softap_dhcps_set_offer_option(uint8 level, void* optarg);
244253

245254
#define STATION_IF 0x00
246255
#define SOFTAP_IF 0x01
@@ -286,4 +295,96 @@ enum sleep_type {
286295
bool wifi_set_sleep_type(enum sleep_type type);
287296
enum sleep_type wifi_get_sleep_type(void);
288297

298+
enum {
299+
EVENT_STAMODE_CONNECTED = 0,
300+
EVENT_STAMODE_DISCONNECTED,
301+
EVENT_STAMODE_AUTHMODE_CHANGE,
302+
EVENT_STAMODE_GOT_IP,
303+
EVENT_SOFTAPMODE_STACONNECTED,
304+
EVENT_SOFTAPMODE_STADISCONNECTED,
305+
EVENT_MAX
306+
};
307+
308+
enum {
309+
REASON_UNSPECIFIED = 1,
310+
REASON_AUTH_EXPIRE = 2,
311+
REASON_AUTH_LEAVE = 3,
312+
REASON_ASSOC_EXPIRE = 4,
313+
REASON_ASSOC_TOOMANY = 5,
314+
REASON_NOT_AUTHED = 6,
315+
REASON_NOT_ASSOCED = 7,
316+
REASON_ASSOC_LEAVE = 8,
317+
REASON_ASSOC_NOT_AUTHED = 9,
318+
REASON_DISASSOC_PWRCAP_BAD = 10, /* 11h */
319+
REASON_DISASSOC_SUPCHAN_BAD = 11, /* 11h */
320+
REASON_IE_INVALID = 13, /* 11i */
321+
REASON_MIC_FAILURE = 14, /* 11i */
322+
REASON_4WAY_HANDSHAKE_TIMEOUT = 15, /* 11i */
323+
REASON_GROUP_KEY_UPDATE_TIMEOUT = 16, /* 11i */
324+
REASON_IE_IN_4WAY_DIFFERS = 17, /* 11i */
325+
REASON_GROUP_CIPHER_INVALID = 18, /* 11i */
326+
REASON_PAIRWISE_CIPHER_INVALID = 19, /* 11i */
327+
REASON_AKMP_INVALID = 20, /* 11i */
328+
REASON_UNSUPP_RSN_IE_VERSION = 21, /* 11i */
329+
REASON_INVALID_RSN_IE_CAP = 22, /* 11i */
330+
REASON_802_1X_AUTH_FAILED = 23, /* 11i */
331+
REASON_CIPHER_SUITE_REJECTED = 24, /* 11i */
332+
333+
REASON_BEACON_TIMEOUT = 200,
334+
REASON_NO_AP_FOUND = 201,
335+
};
336+
337+
typedef struct {
338+
uint8 ssid[32];
339+
uint8 ssid_len;
340+
uint8 bssid[6];
341+
uint8 channel;
342+
} Event_StaMode_Connected_t;
343+
344+
typedef struct {
345+
uint8 ssid[32];
346+
uint8 ssid_len;
347+
uint8 bssid[6];
348+
uint8 reason;
349+
} Event_StaMode_Disconnected_t;
350+
351+
typedef struct {
352+
uint8 old_mode;
353+
uint8 new_mode;
354+
} Event_StaMode_AuthMode_Change_t;
355+
356+
typedef struct {
357+
struct ip_addr ip;
358+
struct ip_addr mask;
359+
struct ip_addr gw;
360+
} Event_StaMode_Got_IP_t;
361+
362+
typedef struct {
363+
uint8 mac[6];
364+
uint8 aid;
365+
} Event_SoftAPMode_StaConnected_t;
366+
367+
typedef struct {
368+
uint8 mac[6];
369+
uint8 aid;
370+
} Event_SoftAPMode_StaDisconnected_t;
371+
372+
typedef union {
373+
Event_StaMode_Connected_t connected;
374+
Event_StaMode_Disconnected_t disconnected;
375+
Event_StaMode_AuthMode_Change_t auth_change;
376+
Event_StaMode_Got_IP_t got_ip;
377+
Event_SoftAPMode_StaConnected_t sta_connected;
378+
Event_SoftAPMode_StaDisconnected_t sta_disconnected;
379+
} Event_Info_u;
380+
381+
typedef struct _esp_event {
382+
uint32 event;
383+
Event_Info_u event_info;
384+
} System_Event_t;
385+
386+
typedef void (* wifi_event_handler_cb_t)(System_Event_t *event);
387+
388+
void wifi_set_event_handler_cb(wifi_event_handler_cb_t cb);
389+
289390
#endif

hardware/tools/esp8266/sdk/ld/eagle.app.v6.ld

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
/* Linker Script for ld -N */
33
MEMORY
44
{
5-
dport0_0_seg : org = 0x3FF00000, len = 0x10
6-
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
7-
iram1_0_seg : org = 0x40100000, len = 0x8000
8-
irom0_0_seg : org = 0x40240000, len = 0x32000
5+
dport0_0_seg : org = 0x3FF00000, len = 0x10
6+
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
7+
iram1_0_seg : org = 0x40100000, len = 0x8000
8+
irom0_0_seg : org = 0x40240000, len = 0x3C000
99
}
1010

1111
PHDRS
39.3 KB
Binary file not shown.
1.82 KB
Binary file not shown.
2.59 KB
Binary file not shown.
446 Bytes
Binary file not shown.
1.2 KB
Binary file not shown.
2.75 KB
Binary file not shown.
-175 KB
Binary file not shown.
1.45 KB
Binary file not shown.

hardware/tools/esp8266/sdk/version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.1_b2_15_04_10
1+
1.0.1_15_04_24

0 commit comments

Comments
 (0)