ESP8266_RTOS_SDK
v1.4.0
|
ESP8266 station APIs. More...
Data Structures | |
struct | station_config |
struct | scan_config |
struct | bss_info |
Typedefs | |
typedef void(* | scan_done_cb_t) (void *arg, STATUS status) |
Callback function for wifi_station_scan. More... | |
Enumerations | |
enum | STATION_STATUS { STATION_IDLE = 0, STATION_CONNECTING, STATION_WRONG_PASSWORD, STATION_NO_AP_FOUND, STATION_CONNECT_FAIL, STATION_GOT_IP } |
Functions | |
bool | wifi_station_get_config (struct station_config *config) |
Get the current configuration of the ESP8266 WiFi station. More... | |
bool | wifi_station_get_config_default (struct station_config *config) |
Get the configuration parameters saved in the Flash of the ESP8266 WiFi station. More... | |
bool | wifi_station_set_config (struct station_config *config) |
Set the configuration of the ESP8266 station and save it to the Flash. More... | |
bool | wifi_station_set_config_current (struct station_config *config) |
Set the configuration of the ESP8266 station. And the configuration will not be saved to the Flash. More... | |
bool | wifi_station_connect (void) |
Connect the ESP8266 WiFi station to the AP. More... | |
bool | wifi_station_disconnect (void) |
Disconnect the ESP8266 WiFi station from the AP. More... | |
bool | wifi_station_scan (struct scan_config *config, scan_done_cb_t cb) |
Scan all available APs. More... | |
bool | wifi_station_get_auto_connect (void) |
Check if the ESP8266 station will connect to the recorded AP automatically when the power is on. More... | |
bool | wifi_station_set_auto_connect (bool set) |
Set whether the ESP8266 station will connect to the recorded AP automatically when the power is on. It will do so by default. More... | |
bool | wifi_station_get_reconnect_policy (void) |
Check whether the ESP8266 station will reconnect to the AP after disconnection. More... | |
bool | wifi_station_set_reconnect_policy (bool set) |
Set whether the ESP8266 station will reconnect to the AP after disconnection. It will do so by default. More... | |
STATION_STATUS | wifi_station_get_connect_status (void) |
Get the connection status of the ESP8266 WiFi station. More... | |
uint8 | wifi_station_get_current_ap_id (void) |
Get the information of APs (5 at most) recorded by ESP8266 station. More... | |
bool | wifi_station_ap_change (uint8 current_ap_id) |
Switch the ESP8266 station connection to a recorded AP. More... | |
bool | wifi_station_ap_number_set (uint8 ap_number) |
Set the number of APs that can be recorded in the ESP8266 station. When the ESP8266 station is connected to an AP, the SSID and password of the AP will be recorded. More... | |
uint8 | wifi_station_get_ap_info (struct station_config config[]) |
Get the information of APs (5 at most) recorded by ESP8266 station. More... | |
sint8 | wifi_station_get_rssi (void) |
Get rssi of the AP which ESP8266 station connected to. More... | |
bool | wifi_station_dhcpc_start (void) |
Enable the ESP8266 station DHCP client. More... | |
bool | wifi_station_dhcpc_stop (void) |
Disable the ESP8266 station DHCP client. More... | |
enum dhcp_status | wifi_station_dhcpc_status (void) |
Get the ESP8266 station DHCP client status. More... | |
bool | wifi_station_set_hostname (char *name) |
Set ESP8266 station DHCP hostname. More... | |
char * | wifi_station_get_hostname (void) |
Get ESP8266 station DHCP hostname. More... | |
ESP8266 station APIs.
typedef void(* scan_done_cb_t) (void *arg, STATUS status) |
Callback function for wifi_station_scan.
void | *arg : information of APs that are found; save them as linked list; refer to struct bss_info |
STATUS | status : status of scanning |
enum STATION_STATUS |
bool wifi_station_ap_change | ( | uint8 | current_ap_id | ) |
Switch the ESP8266 station connection to a recorded AP.
uint8 | new_ap_id : AP's record id, start counting from 0. |
bool wifi_station_ap_number_set | ( | uint8 | ap_number | ) |
Set the number of APs that can be recorded in the ESP8266 station. When the ESP8266 station is connected to an AP, the SSID and password of the AP will be recorded.
uint8 | ap_number : the number of APs that can be recorded (MAX: 5) |
bool wifi_station_connect | ( | void | ) |
Connect the ESP8266 WiFi station to the AP.
null |
bool wifi_station_dhcpc_start | ( | void | ) |
Enable the ESP8266 station DHCP client.
null |
enum dhcp_status wifi_station_dhcpc_status | ( | void | ) |
Get the ESP8266 station DHCP client status.
null |
bool wifi_station_dhcpc_stop | ( | void | ) |
Disable the ESP8266 station DHCP client.
null |
bool wifi_station_disconnect | ( | void | ) |
Disconnect the ESP8266 WiFi station from the AP.
null |
uint8 wifi_station_get_ap_info | ( | struct station_config | config[] | ) |
Get the information of APs (5 at most) recorded by ESP8266 station.
Example:
struct station_config config[5]; nt i = wifi_station_get_ap_info(config);
struct | station_config config[] : information of the APs, the array size should be 5. |
bool wifi_station_get_auto_connect | ( | void | ) |
Check if the ESP8266 station will connect to the recorded AP automatically when the power is on.
null |
bool wifi_station_get_config | ( | struct station_config * | config | ) |
Get the current configuration of the ESP8266 WiFi station.
struct | station_config *config : ESP8266 station configuration |
bool wifi_station_get_config_default | ( | struct station_config * | config | ) |
Get the configuration parameters saved in the Flash of the ESP8266 WiFi station.
struct | station_config *config : ESP8266 station configuration |
STATION_STATUS wifi_station_get_connect_status | ( | void | ) |
Get the connection status of the ESP8266 WiFi station.
null |
uint8 wifi_station_get_current_ap_id | ( | void | ) |
Get the information of APs (5 at most) recorded by ESP8266 station.
struct | station_config config[] : information of the APs, the array size should be 5. |
char* wifi_station_get_hostname | ( | void | ) |
Get ESP8266 station DHCP hostname.
null |
bool wifi_station_get_reconnect_policy | ( | void | ) |
Check whether the ESP8266 station will reconnect to the AP after disconnection.
null |
sint8 wifi_station_get_rssi | ( | void | ) |
Get rssi of the AP which ESP8266 station connected to.
null |
bool wifi_station_scan | ( | struct scan_config * | config, |
scan_done_cb_t | cb | ||
) |
Scan all available APs.
struct | scan_config *config : configuration of scanning |
struct | scan_done_cb_t cb : callback of scanning |
bool wifi_station_set_auto_connect | ( | bool | set | ) |
Set whether the ESP8266 station will connect to the recorded AP automatically when the power is on. It will do so by default.
bool | set : If it will automatically connect to the AP when the power is on
|
bool wifi_station_set_config | ( | struct station_config * | config | ) |
Set the configuration of the ESP8266 station and save it to the Flash.
struct | station_config *config : ESP8266 station configuration |
bool wifi_station_set_config_current | ( | struct station_config * | config | ) |
Set the configuration of the ESP8266 station. And the configuration will not be saved to the Flash.
struct | station_config *config : ESP8266 station configuration |
bool wifi_station_set_hostname | ( | char * | name | ) |
Set ESP8266 station DHCP hostname.
char | *name : hostname of ESP8266 station |
bool wifi_station_set_reconnect_policy | ( | bool | set | ) |
Set whether the ESP8266 station will reconnect to the AP after disconnection. It will do so by default.
bool | set : if it's true, it will enable reconnection; if it's false, it will disable reconnection. |