18
18
#include "esp_wifi_types.h"
19
19
#include "esp_event.h"
20
20
#include "esp_wifi.h"
21
+ #include "esp_smartconfig.h"
21
22
22
23
#ifdef __cplusplus
23
24
extern "C" {
@@ -39,7 +40,7 @@ typedef enum {
39
40
WIFI_LOG_DEBUG , /*can be set in menuconfig*/
40
41
WIFI_LOG_VERBOSE , /*can be set in menuconfig*/
41
42
} wifi_log_level_t ;
42
-
43
+
43
44
/**
44
45
* @brief WiFi log submodule definition
45
46
*
@@ -81,7 +82,7 @@ typedef enum {
81
82
* - ESP_ERR_NO_MEM: out of memory
82
83
* - others: refer to error code esp_err.h
83
84
*/
84
- esp_err_t esp_wifi_init_internal (const wifi_init_config_t * config );
85
+ esp_err_t esp_wifi_init_internal (const wifi_init_config_t * config );
85
86
86
87
/**
87
88
* @brief Deinitialize Wi-Fi Driver
@@ -117,14 +118,14 @@ wifi_rx_pbuf_mem_type_t esp_wifi_get_rx_pbuf_mem_type(void);
117
118
int8_t esp_wifi_get_ap_rssi (void );
118
119
119
120
/**
120
- * @brief The RX callback function when receive probe request packet.
121
+ * @brief The RX callback function when receive probe request packet.
121
122
* When probe request packet is received, the callback function will be called.
122
123
*
123
124
* @param frame Data of received probe request.
124
125
* @param len length of received probe request.
125
126
* @param rssi rssi of received probe request.
126
127
*/
127
- typedef void (* wifi_sta_rx_probe_req_t )(const uint8_t * frame , int len , int rssi );
128
+ typedef void (* wifi_sta_rx_probe_req_t )(const uint8_t * frame , int len , int rssi );
128
129
129
130
/**
130
131
* @brief Register the RX callback function when receive probe request.
@@ -159,14 +160,14 @@ void esp_wifi_internal_free_rx_buffer(void* buffer);
159
160
* - ERR_IF : WiFi driver error
160
161
* - ERR_ARG : Invalid argument
161
162
*/
162
- int esp_wifi_internal_tx (wifi_interface_t wifi_if , void * buffer , uint16_t len );
163
+ int esp_wifi_internal_tx (wifi_interface_t wifi_if , void * buffer , uint16_t len );
163
164
164
165
/**
165
166
* @brief The WiFi RX callback function
166
167
*
167
168
* Each time the WiFi need to forward the packets to high layer, the callback function will be called
168
169
*/
169
- typedef esp_err_t (* wifi_rxcb_t )(void * buffer , uint16_t len , void * eb );
170
+ typedef esp_err_t (* wifi_rxcb_t )(void * buffer , uint16_t len , void * eb );
170
171
171
172
/**
172
173
* @brief Set the WiFi RX callback
@@ -183,7 +184,7 @@ typedef esp_err_t (*wifi_rxcb_t)(void *buffer, uint16_t len, void *eb);
183
184
esp_err_t esp_wifi_internal_reg_rxcb (wifi_interface_t ifx , wifi_rxcb_t fn );
184
185
185
186
/**
186
- * @brief Set current WiFi log level
187
+ * @brief Set current WiFi log level
187
188
*
188
189
* @param level Log level.
189
190
*
@@ -207,29 +208,57 @@ esp_err_t esp_wifi_internal_set_log_level(wifi_log_level_t level);
207
208
esp_err_t esp_wifi_internal_set_log_mod (uint32_t submodule );
208
209
209
210
/**
210
- * @brief Get current WiFi log info
211
+ * @brief Get current WiFi log info
211
212
*
212
213
* @param log_level the return log level.
213
214
* @param log_mod the return log module and submodule
214
215
*
215
216
* @return
216
217
* - ESP_OK: succeed
217
218
*/
218
- esp_err_t esp_wifi_internal_get_log (wifi_log_level_t * log_level , uint32_t * log_mod );
219
+ esp_err_t esp_wifi_internal_get_log (wifi_log_level_t * log_level , uint32_t * log_mod );
219
220
220
221
/**
221
222
* @brief get wifi power management config.
222
- *
223
+ *
223
224
* @param ps_config power management config
224
225
*/
225
- void esp_wifi_set_pm_config (esp_pm_config_t * pm_config );
226
+ void esp_wifi_set_pm_config (esp_pm_config_t * pm_config );
226
227
227
228
/**
228
229
* @brief set wifi power management config.
229
- *
230
+ *
230
231
* @param ps_config power management config
231
232
*/
232
- void esp_wifi_get_pm_config (esp_pm_config_t * pm_config );
233
+ void esp_wifi_get_pm_config (esp_pm_config_t * pm_config );
234
+
235
+ /**
236
+ * @brief Start SmartConfig, config ESP device to connect AP. You need to broadcast information by phone APP.
237
+ * Device sniffer special packets from the air that containing SSID and password of target AP.
238
+ *
239
+ * @attention 1. This API can be called in station or softAP-station mode.
240
+ * @attention 2. Can not call esp_smartconfig_start twice before it finish, please call
241
+ * esp_smartconfig_stop first.
242
+ *
243
+ * @param config pointer to smartconfig start configure structure
244
+ *
245
+ * @return
246
+ * - ESP_OK: succeed
247
+ * - others: fail
248
+ */
249
+ esp_err_t esp_smartconfig_internal_start (const smartconfig_start_config_t * config );
250
+
251
+ /**
252
+ * @brief Stop SmartConfig, free the buffer taken by esp_smartconfig_start.
253
+ *
254
+ * @attention Whether connect to AP succeed or not, this API should be called to free
255
+ * memory taken by smartconfig_start.
256
+ *
257
+ * @return
258
+ * - ESP_OK: succeed
259
+ * - others: fail
260
+ */
261
+ esp_err_t esp_smartconfig_internal_stop (void );
233
262
234
263
#ifdef __cplusplus
235
264
}
0 commit comments