ESP8266_RTOS_SDK v1.4.0

- Main Page
- Modules
- Data Structures
- Files

Typedefs | Enumerations | Functions
WPS APIs
WiFi Related APIs

ESP8266 WPS APIs. More...

## Typedefs
typedef enum wps_type | WPS_TYPE_t
typedef void(* | wps_st_cb_t) (int status)
| WPS callback. More...

## Enumerations
enum | wps_type { WPS_TYPE_DISABLE = 0, WPS_TYPE_PBC, WPS_TYPE_PIN, WPS_TYPE_DISPLAY, WPS_TYPE_MAX }
enum | wps_cb_status { WPS_CB_ST_SUCCESS = 0, WPS_CB_ST_FAILED, WPS_CB_ST_TIMEOUT, WPS_CB_ST_WEP, WPS_CB_ST_SCAN_ERR }

## Functions
bool | wifi_wps_enable (WPS_TYPE_t wps_type)
| Enable Wi-Fi WPS function. More...
bool | wifi_wps_disable (void)
| Disable Wi-Fi WPS function and release resource it taken. More...
bool | wifi_wps_start (void)
| WPS starts to work. More...
bool | wifi_set_wps_cb (wps_st_cb_t cb)
| Set WPS callback. More...

## Detailed Description

ESP8266 WPS APIs.

WPS can only be used when ESP8266 station is enabled.

## Typedef Documentation

typedef void(* wps_st_cb_t) (int status)

WPS callback.

Parameters

  int | status : status of WPS, enum wps_cb_status. If parameter status == WPS_CB_ST_SUCCESS in WPS callback, it means WPS got AP's information, user can call wifi_wps_disable to disable WPS and release resource, then call wifi_station_connect to connect to target AP. Otherwise, it means that WPS fail, user can create a timer to retry WPS by wifi_wps_start after a while, or call wifi_wps_disable to disable WPS and release resource.

Returns
  null

## Enumeration Type Documentation

enum wps_cb_status

Enumerator
WPS_CB_ST_SUCCESS | WPS succeed
WPS_CB_ST_FAILED | WPS fail
WPS_CB_ST_TIMEOUT | WPS timeout, fail
WPS_CB_ST_WEP | WPS failed because that WEP is not supported
WPS_CB_ST_SCAN_ERR | can not find the target WPS AP

## Function Documentation

bool wifi_set_wps_cb | ( | wps_st_cb_t | cb | ) |

Set WPS callback.

Attention
  WPS can only be used when ESP8266 station is enabled.

Parameters

  wps_st_cb_t | cb : callback.

Returns
  true : WPS starts to work successfully, but does not mean WPS succeed.
  false : fail

bool wifi_wps_disable | ( | void |  | ) |

Disable Wi-Fi WPS function and release resource it taken.

Parameters

  null |

Returns
  true : succeed
  false : fail

bool wifi_wps_enable | ( | WPS_TYPE_t | wps_type | ) |

Enable Wi-Fi WPS function.

Attention
  WPS can only be used when ESP8266 station is enabled.

Parameters

  WPS_TYPE_t | wps_type : WPS type, so far only WPS_TYPE_PBC is supported

Returns
  true : succeed
  false : fail

bool wifi_wps_start | ( | void |  | ) |

WPS starts to work.

Attention
  WPS can only be used when ESP8266 station is enabled.

Parameters

  null |

Returns
  true : WPS starts to work successfully, but does not mean WPS succeed.
  false : fail