Merge branch 'wifi' of ssh://gitlab.espressif.cn:27227/idf/esp-idf into wifi

This commit is contained in:
xiaxiaotian 2016-08-30 18:10:30 +08:00
commit 8fe9347de2
6 changed files with 11 additions and 4 deletions

View File

@ -64,7 +64,7 @@ static system_event_handle_t g_system_event_handle_table[] = {
{SYSTEM_EVENT_STA_CONNECTED, system_event_sta_connected_handle_default},
{SYSTEM_EVENT_STA_DISCONNECTED, system_event_sta_disconnected_handle_default},
{SYSTEM_EVENT_STA_AUTHMODE_CHANGE, NULL},
{SYSTEM_EVENT_STA_GOTIP, NULL},
{SYSTEM_EVENT_STA_GOTIP, system_event_sta_gotip_default},
{SYSTEM_EVENT_AP_START, system_event_ap_start_handle_default},
{SYSTEM_EVENT_AP_STOP, system_event_ap_stop_handle_default},
{SYSTEM_EVENT_AP_STACONNECTED, NULL},

View File

@ -240,6 +240,10 @@ typedef esp_err_t (*wifi_rxcb_t)(void *buffer, uint16_t len, void* eb);
esp_err_t esp_wifi_reg_rxcb(wifi_interface_t ifx, wifi_rxcb_t fn);
esp_err_t esp_wifi_set_auto_connect(bool en);
esp_err_t esp_wifi_get_auto_connect(bool *en);
#ifdef __cplusplus
}
#endif

View File

@ -69,12 +69,14 @@ static void esp_wifi_task(void *pvParameters)
#if CONFIG_WIFI_AUTO_CONNECT
wifi_mode_t mode;
bool auto_connect;
err = esp_wifi_get_mode(&mode);
if (err != ESP_OK){
WIFI_DEBUG("esp_wifi_get_mode fail, ret=%d\n", err);
}
if (mode == WIFI_MODE_STA || mode == WIFI_MODE_APSTA) {
err = esp_wifi_get_auto_connect(&auto_connect);
if ((mode == WIFI_MODE_STA || mode == WIFI_MODE_APSTA) && auto_connect) {
err = esp_wifi_connect();
if (err != ESP_OK) {
WIFI_DEBUG("esp_wifi_connect fail, ret=%d\n", err);

View File

@ -62,7 +62,7 @@ static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__;
/* global variables */
#ifdef PERF
uint32 g_rx_post_mbox_fail_cnt = 0;
uint32_t g_rx_post_mbox_fail_cnt = 0;
#endif
static tcpip_init_done_fn tcpip_init_done;
static void *tcpip_init_done_arg;

View File

@ -221,6 +221,7 @@ extern unsigned long os_random(void);
* TCP_WND: The size of a TCP window. This must be at least
* (2 * TCP_MSS) for things to work well
*/
#define PERF 1
#ifdef PERF
extern unsigned char misc_prof_get_tcpw(void);
extern unsigned char misc_prof_get_tcp_snd_buf(void);

View File

@ -66,7 +66,7 @@ static char hostname[16];
static char hostname[16];
#endif
#ifdef PERF
uint32 g_rx_alloc_pbuf_fail_cnt = 0;
uint32_t g_rx_alloc_pbuf_fail_cnt = 0;
#endif
/**