|
1 /** |
|
2 * @file task_wifi.h |
|
3 * @brief WiFi task. Connect to the known AP with the strongest signal. |
|
4 */ |
|
5 |
|
6 #ifndef _TASK_WIFI_H |
|
7 #define _TASK_WIFI_H |
|
8 |
|
9 |
|
10 /** |
|
11 * @brief Structure containing the information of the driver task. |
|
12 */ |
|
13 typedef struct { |
|
14 bool STA_connected; ///< Connected to AP as station. |
|
15 bool STA_online; ///< Connected and online. |
|
16 char STA_ssid[33]; ///< Connected to this SSID. |
|
17 char STA_bssid[18]; ///< Connected to this BSSID. |
|
18 int8_t STA_rssi; ///< Signal strength. |
|
19 uint8_t STA_channel; ///< Connected channel. |
|
20 char STA_ip[17]; ///< IP address. |
|
21 char STA_nm[17]; ///< IP netmask. |
|
22 char STA_gw[17]; ///< IP gateway. |
|
23 } WIFI_State; |
|
24 |
|
25 |
|
26 |
|
27 /** |
|
28 * @brief Test if Wifi is ready and connected |
|
29 * @return Return true is connected and we have an IP address. |
|
30 */ |
|
31 bool ready_WiFi(void); |
|
32 |
|
33 |
|
34 /** |
|
35 * @brief Signal to update the WiFi rssi status. |
|
36 */ |
|
37 void status_WiFi(void); |
|
38 |
|
39 |
|
40 /** |
|
41 * @brief Request a WiFi connection. |
|
42 */ |
|
43 void request_WiFi(void); |
|
44 |
|
45 |
|
46 /** |
|
47 * @brief Request a WiFi scan. |
|
48 */ |
|
49 void scan_WiFi(void); |
|
50 |
|
51 |
|
52 /** |
|
53 * @brief Request WiFi disconnect. |
|
54 */ |
|
55 void disconnect_WiFi(void); |
|
56 |
|
57 |
|
58 /** |
|
59 * @brief Main task for the wifi_manager |
|
60 * @param pvParameters Parameters for the task. |
|
61 */ |
|
62 void task_wifi(void *pvParameters); |
|
63 |
|
64 |
|
65 #endif |