ESP8266_RTOS_SDK v1.4.0

- Main Page
- Modules
- Data Structures
- Files

- File List

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;
56 AUTH_MODE authmode;
57 uint8 ssid_hidden;
58 uint8 max_connection;
59 uint16 beacon_interval;
60 };
61
62 struct station_info {
63 STAILQ_ENTRY(station_info) next;
65 uint8 bssid[6];
66 struct ip_addr ip;
67 };
68
77 bool wifi_softap_get_config(struct softap_config *config);
78
87 bool wifi_softap_get_config_default(struct softap_config *config);
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
143 struct station_info *wifi_softap_get_station_info(void);
144
156 void wifi_softap_free_station_info(void);
157
172 bool wifi_softap_dhcps_start(void);
173
182 bool wifi_softap_dhcps_stop(void);
183
191 enum dhcp_status wifi_softap_dhcps_status(void);
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
233 uint32 wifi_softap_get_dhcps_lease_time(void);
234
245 bool wifi_softap_set_dhcps_lease_time(uint32 minute);
246
257 bool wifi_softap_reset_dhcps_lease_time(void);
258
276 bool wifi_softap_set_dhcps_offer_option(uint8 level, void *optarg);
277
286 #ifdef __cplusplus
287 }
288 #endif
289
290 #endif
wifi_softap_dhcps_start
bool wifi_softap_dhcps_start(void)
Enable the ESP8266 soft-AP DHCP server.
wifi_softap_set_config
bool wifi_softap_set_config(struct softap_config *config)
Set the configuration of the WiFi soft-AP and save it to the Flash.
wifi_softap_dhcps_stop
bool wifi_softap_dhcps_stop(void)
Disable the ESP8266 soft-AP DHCP server. The DHCP is enabled by default.
AUTH_MODE
AUTH_MODE
Definition: esp_wifi.h:59
wifi_softap_get_dhcps_lease_time
uint32 wifi_softap_get_dhcps_lease_time(void)
Get ESP8266 soft-AP DHCP server lease time.
softap_config::ssid
uint8 ssid[32]
Definition: esp_softap.h:52
softap_config::password
uint8 password[64]
Definition: esp_softap.h:53
dhcps_lease
Definition: esp_misc.h:88
softap_config::ssid_hidden
uint8 ssid_hidden
Definition: esp_softap.h:57
softap_config::channel
uint8 channel
Definition: esp_softap.h:55
softap_config
Definition: esp_softap.h:51
wifi_softap_get_config_default
bool wifi_softap_get_config_default(struct softap_config *config)
Get the configuration of the ESP8266 WiFi soft-AP saved in the flash.
wifi_softap_set_config_current
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...
wifi_softap_get_station_info
struct station_info * wifi_softap_get_station_info(void)
Get the information of stations connected to the ESP8266 soft-AP, including MAC and IP...
softap_config::ssid_len
uint8 ssid_len
Definition: esp_softap.h:54
wifi_softap_set_dhcps_lease
bool wifi_softap_set_dhcps_lease(struct dhcps_lease *please)
Set the IP range of the ESP8266 soft-AP DHCP server.
softap_config::authmode
AUTH_MODE authmode
Definition: esp_softap.h:56
wifi_softap_get_config
bool wifi_softap_get_config(struct softap_config *config)
Get the current configuration of the ESP8266 WiFi soft-AP.
dhcp_status
dhcp_status
Definition: esp_misc.h:83
station_info::ip
struct ip_addr ip
Definition: esp_softap.h:66
wifi_softap_set_dhcps_offer_option
bool wifi_softap_set_dhcps_offer_option(uint8 level, void *optarg)
Set the ESP8266 soft-AP DHCP server option.
wifi_softap_get_dhcps_lease
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.
softap_config::max_connection
uint8 max_connection
Definition: esp_softap.h:58
station_info::STAILQ_ENTRY
STAILQ_ENTRY(station_info) next
wifi_softap_set_dhcps_lease_time
bool wifi_softap_set_dhcps_lease_time(uint32 minute)
Set ESP8266 soft-AP DHCP server lease time, default is 120 minutes.
station_info::bssid
uint8 bssid[6]
Definition: esp_softap.h:65
softap_config::beacon_interval
uint16 beacon_interval
Definition: esp_softap.h:59
wifi_softap_dhcps_status
enum dhcp_status wifi_softap_dhcps_status(void)
Get the ESP8266 soft-AP DHCP server status.
wifi_softap_reset_dhcps_lease_time
bool wifi_softap_reset_dhcps_lease_time(void)
Reset ESP8266 soft-AP DHCP server lease time which is 120 minutes by default.
station_info
Definition: esp_softap.h:62
wifi_softap_free_station_info
void wifi_softap_free_station_info(void)
Free the space occupied by station_info when wifi_softap_get_station_info is called.
wifi_softap_get_station_num
uint8 wifi_softap_get_station_num(void)
Get the number of stations connected to the ESP8266 soft-AP.