31 #ifndef WIFI_MANAGER_H 32 #define WIFI_MANAGER_H 39 #define WIFIMGR_MACADDR_LEN 6 40 #define WIFIMGR_MACADDR_STR_LEN 17 41 #define WIFIMGR_SSID_LEN 32 42 #define WIFIMGR_PASSPHRASE_LEN 64 63 WIFI_MANAGER_FAIL = -1,
65 WIFI_MANAGER_INVALID_ARGS,
66 WIFI_MANAGER_INITIALIZED,
67 WIFI_MANAGER_DEINITIALIZED,
70 WIFI_MANAGER_ALREADY_CONNECTED,
77 WIFI_MANAGER_DISCONNECT,
78 WIFI_MANAGER_RECONNECT,
140 char ssid[WIFIMGR_SSID_LEN + 1];
141 char bssid[WIFIMGR_MACADDR_STR_LEN + 1];
158 void (*softap_sta_joined)(void);
159 void (*softap_sta_left)(void);
167 char ip4_address[WIFIMGR_MACADDR_STR_LEN + 1];
168 char ssid[WIFIMGR_SSID_LEN + 1];
169 char mac_address[WIFIMGR_MACADDR_LEN + 1];
171 connect_status_e status;
172 wifi_manager_mode_e mode;
179 char ssid[WIFIMGR_SSID_LEN + 1];
180 char passphrase[WIFIMGR_PASSPHRASE_LEN + 1];
188 wifi_manager_reconn_type_e type;
201 char ssid[WIFIMGR_SSID_LEN + 1];
203 char passphrase[WIFIMGR_PASSPHRASE_LEN + 1];
214 uint16_t connectfail;
wifi_manager_result_e wifi_manager_get_info(wifi_manager_info_s *info)
Retrieve current status of Wi-Fi interface including mode, connection status, ssid, received signal strengh indication, and ip address.
wifi_manager_result_e wifi_manager_deinit(void)
Deinitialize Wi-Fi Manager including stoping Wi-Fi interface.
wifi_manager_result_e wifi_manager_get_stats(wifi_manager_stats_s *stats)
Obtain WiFi Manager state stats.
wifi_manager_result_e wifi_manager_init(wifi_manager_cb_s *wmcb)
Initialize Wi-Fi Manager including starting Wi-Fi interface.
wifi_manager_ap_auth_type_e ap_auth_type
wifi_manager_ap_crypto_type_e ap_crypto_type
wifi_manager_mode_e
Mode of Wi-Fi interface such as station mode or ap mode.
wifi_manager_result_e wifi_manager_get_connected_config(wifi_manager_ap_config_s *config)
Get the most recently connected AP configuration which was saved by Wi-Fi Manager.
wifi_manager_result_e wifi_manager_connect_ap(wifi_manager_ap_config_s *config)
Connect to an access point.
Specify the policy of reconnect when the device is disconnected.
wifi_manager_result_e wifi_manager_get_config(wifi_manager_ap_config_s *config)
Get the AP configuration which was saved.
wifi_manager_result_e wifi_manager_connect_ap_config(wifi_manager_ap_config_s *config, wifi_manager_reconnect_config_s *reconn_config)
Connect to an access point.
wifi_manager_ap_auth_type_e ap_auth_type
wifi_manager_result_e wifi_manager_disconnect_ap(void)
Disconnect from the connected access point.
wifi_manager_ap_crypto_type_e ap_crypto_type
wifi_manager_result_e wifi_manager_scan_ap(void)
Scan nearby access points.
wifi_manager_result_e wifi_manager_remove_config(void)
Remove the AP configuration which was saved.
wifi_manager_result_e
Result types of Wi-Fi Manager APIs such as FAIL, SUCCESS, or INVALID ARGS.
wifi_manager_result_e wifi_manager_save_config(wifi_manager_ap_config_s *config)
Save the AP configuration at persistent storage.
Specify information of soft access point (softAP) such as ssid and channel number.
Keep information of nearby access points as scan results.
Include callback functions which are asynchronously called after Wi-Fi Manager APIs are called...
wifi_manager_scan_result_e
Result types of nearby access point scanning.
wifi_manager_reconn_type_e
Reconnection mode of Wi-Fi interface.
wifi_manager_ap_crypto_type_e
Wi-Fi encryption type such as WEP, AES, or TKIP.
wifi_manager_ap_auth_type_e
Wi-Fi authentication type such as WPA, WPA2, or WPS.
Specify which access point (AP) a client connects to.
connect_status_e
Status of Wi-Fi interface such as connected or disconnected.
wifi_manager_disconnect_e
Wi-Fi disconnect event reason.
unsigned int passphrase_length
wifi_manager_result_e wifi_manager_set_mode(wifi_manager_mode_e mode, wifi_manager_softap_config_s *config)
Change the Wi-Fi mode to station or AP.
Keep Wi-Fi Manager information including ip/mac address, ssid, rssi, etc.
Specify Wi-Fi Manager internal stats information.