|
ESP8266_RTOS_SDK
v1.4.0
|
WiFi common APIs. More...
Data Structures | |
| struct | ip_info |
| struct | Event_StaMode_ScanDone_t |
| struct | Event_StaMode_Connected_t |
| struct | Event_StaMode_Disconnected_t |
| struct | Event_StaMode_AuthMode_Change_t |
| struct | Event_StaMode_Got_IP_t |
| struct | Event_SoftAPMode_StaConnected_t |
| struct | Event_SoftAPMode_StaDisconnected_t |
| struct | Event_SoftAPMode_ProbeReqRecved_t |
| union | Event_Info_u |
| struct | _esp_event |
Typedefs | |
| typedef struct _esp_event | System_Event_t |
| typedef void(* | wifi_event_handler_cb_t) (System_Event_t *event) |
| The Wi-Fi event handler. More... | |
| typedef void(* | freedom_outside_cb_t) (uint8 status) |
| Callback of sending user-define 802.11 packets. More... | |
| typedef void(* | rfid_locp_cb_t) (uint8 *frm, int len, sint8 rssi) |
| RFID LOCP (Location Control Protocol) receive callback . More... | |
Enumerations | |
| enum | WIFI_MODE { NULL_MODE = 0, STATION_MODE, SOFTAP_MODE, STATIONAP_MODE, MAX_MODE } |
| enum | AUTH_MODE { AUTH_OPEN = 0, AUTH_WEP, AUTH_WPA_PSK, AUTH_WPA2_PSK, AUTH_WPA_WPA2_PSK, AUTH_MAX } |
| enum | WIFI_INTERFACE { STATION_IF = 0, SOFTAP_IF, MAX_IF } |
| enum | WIFI_PHY_MODE { PHY_MODE_11B = 1, PHY_MODE_11G = 2, PHY_MODE_11N = 3 } |
| enum | SYSTEM_EVENT { EVENT_STAMODE_SCAN_DONE = 0, EVENT_STAMODE_CONNECTED, EVENT_STAMODE_DISCONNECTED, EVENT_STAMODE_AUTHMODE_CHANGE, EVENT_STAMODE_GOT_IP, EVENT_STAMODE_DHCP_TIMEOUT, EVENT_SOFTAPMODE_STACONNECTED, EVENT_SOFTAPMODE_STADISCONNECTED, EVENT_SOFTAPMODE_PROBEREQRECVED, EVENT_MAX } |
| enum | { REASON_UNSPECIFIED = 1, REASON_AUTH_EXPIRE = 2, REASON_AUTH_LEAVE = 3, REASON_ASSOC_EXPIRE = 4, REASON_ASSOC_TOOMANY = 5, REASON_NOT_AUTHED = 6, REASON_NOT_ASSOCED = 7, REASON_ASSOC_LEAVE = 8, REASON_ASSOC_NOT_AUTHED = 9, REASON_DISASSOC_PWRCAP_BAD = 10, REASON_DISASSOC_SUPCHAN_BAD = 11, REASON_IE_INVALID = 13, REASON_MIC_FAILURE = 14, REASON_4WAY_HANDSHAKE_TIMEOUT = 15, REASON_GROUP_KEY_UPDATE_TIMEOUT = 16, REASON_IE_IN_4WAY_DIFFERS = 17, REASON_GROUP_CIPHER_INVALID = 18, REASON_PAIRWISE_CIPHER_INVALID = 19, REASON_AKMP_INVALID = 20, REASON_UNSUPP_RSN_IE_VERSION = 21, REASON_INVALID_RSN_IE_CAP = 22, REASON_802_1X_AUTH_FAILED = 23, REASON_CIPHER_SUITE_REJECTED = 24, REASON_BEACON_TIMEOUT = 200, REASON_NO_AP_FOUND = 201, REASON_AUTH_FAIL = 202, REASON_ASSOC_FAIL = 203, REASON_HANDSHAKE_TIMEOUT = 204 } |
| enum | sleep_type { NONE_SLEEP_T = 0, LIGHT_SLEEP_T, MODEM_SLEEP_T } |
Functions | |
| WIFI_MODE | wifi_get_opmode (void) |
| Get the current operating mode of the WiFi. More... | |
| WIFI_MODE | wifi_get_opmode_default (void) |
| Get the operating mode of the WiFi saved in the Flash. More... | |
| bool | wifi_set_opmode (WIFI_MODE opmode) |
| Set the WiFi operating mode, and save it to Flash. More... | |
| bool | wifi_set_opmode_current (WIFI_MODE opmode) |
| Set the WiFi operating mode, and will not save it to Flash. More... | |
| 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. More... | |
| 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. More... | |
| bool | wifi_get_macaddr (WIFI_INTERFACE if_index, uint8 *macaddr) |
| Get MAC address of the ESP8266 WiFi station or the soft-AP interface. More... | |
| bool | wifi_set_macaddr (WIFI_INTERFACE if_index, uint8 *macaddr) |
| Set MAC address of the ESP8266 WiFi station or the soft-AP interface. More... | |
| void | wifi_status_led_install (uint8 gpio_id, uint32 gpio_name, uint8 gpio_func) |
| Install the WiFi status LED. More... | |
| void | wifi_status_led_uninstall (void) |
| Uninstall the WiFi status LED. More... | |
| WIFI_PHY_MODE | wifi_get_phy_mode (void) |
| Get the ESP8266 physical mode (802.11b/g/n). More... | |
| bool | wifi_set_phy_mode (WIFI_PHY_MODE mode) |
| Set the ESP8266 physical mode (802.11b/g/n). More... | |
| bool | wifi_set_event_handler_cb (wifi_event_handler_cb_t cb) |
| Register the Wi-Fi event handler. More... | |
| sint32 | wifi_register_send_pkt_freedom_cb (freedom_outside_cb_t cb) |
| Register a callback for sending user-define 802.11 packets. More... | |
| void | wifi_unregister_send_pkt_freedom_cb (void) |
| Unregister the callback for sending user-define 802.11 packets. More... | |
| sint32 | wifi_send_pkt_freedom (uint8 *buf, uint16 len, bool sys_seq) |
| Send user-define 802.11 packets. More... | |
| sint32 | wifi_rfid_locp_recv_open (void) |
| Enable RFID LOCP (Location Control Protocol) to receive WDS packets. More... | |
| void | wifi_rfid_locp_recv_close (void) |
| Disable RFID LOCP (Location Control Protocol) . More... | |
| sint32 | wifi_register_rfid_locp_recv_cb (rfid_locp_cb_t cb) |
| Register a callback of receiving WDS packets. More... | |
| void | wifi_unregister_rfid_locp_recv_cb (void) |
| Unregister the callback of receiving WDS packets. More... | |
| bool | wifi_set_sleep_type (sleep_type type) |
| Sets sleep type. More... | |
| sleep_type | wifi_get_sleep_type (void) |
| Gets sleep type. More... | |
WiFi common APIs.
The Flash system parameter area is the last 16KB of the Flash.
| typedef void(* freedom_outside_cb_t) (uint8 status) |
Callback of sending user-define 802.11 packets.
| uint8 | status : 0, packet sending succeed; otherwise, fail. |
| typedef void(* rfid_locp_cb_t) (uint8 *frm, int len, sint8 rssi) |
RFID LOCP (Location Control Protocol) receive callback .
| uint8 | *frm : point to the head of 802.11 packet |
| int | len : packet length |
| int | rssi : signal strength |
| typedef void(* wifi_event_handler_cb_t) (System_Event_t *event) |
The Wi-Fi event handler.
| System_Event_t | *event : WiFi event |
| enum AUTH_MODE |
| enum SYSTEM_EVENT |
| enum WIFI_INTERFACE |
| enum WIFI_MODE |
| enum WIFI_PHY_MODE |
| 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.
| WIFI_INTERFACE | if_index : get the IP address of the station or the soft-AP interface, 0x00 for STATION_IF, 0x01 for SOFTAP_IF. |
| struct | ip_info *info : the IP information obtained. |
| bool wifi_get_macaddr | ( | WIFI_INTERFACE | if_index, |
| uint8 * | macaddr | ||
| ) |
Get MAC address of the ESP8266 WiFi station or the soft-AP interface.
| WIFI_INTERFACE | if_index : get the IP address of the station or the soft-AP interface, 0x00 for STATION_IF, 0x01 for SOFTAP_IF. |
| uint8 | *macaddr : the MAC address. |
| WIFI_MODE wifi_get_opmode | ( | void | ) |
Get the current operating mode of the WiFi.
| null |
| WIFI_MODE wifi_get_opmode_default | ( | void | ) |
Get the operating mode of the WiFi saved in the Flash.
| null |
| WIFI_PHY_MODE wifi_get_phy_mode | ( | void | ) |
Get the ESP8266 physical mode (802.11b/g/n).
| null |
| sleep_type wifi_get_sleep_type | ( | void | ) |
Gets sleep type.
| null |
| sint32 wifi_register_rfid_locp_recv_cb | ( | rfid_locp_cb_t | cb | ) |
Register a callback of receiving WDS packets.
Register a callback of receiving WDS packets. Only if the first MAC address of the WDS packet is a multicast address.
| rfid_locp_cb_t | cb : callback |
| sint32 wifi_register_send_pkt_freedom_cb | ( | freedom_outside_cb_t | cb | ) |
Register a callback for sending user-define 802.11 packets.
| freedom_outside_cb_t | cb : sent callback |
| void wifi_rfid_locp_recv_close | ( | void | ) |
Disable RFID LOCP (Location Control Protocol) .
| null |
| sint32 wifi_rfid_locp_recv_open | ( | void | ) |
Enable RFID LOCP (Location Control Protocol) to receive WDS packets.
| null |
| sint32 wifi_send_pkt_freedom | ( | uint8 * | buf, |
| uint16 | len, | ||
| bool | sys_seq | ||
| ) |
Send user-define 802.11 packets.
| uint8 | *buf : pointer of packet |
| uint16 | len : packet length |
| bool | sys_seq : follow the system's 802.11 packets sequence number or not, if it is true, the sequence number will be increased 1 every time a packet sent. |
| bool wifi_set_event_handler_cb | ( | wifi_event_handler_cb_t | cb | ) |
Register the Wi-Fi event handler.
| wifi_event_handler_cb_t | cb : callback function |
| 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_INTERFACE | if_index : get the IP address of the station or the soft-AP interface, 0x00 for STATION_IF, 0x01 for SOFTAP_IF. |
| struct | ip_info *info : the IP information obtained. |
| bool wifi_set_macaddr | ( | WIFI_INTERFACE | if_index, |
| uint8 * | macaddr | ||
| ) |
Set MAC address of the ESP8266 WiFi station or the soft-AP interface.
| WIFI_INTERFACE | if_index : get the IP address of the station or the soft-AP interface, 0x00 for STATION_IF, 0x01 for SOFTAP_IF. |
| uint8 | *macaddr : the MAC address. |
| bool wifi_set_opmode | ( | WIFI_MODE | opmode | ) |
Set the WiFi operating mode, and save it to Flash.
Set the WiFi operating mode as station, soft-AP or station+soft-AP, and save it to Flash. The default mode is soft-AP mode.
| uint8 | opmode : WiFi operating modes:
|
| bool wifi_set_opmode_current | ( | WIFI_MODE | opmode | ) |
Set the WiFi operating mode, and will not save it to Flash.
Set the WiFi operating mode as station, soft-AP or station+soft-AP, and the mode won't be saved to the Flash.
| uint8 | opmode : WiFi operating modes:
|
| bool wifi_set_phy_mode | ( | WIFI_PHY_MODE | mode | ) |
Set the ESP8266 physical mode (802.11b/g/n).
| WIFI_PHY_MODE | mode : physical mode |
| bool wifi_set_sleep_type | ( | sleep_type | type | ) |
Sets sleep type.
Set NONE_SLEEP_T to disable sleep. Default to be Modem sleep.
| sleep_type | type : sleep type |
| void wifi_status_led_install | ( | uint8 | gpio_id, |
| uint32 | gpio_name, | ||
| uint8 | gpio_func | ||
| ) |
Install the WiFi status LED.
| uint8 | gpio_id : GPIO ID |
| uint8 | gpio_name : GPIO mux name |
| uint8 | gpio_func : GPIO function |
| void wifi_status_led_uninstall | ( | void | ) |
Uninstall the WiFi status LED.
| null |
| void wifi_unregister_rfid_locp_recv_cb | ( | void | ) |
Unregister the callback of receiving WDS packets.
| null |
| void wifi_unregister_send_pkt_freedom_cb | ( | void | ) |
Unregister the callback for sending user-define 802.11 packets.
| null |
1.8.10