WiFi Handler component  1.0
WiFi Handler component for open authenticator.
wifi_handler_station.h
Go to the documentation of this file.
1 #ifndef WIFI_HANDLER_STATION_H
2 #define WIFI_HANDLER_STATION_H
3 
4 #include <string.h>
5 #include "freertos/FreeRTOS.h"
6 #include "freertos/task.h"
7 #include "freertos/event_groups.h"
8 #include "esp_system.h"
9 #include "esp_wifi.h"
10 #include "esp_event.h"
11 #include "esp_log.h"
12 #include "esp_pm.h"
13 #include "cJSON.h"
14 #include "nvs_flash.h"
15 
16 #include "lwip/err.h"
17 #include "lwip/sys.h"
18 
19 #define WIFI_RECONNECT_RETRY_ATTEMPTS 2
20 #define WIFI_SSID_MAX_LENGTH 32
21 #define WIFI_PASS_MAX_LENGTH 64
22 #define WIFI_MAX_STATIONS 10
23 #define WIFI_MAX_STATION_INFO_STRING_SIZE 1040
24 #define WIFI_CONNECTED_BIT BIT0
25 #define WIFI_FAIL_BIT BIT1
26 #define WIFI_ERR_NOT_CONNECTED -2
27 #define WIFI_ERR_ALREADY_RUNNING -3
28 #define WIFI_ERR_STA_INFO -4
33 typedef struct wifi_station_info
34 {
35  char ssid[WIFI_SSID_MAX_LENGTH + 1];
36  char passkey[WIFI_PASS_MAX_LENGTH + 1];
38 
44 wifi_ap_record_t *get_wifi_station_info();
45 
73 esp_err_t start_wifi_station(char *wifi_station_info_json);
74 
80 esp_err_t stop_wifi_station();
81 
82 #endif
get_wifi_station_info
wifi_ap_record_t * get_wifi_station_info()
Gets the information about the currently connected access point.
Definition: wifi_handler_station.c:162
WIFI_SSID_MAX_LENGTH
#define WIFI_SSID_MAX_LENGTH
Definition: wifi_handler_station.h:20
WIFI_PASS_MAX_LENGTH
#define WIFI_PASS_MAX_LENGTH
Definition: wifi_handler_station.h:21
stop_wifi_station
esp_err_t stop_wifi_station()
disconnects from currently connected AP and turns off wifi
Definition: wifi_handler_station.c:276
wifi_station_info_t
struct wifi_station_info wifi_station_info_t
stores information about wifi access point
start_wifi_station
esp_err_t start_wifi_station(char *wifi_station_info_json)
starts wifi and connects to access points which are passed as json string to this function
Definition: wifi_handler_station.c:172