| 
									
										
										
										
											2021-12-02 15:49:28 +05:30
										 |  |  | /*
 | 
					
						
							|  |  |  |  * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: Apache-2.0 | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2019-11-04 15:02:19 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | #ifndef _ESP_WIFI_DEFAULT_H
 | 
					
						
							|  |  |  | #define _ESP_WIFI_DEFAULT_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-02 15:49:28 +05:30
										 |  |  | #include "esp_netif.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-18 08:26:00 +01:00
										 |  |  | #ifdef __cplusplus
 | 
					
						
							|  |  |  | extern "C" { | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-28 16:47:34 +02:00
										 |  |  | /**
 | 
					
						
							| 
									
										
										
										
											2019-09-15 19:49:45 +02:00
										 |  |  |  * @brief Attaches wifi station interface to supplied netif | 
					
						
							| 
									
										
										
										
											2019-06-28 16:47:34 +02:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2019-09-15 19:49:45 +02:00
										 |  |  |  * @param esp_netif instance to attach the wifi station to | 
					
						
							| 
									
										
										
										
											2019-06-28 16:47:34 +02:00
										 |  |  |  * | 
					
						
							|  |  |  |  * @return | 
					
						
							| 
									
										
										
										
											2019-09-15 19:49:45 +02:00
										 |  |  |  *  - ESP_OK on success | 
					
						
							|  |  |  |  *  - ESP_FAIL if attach failed | 
					
						
							| 
									
										
										
										
											2019-06-28 16:47:34 +02:00
										 |  |  |  */ | 
					
						
							| 
									
										
										
										
											2019-09-15 19:49:45 +02:00
										 |  |  | esp_err_t esp_netif_attach_wifi_station(esp_netif_t *esp_netif); | 
					
						
							| 
									
										
										
										
											2019-06-28 16:47:34 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | /**
 | 
					
						
							| 
									
										
										
										
											2019-09-15 19:49:45 +02:00
										 |  |  |  * @brief Attaches wifi soft AP interface to supplied netif | 
					
						
							| 
									
										
										
										
											2019-06-28 16:47:34 +02:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2019-09-15 19:49:45 +02:00
										 |  |  |  * @param esp_netif instance to attach the wifi AP to | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @return | 
					
						
							|  |  |  |  *  - ESP_OK on success | 
					
						
							|  |  |  |  *  - ESP_FAIL if attach failed | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | esp_err_t esp_netif_attach_wifi_ap(esp_netif_t *esp_netif); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /**
 | 
					
						
							|  |  |  |  * @brief Sets default wifi event handlers for STA interface | 
					
						
							| 
									
										
										
										
											2019-06-28 16:47:34 +02:00
										 |  |  |  * | 
					
						
							|  |  |  |  * @return | 
					
						
							|  |  |  |  *  - ESP_OK on success, error returned from esp_event_handler_register if failed | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2019-09-15 19:49:45 +02:00
										 |  |  | esp_err_t esp_wifi_set_default_wifi_sta_handlers(void); | 
					
						
							| 
									
										
										
										
											2019-06-28 16:47:34 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-15 19:49:45 +02:00
										 |  |  | /**
 | 
					
						
							| 
									
										
										
										
											2021-08-23 09:20:12 +02:00
										 |  |  |  * @brief Sets default wifi event handlers for AP interface | 
					
						
							| 
									
										
										
										
											2019-09-15 19:49:45 +02:00
										 |  |  |  * | 
					
						
							|  |  |  |  * @return | 
					
						
							|  |  |  |  *  - ESP_OK on success, error returned from esp_event_handler_register if failed | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | esp_err_t esp_wifi_set_default_wifi_ap_handlers(void); | 
					
						
							| 
									
										
										
										
											2019-06-28 16:47:34 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-14 10:06:40 +05:30
										 |  |  | /**
 | 
					
						
							|  |  |  |  * @brief Sets default wifi event handlers for NAN interface | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @return | 
					
						
							|  |  |  |  *  - ESP_OK on success, error returned from esp_event_handler_register if failed | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | esp_err_t esp_wifi_set_default_wifi_nan_handlers(void); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-04 13:58:29 +02:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * @brief Clears default wifi event handlers for supplied network interface | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @param esp_netif instance of corresponding if object | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @return | 
					
						
							|  |  |  |  *  - ESP_OK on success, error returned from esp_event_handler_register if failed | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | esp_err_t esp_wifi_clear_default_wifi_driver_and_handlers(void *esp_netif); | 
					
						
							| 
									
										
										
										
											2019-06-28 16:47:34 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-12 10:06:50 +02:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * @brief Creates default WIFI AP. In case of any init error this API aborts. | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2021-02-05 14:02:41 +01:00
										 |  |  |  * @note The API creates esp_netif object with default WiFi access point config, | 
					
						
							|  |  |  |  * attaches the netif to wifi and registers default wifi handlers. | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2019-09-12 10:06:50 +02:00
										 |  |  |  * @return pointer to esp-netif instance | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | esp_netif_t* esp_netif_create_default_wifi_ap(void); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /**
 | 
					
						
							|  |  |  |  * @brief Creates default WIFI STA. In case of any init error this API aborts. | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2021-02-05 14:02:41 +01:00
										 |  |  |  * @note The API creates esp_netif object with default WiFi station config, | 
					
						
							|  |  |  |  * attaches the netif to wifi and registers default wifi handlers. | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2019-09-12 10:06:50 +02:00
										 |  |  |  * @return pointer to esp-netif instance | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | esp_netif_t* esp_netif_create_default_wifi_sta(void); | 
					
						
							| 
									
										
										
										
											2019-06-28 16:47:34 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-14 10:06:40 +05:30
										 |  |  | /**
 | 
					
						
							|  |  |  |  * @brief Creates default WIFI NAN. In case of any init error this API aborts. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @note The API creates esp_netif object with default WiFi station config, | 
					
						
							|  |  |  |  * attaches the netif to wifi and registers default wifi handlers. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @return pointer to esp-netif instance | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | esp_netif_t* esp_netif_create_default_wifi_nan(void); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-02-05 14:02:41 +01:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * @brief Destroys default WIFI netif created with esp_netif_create_default_wifi_...() API. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @param[in] esp_netif object to detach from WiFi and destroy | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @note This API unregisters wifi handlers and detaches the created object from the wifi. | 
					
						
							|  |  |  |  * (this function is a no-operation if esp_netif is NULL) | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | void esp_netif_destroy_default_wifi(void *esp_netif); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-30 12:50:52 +01:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * @brief Creates esp_netif WiFi object based on the custom configuration. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @attention This API DOES NOT register default handlers! | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @param[in] wifi_if type of wifi interface | 
					
						
							|  |  |  |  * @param[in] esp_netif_config inherent esp-netif configuration pointer | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @return pointer to esp-netif instance | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2022-10-21 16:29:56 +02:00
										 |  |  | esp_netif_t* esp_netif_create_wifi(wifi_interface_t wifi_if, const esp_netif_inherent_config_t *esp_netif_config); | 
					
						
							| 
									
										
										
										
											2020-01-30 12:50:52 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-30 19:56:27 +01:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * @brief Creates default STA and AP network interfaces for esp-mesh. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Both netifs are almost identical to the default station and softAP, but with | 
					
						
							|  |  |  |  * DHCP client and server disabled. Please note that the DHCP client is typically | 
					
						
							|  |  |  |  * enabled only if the device is promoted to a root node. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Returns created interfaces which could be ignored setting parameters to NULL | 
					
						
							|  |  |  |  * if an application code does not need to save the interface instances | 
					
						
							|  |  |  |  * for further processing. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @param[out] p_netif_sta pointer where the resultant STA interface is saved (if non NULL) | 
					
						
							|  |  |  |  * @param[out] p_netif_ap pointer where the resultant AP interface is saved (if non NULL) | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * @return ESP_OK on success | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | esp_err_t esp_netif_create_default_wifi_mesh_netifs(esp_netif_t **p_netif_sta, esp_netif_t **p_netif_ap); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-18 08:26:00 +01:00
										 |  |  | #ifdef __cplusplus
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-04 15:02:19 +08:00
										 |  |  | #endif //_ESP_WIFI_DEFAULT_H
 |