ESP8266_RTOS_SDK v1.4.0

- Main Page
- Modules
- Data Structures
- Files

- File List

esp_wifi.h
1 /*
2 * ESPRSSIF MIT License
3 *
4 * Copyright (c) 2015 <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
25 #ifndef __ESP_WIFI_H__
26 #define __ESP_WIFI_H__
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
51 typedef enum {
52 NULL_MODE = 0,
53 STATION_MODE,
54 SOFTAP_MODE,
55 STATIONAP_MODE,
56 MAX_MODE
57 } WIFI_MODE;
58
59 typedef enum {
60 AUTH_OPEN = 0,
61 AUTH_WEP,
62 AUTH_WPA_PSK,
63 AUTH_WPA2_PSK,
64 AUTH_WPA_WPA2_PSK,
65 AUTH_MAX
66 } AUTH_MODE;
67
78 WIFI_MODE wifi_get_opmode(void);
79
90 WIFI_MODE wifi_get_opmode_default(void);
91
108 bool wifi_set_opmode(WIFI_MODE opmode);
109
124 bool wifi_set_opmode_current(WIFI_MODE opmode);
125
126 typedef enum {
127 STATION_IF = 0,
128 SOFTAP_IF,
129 MAX_IF
130 } WIFI_INTERFACE;
131
132 struct ip_info {
133 struct ip_addr ip;
134 struct ip_addr netmask;
135 struct ip_addr gw;
136 };
137
150 bool wifi_get_ip_info(WIFI_INTERFACE if_index, struct ip_info *info);
151
169 bool wifi_set_ip_info(WIFI_INTERFACE if_index, struct ip_info *info);
170
181 bool wifi_get_macaddr(WIFI_INTERFACE if_index, uint8 *macaddr);
182
199 bool wifi_set_macaddr(WIFI_INTERFACE if_index, uint8 *macaddr);
200
210 void wifi_status_led_install(uint8 gpio_id, uint32 gpio_name, uint8 gpio_func);
211
219 void wifi_status_led_uninstall(void);
220
221 typedef enum {
222 PHY_MODE_11B = 1,
223 PHY_MODE_11G = 2,
224 PHY_MODE_11N = 3
225 } WIFI_PHY_MODE;
226
234 WIFI_PHY_MODE wifi_get_phy_mode(void);
235
246 bool wifi_set_phy_mode(WIFI_PHY_MODE mode);
247
248 typedef enum {
249 EVENT_STAMODE_SCAN_DONE = 0,
250 EVENT_STAMODE_CONNECTED,
251 EVENT_STAMODE_DISCONNECTED,
252 EVENT_STAMODE_AUTHMODE_CHANGE,
253 EVENT_STAMODE_GOT_IP,
254 EVENT_STAMODE_DHCP_TIMEOUT,
255 EVENT_SOFTAPMODE_STACONNECTED,
256 EVENT_SOFTAPMODE_STADISCONNECTED,
257 EVENT_SOFTAPMODE_PROBEREQRECVED,
258 EVENT_MAX
259 } SYSTEM_EVENT;
260
261 enum {
262 REASON_UNSPECIFIED = 1,
263 REASON_AUTH_EXPIRE = 2,
264 REASON_AUTH_LEAVE = 3,
265 REASON_ASSOC_EXPIRE = 4,
266 REASON_ASSOC_TOOMANY = 5,
267 REASON_NOT_AUTHED = 6,
268 REASON_NOT_ASSOCED = 7,
269 REASON_ASSOC_LEAVE = 8,
270 REASON_ASSOC_NOT_AUTHED = 9,
271 REASON_DISASSOC_PWRCAP_BAD = 10,
272 REASON_DISASSOC_SUPCHAN_BAD = 11,
273 REASON_IE_INVALID = 13,
274 REASON_MIC_FAILURE = 14,
275 REASON_4WAY_HANDSHAKE_TIMEOUT = 15,
276 REASON_GROUP_KEY_UPDATE_TIMEOUT = 16,
277 REASON_IE_IN_4WAY_DIFFERS = 17,
278 REASON_GROUP_CIPHER_INVALID = 18,
279 REASON_PAIRWISE_CIPHER_INVALID = 19,
280 REASON_AKMP_INVALID = 20,
281 REASON_UNSUPP_RSN_IE_VERSION = 21,
282 REASON_INVALID_RSN_IE_CAP = 22,
283 REASON_802_1X_AUTH_FAILED = 23,
284 REASON_CIPHER_SUITE_REJECTED = 24,
285
286 REASON_BEACON_TIMEOUT = 200,
287 REASON_NO_AP_FOUND = 201,
288 REASON_AUTH_FAIL = 202,
289 REASON_ASSOC_FAIL = 203,
290 REASON_HANDSHAKE_TIMEOUT = 204,
291 };
292
293 typedef struct {
294 uint32 status;
295 struct bss_info *bss;
296 } Event_StaMode_ScanDone_t;
297
298 typedef struct {
299 uint8 ssid[32];
300 uint8 ssid_len;
301 uint8 bssid[6];
302 uint8 channel;
303 } Event_StaMode_Connected_t;
304
305 typedef struct {
306 uint8 ssid[32];
307 uint8 ssid_len;
308 uint8 bssid[6];
309 uint8 reason;
310 } Event_StaMode_Disconnected_t;
311
312 typedef struct {
313 uint8 old_mode;
314 uint8 new_mode;
315 } Event_StaMode_AuthMode_Change_t;
316
317 typedef struct {
318 struct ip_addr ip;
319 struct ip_addr mask;
320 struct ip_addr gw;
321 } Event_StaMode_Got_IP_t;
322
323 typedef struct {
324 uint8 mac[6];
325 uint8 aid;
326 } Event_SoftAPMode_StaConnected_t;
327
328 typedef struct {
329 uint8 mac[6];
330 uint8 aid;
331 } Event_SoftAPMode_StaDisconnected_t;
332
333 typedef struct {
334 int rssi;
335 uint8 mac[6];
336 } Event_SoftAPMode_ProbeReqRecved_t;
337
338 typedef union {
339 Event_StaMode_ScanDone_t scan_done;
340 Event_StaMode_Connected_t connected;
341 Event_StaMode_Disconnected_t disconnected;
342 Event_StaMode_AuthMode_Change_t auth_change;
343 Event_StaMode_Got_IP_t got_ip;
344 Event_SoftAPMode_StaConnected_t sta_connected;
345 Event_SoftAPMode_StaDisconnected_t sta_disconnected;
346 Event_SoftAPMode_ProbeReqRecved_t ap_probereqrecved;
347 } Event_Info_u;
348
349 typedef struct _esp_event {
350 SYSTEM_EVENT event_id;
351 Event_Info_u event_info;
352 } System_Event_t;
353
364 typedef void (* wifi_event_handler_cb_t)(System_Event_t *event);
365
374 bool wifi_set_event_handler_cb(wifi_event_handler_cb_t cb);
375
383 typedef void (*freedom_outside_cb_t)(uint8 status);
384
396 sint32 wifi_register_send_pkt_freedom_cb(freedom_outside_cb_t cb);
397
405 void wifi_unregister_send_pkt_freedom_cb(void);
406
429 sint32 wifi_send_pkt_freedom(uint8 *buf, uint16 len, bool sys_seq);
430
439 sint32 wifi_rfid_locp_recv_open(void);
440
448 void wifi_rfid_locp_recv_close(void);
449
459 typedef void (*rfid_locp_cb_t)(uint8 *frm, int len, sint8 rssi);
460
472 sint32 wifi_register_rfid_locp_recv_cb(rfid_locp_cb_t cb);
473
481 void wifi_unregister_rfid_locp_recv_cb(void);
482
483 typedef enum {
484 NONE_SLEEP_T = 0,
485 LIGHT_SLEEP_T,
486 MODEM_SLEEP_T
487 } sleep_type;
488
501 bool wifi_set_sleep_type(sleep_type type);
502
510 sleep_type wifi_get_sleep_type(void);
511
534 void wifi_fpm_open(void);
535
543 void wifi_fpm_close(void);
544
556 void wifi_fpm_do_wakeup(void);
557
558 typedef void (*fpm_wakeup_cb)(void);
559
575 void wifi_fpm_set_wakeup_cb(fpm_wakeup_cb cb);
576
597 sint8 wifi_fpm_do_sleep(uint32 sleep_time_in_us);
598
608 void wifi_fpm_set_sleep_type(sleep_type type);
609
617 sleep_type wifi_fpm_get_sleep_type(void);
618
631 enum FIXED_RATE {
632 PHY_RATE_48 = 0x8,
633 PHY_RATE_24 = 0x9,
634 PHY_RATE_12 = 0xA,
635 PHY_RATE_6 = 0xB,
636 PHY_RATE_54 = 0xC,
637 PHY_RATE_36 = 0xD,
638 PHY_RATE_18 = 0xE,
639 PHY_RATE_9 = 0xF
640 };
641
642 #define FIXED_RATE_MASK_NONE 0x00
643 #define FIXED_RATE_MASK_STA 0x01
644 #define FIXED_RATE_MASK_AP 0x02
645 #define FIXED_RATE_MASK_ALL 0x03
646
666 sint32 wifi_set_user_fixed_rate(uint8 enable_mask, uint8 rate);
667
677 int wifi_get_user_fixed_rate(uint8 *enable_mask, uint8 *rate);
678
679 enum support_rate {
680 RATE_11B5M = 0,
681 RATE_11B11M = 1,
682 RATE_11B1M = 2,
683 RATE_11B2M = 3,
684 RATE_11G6M = 4,
685 RATE_11G12M = 5,
686 RATE_11G24M = 6,
687 RATE_11G48M = 7,
688 RATE_11G54M = 8,
689 RATE_11G9M = 9,
690 RATE_11G18M = 10,
691 RATE_11G36M = 11
692 };
693
711 sint32 wifi_set_user_sup_rate(uint8 min, uint8 max);
712
713 enum RATE_11B_ID {
714 RATE_11B_B11M = 0,
715 RATE_11B_B5M = 1,
716 RATE_11B_B2M = 2,
717 RATE_11B_B1M = 3
718 };
719
720 enum RATE_11G_ID {
721 RATE_11G_G54M = 0,
722 RATE_11G_G48M = 1,
723 RATE_11G_G36M = 2,
724 RATE_11G_G24M = 3,
725 RATE_11G_G18M = 4,
726 RATE_11G_G12M = 5,
727 RATE_11G_G9M = 6,
728 RATE_11G_G6M = 7,
729 RATE_11G_B5M = 8,
730 RATE_11G_B2M = 9,
731 RATE_11G_B1M = 10
732 };
733
734 enum RATE_11N_ID {
735 RATE_11N_MCS7S = 0,
736 RATE_11N_MCS7 = 1,
737 RATE_11N_MCS6 = 2,
738 RATE_11N_MCS5 = 3,
739 RATE_11N_MCS4 = 4,
740 RATE_11N_MCS3 = 5,
741 RATE_11N_MCS2 = 6,
742 RATE_11N_MCS1 = 7,
743 RATE_11N_MCS0 = 8,
744 RATE_11N_B5M = 9,
745 RATE_11N_B2M = 10,
746 RATE_11N_B1M = 11
747 };
748
749 #define RC_LIMIT_11B 0
750 #define RC_LIMIT_11G 1
751 #define RC_LIMIT_11N 2
752 #define RC_LIMIT_P2P_11G 3
753 #define RC_LIMIT_P2P_11N 4
754 #define RC_LIMIT_NUM 5
755
756 #define LIMIT_RATE_MASK_NONE 0x00
757 #define LIMIT_RATE_MASK_STA 0x01
758 #define LIMIT_RATE_MASK_AP 0x02
759 #define LIMIT_RATE_MASK_ALL 0x03
760
784 bool wifi_set_user_rate_limit(uint8 mode, uint8 ifidx, uint8 max, uint8 min);
785
797 uint8 wifi_get_user_limit_rate_mask(void);
798
812 bool wifi_set_user_limit_rate_mask(uint8 enable_mask);
813
827 typedef enum {
828 USER_IE_BEACON = 0,
829 USER_IE_PROBE_REQ,
830 USER_IE_PROBE_RESP,
831 USER_IE_ASSOC_REQ,
832 USER_IE_ASSOC_RESP,
833 USER_IE_MAX
834 } user_ie_type;
835
848 typedef void (*user_ie_manufacturer_recv_cb_t)(user_ie_type type, const uint8 sa[6], const uint8 m_oui[3], uint8 *ie, uint8 ie_len, sint32 rssi);
849
871 bool wifi_set_user_ie(bool enable, uint8 *m_oui, user_ie_type type, uint8 *user_ie, uint8 len);
872
881 sint32 wifi_register_user_ie_manufacturer_recv_cb(user_ie_manufacturer_recv_cb_t cb);
882
890 void wifi_unregister_user_ie_manufacturer_recv_cb(void);
891
914 typedef void (* wifi_promiscuous_cb_t)(uint8 *buf, uint16 len);
915
925 void wifi_set_promiscuous_rx_cb(wifi_promiscuous_cb_t cb);
926
934 uint8 wifi_get_channel(void);
935
944 bool wifi_set_channel(uint8 channel);
945
958 bool wifi_promiscuous_set_mac(const uint8_t *address);
959
975 void wifi_promiscuous_enable(uint8 promiscuous);
976
985 #ifdef __cplusplus
986 }
987 #endif
988
989 #endif
user_ie_manufacturer_recv_cb_t
void(* user_ie_manufacturer_recv_cb_t)(user_ie_type type, const uint8 sa[6], const uint8 m_oui[3], uint8 *ie, uint8 ie_len, sint32 rssi)
User IE received callback.
Definition: esp_wifi.h:848
wifi_fpm_close
void wifi_fpm_close(void)
Disable force sleep function.
wifi_set_opmode_current
bool wifi_set_opmode_current(WIFI_MODE opmode)
Set the WiFi operating mode, and will not save it to Flash.
ip_info
Definition: esp_wifi.h:132
AUTH_WPA_WPA2_PSK
Definition: esp_wifi.h:64
Event_SoftAPMode_ProbeReqRecved_t::rssi
int rssi
Definition: esp_wifi.h:334
WIFI_MODE
WIFI_MODE
Definition: esp_wifi.h:51
Event_StaMode_Connected_t
Definition: esp_wifi.h:298
Event_StaMode_ScanDone_t
Definition: esp_wifi.h:293
wifi_set_phy_mode
bool wifi_set_phy_mode(WIFI_PHY_MODE mode)
Set the ESP8266 physical mode (802.11b/g/n).
wifi_promiscuous_enable
void wifi_promiscuous_enable(uint8 promiscuous)
Enable the promiscuous mode.
EVENT_SOFTAPMODE_STADISCONNECTED
Definition: esp_wifi.h:256
_esp_event
Definition: esp_wifi.h:349
wifi_status_led_install
void wifi_status_led_install(uint8 gpio_id, uint32 gpio_name, uint8 gpio_func)
Install the WiFi status LED.
EVENT_STAMODE_CONNECTED
Definition: esp_wifi.h:250
Event_StaMode_ScanDone_t::bss
struct bss_info * bss
Definition: esp_wifi.h:295
Event_SoftAPMode_StaConnected_t
Definition: esp_wifi.h:323
EVENT_SOFTAPMODE_PROBEREQRECVED
Definition: esp_wifi.h:257
Event_StaMode_Disconnected_t::reason
uint8 reason
Definition: esp_wifi.h:309
wifi_set_user_sup_rate
sint32 wifi_set_user_sup_rate(uint8 min, uint8 max)
Set the support rate of ESP8266.
AUTH_MODE
AUTH_MODE
Definition: esp_wifi.h:59
wifi_rfid_locp_recv_close
void wifi_rfid_locp_recv_close(void)
Disable RFID LOCP (Location Control Protocol) .
SOFTAP_IF
Definition: esp_wifi.h:128
EVENT_STAMODE_AUTHMODE_CHANGE
Definition: esp_wifi.h:252
ip_info::ip
struct ip_addr ip
Definition: esp_wifi.h:133
wifi_set_user_rate_limit
bool wifi_set_user_rate_limit(uint8 mode, uint8 ifidx, uint8 max, uint8 min)
Limit the initial rate of sending data from ESP8266.
rfid_locp_cb_t
void(* rfid_locp_cb_t)(uint8 *frm, int len, sint8 rssi)
RFID LOCP (Location Control Protocol) receive callback .
Definition: esp_wifi.h:459
Event_StaMode_AuthMode_Change_t::new_mode
uint8 new_mode
Definition: esp_wifi.h:314
wifi_status_led_uninstall
void wifi_status_led_uninstall(void)
Uninstall the WiFi status LED.
Event_StaMode_Connected_t::channel
uint8 channel
Definition: esp_wifi.h:302
wifi_set_user_fixed_rate
sint32 wifi_set_user_fixed_rate(uint8 enable_mask, uint8 rate)
Set the fixed rate and mask of sending data from ESP8266.
EVENT_SOFTAPMODE_STACONNECTED
Definition: esp_wifi.h:255
Event_StaMode_ScanDone_t::status
uint32 status
Definition: esp_wifi.h:294
ip_info::gw
struct ip_addr gw
Definition: esp_wifi.h:135
SOFTAP_MODE
Definition: esp_wifi.h:54
EVENT_STAMODE_GOT_IP
Definition: esp_wifi.h:253
wifi_get_opmode
WIFI_MODE wifi_get_opmode(void)
Get the current operating mode of the WiFi.
wifi_set_sleep_type
bool wifi_set_sleep_type(sleep_type type)
Sets sleep type.
wifi_register_rfid_locp_recv_cb
sint32 wifi_register_rfid_locp_recv_cb(rfid_locp_cb_t cb)
Register a callback of receiving WDS packets.
EVENT_STAMODE_DISCONNECTED
Definition: esp_wifi.h:251
Event_StaMode_Disconnected_t
Definition: esp_wifi.h:305
wifi_register_send_pkt_freedom_cb
sint32 wifi_register_send_pkt_freedom_cb(freedom_outside_cb_t cb)
Register a callback for sending user-define 802.11 packets.
wifi_set_ip_info
bool wifi_set_ip_info(WIFI_INTERFACE if_index, struct ip_info *info)
Set the IP address of the ESP8266 WiFi station or the soft-AP interface.
wifi_fpm_get_sleep_type
sleep_type wifi_fpm_get_sleep_type(void)
Get sleep type of force sleep function.
wifi_promiscuous_cb_t
void(* wifi_promiscuous_cb_t)(uint8 *buf, uint16 len)
The RX callback function in the promiscuous mode.
Definition: esp_wifi.h:914
STATION_MODE
Definition: esp_wifi.h:53
wifi_unregister_send_pkt_freedom_cb
void wifi_unregister_send_pkt_freedom_cb(void)
Unregister the callback for sending user-define 802.11 packets.
AUTH_OPEN
Definition: esp_wifi.h:60
wifi_set_channel
bool wifi_set_channel(uint8 channel)
Set the channel number for sniffer functions.
wifi_set_event_handler_cb
bool wifi_set_event_handler_cb(wifi_event_handler_cb_t cb)
Register the Wi-Fi event handler.
wifi_promiscuous_set_mac
bool wifi_promiscuous_set_mac(const uint8_t *address)
Set the MAC address filter for the sniffer mode.
Event_Info_u::disconnected
Event_StaMode_Disconnected_t disconnected
Definition: esp_wifi.h:341
wifi_set_opmode
bool wifi_set_opmode(WIFI_MODE opmode)
Set the WiFi operating mode, and save it to Flash.
_esp_event::event_info
Event_Info_u event_info
Definition: esp_wifi.h:351
wifi_set_user_limit_rate_mask
bool wifi_set_user_limit_rate_mask(uint8 enable_mask)
Set the interfaces of ESP8266 whose rate of sending packets is limited by wifi_set_user_rate_limit.
wifi_get_phy_mode
WIFI_PHY_MODE wifi_get_phy_mode(void)
Get the ESP8266 physical mode (802.11b/g/n).
Event_StaMode_Disconnected_t::ssid_len
uint8 ssid_len
Definition: esp_wifi.h:307
Event_Info_u::got_ip
Event_StaMode_Got_IP_t got_ip
Definition: esp_wifi.h:343
freedom_outside_cb_t
void(* freedom_outside_cb_t)(uint8 status)
Callback of sending user-define 802.11 packets.
Definition: esp_wifi.h:383
wifi_get_channel
uint8 wifi_get_channel(void)
Get the channel number for sniffer functions.
wifi_unregister_user_ie_manufacturer_recv_cb
void wifi_unregister_user_ie_manufacturer_recv_cb(void)
Unregister user IE received callback.
wifi_get_user_limit_rate_mask
uint8 wifi_get_user_limit_rate_mask(void)
Get the interfaces of ESP8266 whose rate of sending data is limited by wifi_set_user_rate_limit.
Event_Info_u::ap_probereqrecved
Event_SoftAPMode_ProbeReqRecved_t ap_probereqrecved
Definition: esp_wifi.h:346
wifi_fpm_set_sleep_type
void wifi_fpm_set_sleep_type(sleep_type type)
Set sleep type for force sleep function.
wifi_set_macaddr
bool wifi_set_macaddr(WIFI_INTERFACE if_index, uint8 *macaddr)
Set MAC address of the ESP8266 WiFi station or the soft-AP interface.
Event_Info_u
Definition: esp_wifi.h:338
EVENT_STAMODE_SCAN_DONE
Definition: esp_wifi.h:249
wifi_fpm_do_wakeup
void wifi_fpm_do_wakeup(void)
Wake ESP8266 up from MODEM_SLEEP_T force sleep.
PHY_MODE_11B
Definition: esp_wifi.h:222
Event_Info_u::sta_disconnected
Event_SoftAPMode_StaDisconnected_t sta_disconnected
Definition: esp_wifi.h:345
wifi_unregister_rfid_locp_recv_cb
void wifi_unregister_rfid_locp_recv_cb(void)
Unregister the callback of receiving WDS packets.
bss_info::bssid
uint8 bssid[6]
Definition: esp_sta.h:155
wifi_register_user_ie_manufacturer_recv_cb
sint32 wifi_register_user_ie_manufacturer_recv_cb(user_ie_manufacturer_recv_cb_t cb)
Register user IE received callback.
wifi_get_sleep_type
sleep_type wifi_get_sleep_type(void)
Gets sleep type.
Event_StaMode_Got_IP_t
Definition: esp_wifi.h:317
EVENT_STAMODE_DHCP_TIMEOUT
Definition: esp_wifi.h:254
wifi_fpm_open
void wifi_fpm_open(void)
Enable force sleep function.
wifi_get_ip_info
bool wifi_get_ip_info(WIFI_INTERFACE if_index, struct ip_info *info)
Get the IP address of the ESP8266 WiFi station or the soft-AP interface.
NULL_MODE
Definition: esp_wifi.h:52
Event_StaMode_AuthMode_Change_t::old_mode
uint8 old_mode
Definition: esp_wifi.h:313
WIFI_INTERFACE
WIFI_INTERFACE
Definition: esp_wifi.h:126
Event_SoftAPMode_StaDisconnected_t::aid
uint8 aid
Definition: esp_wifi.h:330
wifi_get_opmode_default
WIFI_MODE wifi_get_opmode_default(void)
Get the operating mode of the WiFi saved in the Flash.
wifi_set_promiscuous_rx_cb
void wifi_set_promiscuous_rx_cb(wifi_promiscuous_cb_t cb)
Register the RX callback function in the promiscuous mode.
STATION_IF
Definition: esp_wifi.h:127
wifi_set_user_ie
bool wifi_set_user_ie(bool enable, uint8 *m_oui, user_ie_type type, uint8 *user_ie, uint8 len)
Set user IE of ESP8266.
wifi_event_handler_cb_t
void(* wifi_event_handler_cb_t)(System_Event_t *event)
The Wi-Fi event handler.
Definition: esp_wifi.h:364
STATIONAP_MODE
Definition: esp_wifi.h:55
Event_SoftAPMode_StaConnected_t::aid
uint8 aid
Definition: esp_wifi.h:325
wifi_get_user_fixed_rate
int wifi_get_user_fixed_rate(uint8 *enable_mask, uint8 *rate)
Get the fixed rate and mask of ESP8266.
wifi_rfid_locp_recv_open
sint32 wifi_rfid_locp_recv_open(void)
Enable RFID LOCP (Location Control Protocol) to receive WDS packets.
wifi_fpm_set_wakeup_cb
void wifi_fpm_set_wakeup_cb(fpm_wakeup_cb cb)
Set a callback of waken up from force sleep because of time out.
AUTH_WPA_PSK
Definition: esp_wifi.h:62
Event_Info_u::connected
Event_StaMode_Connected_t connected
Definition: esp_wifi.h:340
Event_Info_u::auth_change
Event_StaMode_AuthMode_Change_t auth_change
Definition: esp_wifi.h:342
PHY_MODE_11N
Definition: esp_wifi.h:224
AUTH_WEP
Definition: esp_wifi.h:61
Event_StaMode_AuthMode_Change_t
Definition: esp_wifi.h:312
Event_Info_u::sta_connected
Event_SoftAPMode_StaConnected_t sta_connected
Definition: esp_wifi.h:344
wifi_send_pkt_freedom
sint32 wifi_send_pkt_freedom(uint8 *buf, uint16 len, bool sys_seq)
Send user-define 802.11 packets.
bss_info::ssid
uint8 ssid[32]
Definition: esp_sta.h:156
Event_SoftAPMode_ProbeReqRecved_t
Definition: esp_wifi.h:333
PHY_MODE_11G
Definition: esp_wifi.h:223
AUTH_WPA2_PSK
Definition: esp_wifi.h:63
_esp_event::event_id
SYSTEM_EVENT event_id
Definition: esp_wifi.h:350
WIFI_PHY_MODE
WIFI_PHY_MODE
Definition: esp_wifi.h:221
Event_Info_u::scan_done
Event_StaMode_ScanDone_t scan_done
Definition: esp_wifi.h:339
Event_SoftAPMode_StaDisconnected_t
Definition: esp_wifi.h:328
bss_info
Definition: esp_sta.h:152
wifi_fpm_do_sleep
sint8 wifi_fpm_do_sleep(uint32 sleep_time_in_us)
Force ESP8266 enter sleep mode, and it will wake up automatically when time out.
SYSTEM_EVENT
SYSTEM_EVENT
Definition: esp_wifi.h:248
wifi_get_macaddr
bool wifi_get_macaddr(WIFI_INTERFACE if_index, uint8 *macaddr)
Get MAC address of the ESP8266 WiFi station or the soft-AP interface.
Event_StaMode_Connected_t::ssid_len
uint8 ssid_len
Definition: esp_wifi.h:300
ip_info::netmask
struct ip_addr netmask
Definition: esp_wifi.h:134