Sun, 16 Apr 2023 12:27:12 +0200
Preparations for BLE GATT. Added extra time after INA219 is powered on before measurement. Reduced LEDC frequency to 60 Hz, that makes the LED lights less nervous. Hardware mod on output 4, now needs external pulldown resistor.
4 | 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 | int8_t STA_rssi; ///< Signal strength. | |
17 | char STA_ip[17]; ///< IP address. | |
18 | char STA_nm[17]; ///< IP netmask. | |
19 | char STA_gw[17]; ///< IP gateway. | |
20 | } WIFI_State; | |
21 | ||
22 | ||
23 | ||
24 | /** | |
25 | * @brief Test if Wifi is ready and connected | |
26 | * @return Return true is connected and we have an IP address. | |
27 | */ | |
28 | bool ready_WiFi(void); | |
29 | ||
30 | ||
31 | /** | |
32 | * @brief Request a WiFi connection. | |
33 | */ | |
34 | void request_WiFi(bool connect); | |
35 | ||
36 | ||
37 | /** | |
38 | * @brief Main task for the wifi_manager | |
39 | * @param pvParameters Parameters for the task. | |
40 | */ | |
41 | void task_wifi(void *pvParameters); | |
42 | ||
43 | ||
44 | #endif |