/* * SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 *//* ... */#ifndef_WIFI_PROV_CONFIG_H_#define_WIFI_PROV_CONFIG_H_#include"esp_netif_ip_addr.h"#include"esp_err.h"#ifdef__cplusplusextern"C"{#endif/** * @brief WiFi STA status for conveying back to the provisioning master *//* ... */typedefenum{WIFI_PROV_STA_CONNECTING,WIFI_PROV_STA_CONNECTED,WIFI_PROV_STA_DISCONNECTED,WIFI_PROV_STA_CONN_ATTEMPT_FAILED}{ ... }wifi_prov_sta_state_t;/** * @brief WiFi STA connection fail reason *//* ... */typedefenum{WIFI_PROV_STA_AUTH_ERROR,WIFI_PROV_STA_AP_NOT_FOUND}{ ... }wifi_prov_sta_fail_reason_t;/** * @brief WiFi STA connected status information *//* ... */typedefstruct{/** * IP Address received by station *//* ... */charip_addr[IP4ADDR_STRLEN_MAX];charbssid[6];/*!< BSSID of the AP to which connection was estalished */charssid[33];/*!< SSID of the to which connection was estalished */uint8_tchannel;/*!< Channel of the AP */uint8_tauth_mode;/*!< Authorization mode of the AP */}{ ... }wifi_prov_sta_conn_info_t;/** * @brief WiFi STA connecting status information *//* ... */typedefstruct{uint32_tattempts_remaining;/*!< Number of Wi-Fi connection attempts remaining */}{ ... }wifi_prov_sta_connecting_info_t;/** * @brief WiFi status data to be sent in response to `get_status` request from master *//* ... */typedefstruct{wifi_prov_sta_state_twifi_state;/*!< WiFi state of the station */union{/** * Reason for disconnection (valid only when `wifi_state` is `WIFI_STATION_DISCONNECTED`) *//* ... */wifi_prov_sta_fail_reason_tfail_reason;/** * Connection information (valid only when `wifi_state` is `WIFI_STATION_CONNECTED`) *//* ... */wifi_prov_sta_conn_info_tconn_info;/** * Connecting information (valid only when `wifi_state` is `WIFI_STATION_CONNECTING`) *//* ... */wifi_prov_sta_connecting_info_tconnecting_info;}{ ... };}{ ... }wifi_prov_config_get_data_t;/** * @brief WiFi config data received by slave during `set_config` request from master *//* ... */typedefstruct{charssid[33];/*!< SSID of the AP to which the slave is to be connected */charpassword[64];/*!< Password of the AP */charbssid[6];/*!< BSSID of the AP */uint8_tchannel;/*!< Channel of the AP */}{ ... }wifi_prov_config_set_data_t;/** * @brief Type of context data passed to each get/set/apply handler * function set in `wifi_prov_config_handlers` structure. * * This is passed as an opaque pointer, thereby allowing it be defined * later in application code as per requirements. *//* ... */typedefstructwifi_prov_ctxwifi_prov_ctx_t;/** * @brief Internal handlers for receiving and responding to protocomm * requests from master * * This is to be passed as priv_data for protocomm request handler * (refer to `wifi_prov_config_data_handler()`) when calling `protocomm_add_endpoint()`. *//* ... */typedefstructwifi_prov_config_handlers{/** * Handler function called when connection status * of the slave (in WiFi station mode) is requested *//* ... */esp_err_t(*get_status_handler)(wifi_prov_config_get_data_t*resp_data,wifi_prov_ctx_t**ctx);/** * Handler function called when WiFi connection configuration * (eg. AP SSID, password, etc.) of the slave (in WiFi station mode) * is to be set to user provided values *//* ... */esp_err_t(*set_config_handler)(constwifi_prov_config_set_data_t*req_data,wifi_prov_ctx_t**ctx);/** * Handler function for applying the configuration that was set in * `set_config_handler`. After applying the station may get connected to * the AP or may fail to connect. The slave must be ready to convey the * updated connection status information when `get_status_handler` is * invoked again by the master. *//* ... */esp_err_t(*apply_config_handler)(wifi_prov_ctx_t**ctx);/** * Context pointer to be passed to above handler functions upon invocation *//* ... */wifi_prov_ctx_t*ctx;}{ ... }wifi_prov_config_handlers_t;/** * @brief Handler for receiving and responding to requests from master * * This is to be registered as the `wifi_config` endpoint handler * (protocomm `protocomm_req_handler_t`) using `protocomm_add_endpoint()` *//* ... */esp_err_twifi_prov_config_data_handler(uint32_tsession_id,constuint8_t*inbuf,ssize_tinlen,uint8_t**outbuf,ssize_t*outlen,void*priv_data);#ifdef__cplusplus}{...}#endif/* ... */#endif
Details
Show: from
Types: Columns:
All items filtered out
All items filtered out
This file uses the notable symbols shown below. Click anywhere in the file to view more details.