ESP8266_RTOS_SDK  v1.4.0
esp_softap.h
1 /*
2  * ESPRSSIF MIT License
3  *
4  * Copyright (c) 2015 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
5  *
6  * Permission is hereby granted for use on ESPRESSIF SYSTEMS ESP8266 only, in which case,
7  * it is free of charge, to any person obtaining a copy of this software and associated
8  * documentation files (the "Software"), to deal in the Software without restriction, including
9  * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the Software is furnished
11  * to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all copies or
14  * substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22  *
23  */
24 
25 #ifndef __ESP_SOFTAP_H__
26 #define __ESP_SOFTAP_H__
27 
28 #include "queue.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
51 struct softap_config {
52  uint8 ssid[32];
53  uint8 password[64];
54  uint8 ssid_len;
55  uint8 channel;
57  uint8 ssid_hidden;
59  uint16 beacon_interval;
60 };
61 
62 struct station_info {
65  uint8 bssid[6];
66  struct ip_addr ip;
67 };
68 
77 bool wifi_softap_get_config(struct softap_config *config);
78 
88 
102 bool wifi_softap_set_config(struct softap_config *config);
103 
117 bool wifi_softap_set_config_current(struct softap_config *config);
118 
130 uint8 wifi_softap_get_station_num(void);
131 
144 
157 
172 bool wifi_softap_dhcps_start(void);
173 
182 bool wifi_softap_dhcps_stop(void);
183 
192 
203 bool wifi_softap_get_dhcps_lease(struct dhcps_lease *please);
204 
222 bool wifi_softap_set_dhcps_lease(struct dhcps_lease *please);
223 
234 
245 bool wifi_softap_set_dhcps_lease_time(uint32 minute);
246 
258 
276 bool wifi_softap_set_dhcps_offer_option(uint8 level, void *optarg);
277 
286 #ifdef __cplusplus
287 }
288 #endif
289 
290 #endif
bool wifi_softap_dhcps_start(void)
Enable the ESP8266 soft-AP DHCP server.
bool wifi_softap_set_config(struct softap_config *config)
Set the configuration of the WiFi soft-AP and save it to the Flash.
bool wifi_softap_dhcps_stop(void)
Disable the ESP8266 soft-AP DHCP server. The DHCP is enabled by default.
AUTH_MODE
Definition: esp_wifi.h:59
uint32 wifi_softap_get_dhcps_lease_time(void)
Get ESP8266 soft-AP DHCP server lease time.
uint8 ssid[32]
Definition: esp_softap.h:52
uint8 password[64]
Definition: esp_softap.h:53
Definition: esp_misc.h:88
uint8 ssid_hidden
Definition: esp_softap.h:57
uint8 channel
Definition: esp_softap.h:55
Definition: esp_softap.h:51
bool wifi_softap_get_config_default(struct softap_config *config)
Get the configuration of the ESP8266 WiFi soft-AP saved in the flash.
bool wifi_softap_set_config_current(struct softap_config *config)
Set the configuration of the WiFi soft-AP; the configuration will not be saved to the Flash...
struct station_info * wifi_softap_get_station_info(void)
Get the information of stations connected to the ESP8266 soft-AP, including MAC and IP...
uint8 ssid_len
Definition: esp_softap.h:54
bool wifi_softap_set_dhcps_lease(struct dhcps_lease *please)
Set the IP range of the ESP8266 soft-AP DHCP server.
AUTH_MODE authmode
Definition: esp_softap.h:56
bool wifi_softap_get_config(struct softap_config *config)
Get the current configuration of the ESP8266 WiFi soft-AP.
dhcp_status
Definition: esp_misc.h:83
struct ip_addr ip
Definition: esp_softap.h:66
bool wifi_softap_set_dhcps_offer_option(uint8 level, void *optarg)
Set the ESP8266 soft-AP DHCP server option.
bool wifi_softap_get_dhcps_lease(struct dhcps_lease *please)
Query the IP range that can be got from the ESP8266 soft-AP DHCP server.
uint8 max_connection
Definition: esp_softap.h:58
STAILQ_ENTRY(station_info) next
bool wifi_softap_set_dhcps_lease_time(uint32 minute)
Set ESP8266 soft-AP DHCP server lease time, default is 120 minutes.
uint8 bssid[6]
Definition: esp_softap.h:65
uint16 beacon_interval
Definition: esp_softap.h:59
enum dhcp_status wifi_softap_dhcps_status(void)
Get the ESP8266 soft-AP DHCP server status.
bool wifi_softap_reset_dhcps_lease_time(void)
Reset ESP8266 soft-AP DHCP server lease time which is 120 minutes by default.
Definition: esp_softap.h:62
void wifi_softap_free_station_info(void)
Free the space occupied by station_info when wifi_softap_get_station_info is called.
uint8 wifi_softap_get_station_num(void)
Get the number of stations connected to the ESP8266 soft-AP.