Fri, 28 Jun 2024 15:33:24 +0200
Fixed changing runtime datarecord size during switching between IDF 4.2 and 5.1. Fixed wiping the /spiffs filesystem. The directory listing from the SD card doesn't overwrite parts of the screen anymore. Solved the slow speed issue with the SD card. Try to force the SD card to operate at 20 MHz. More project settings changed to improve performance and memory usage.
0 | 1 | /** |
2 | * @file task_wifi.h | |
3 | * @brief WiFi task. Connects to a known Access Point. If we know more then | |
4 | * one AP, try to connect all of them until it succeeds (Not yet written). | |
5 | */ | |
6 | ||
7 | #ifndef _TASK_WIFI_H | |
8 | #define _TASK_WIFI_H | |
9 | ||
10 | ||
11 | /** | |
12 | * @brief Defines the maximum number of access points that can be scanned. | |
13 | * | |
14 | * To save memory and avoid nasty out of memory errors, | |
15 | * we can limit the number of APs detected in a wifi scan. | |
16 | * The display can handle 7 entries, allow a few more. | |
17 | */ | |
18 | #define MAX_AP_NUM 10 | |
19 | ||
20 | ||
21 | /** | |
22 | * @brief Structure containing the information of the driver task. | |
23 | */ | |
24 | typedef struct { | |
25 | bool STA_connected; ///< Connected to AP as station. | |
22
90f22a101fc6
Boot now checks got IP status before installing the http and vnc servers.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
26 | bool STA_online; ///< Connected and online. |
0 | 27 | char STA_ssid[33]; ///< Connected to this SSID. |
28 | int8_t STA_rssi; ///< Signal strength. | |
56
756d1a63d129
Adjusted more strings for new compiler warnings. There should now be no buffer overflows in the app. Changed the date display on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
22
diff
changeset
|
29 | char STA_ip[17]; ///< IP address. |
756d1a63d129
Adjusted more strings for new compiler warnings. There should now be no buffer overflows in the app. Changed the date display on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
22
diff
changeset
|
30 | char STA_nm[17]; ///< IP netmask. |
756d1a63d129
Adjusted more strings for new compiler warnings. There should now be no buffer overflows in the app. Changed the date display on the mainscreen.
Michiel Broek <mbroek@mbse.eu>
parents:
22
diff
changeset
|
31 | char STA_gw[17]; ///< IP gateway. |
0 | 32 | } WIFI_State; |
33 | ||
1
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
34 | /** |
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
35 | * @brief Update reason codes. |
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
36 | */ |
0 | 37 | typedef enum update_reason_code_t { |
38 | UPDATE_CONNECTION_OK = 0, | |
39 | UPDATE_FAILED_ATTEMPT = 1, | |
40 | UPDATE_USER_DISCONNECT = 2, | |
41 | UPDATE_LOST_CONNECTION = 3 | |
42 | } update_reason_code_t; | |
43 | ||
44 | ||
45 | ||
46 | /** | |
47 | * @brief Main task for the wifi_manager | |
48 | */ | |
1
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
49 | void task_wifi(void *); |
0 | 50 | |
51 | /** | |
52 | * @brief WiFi setup, init screens. | |
53 | */ | |
54 | bool WiFi_Init(void); | |
55 | ||
56 | /** | |
57 | * @brief WiFi setup, loop screens. | |
58 | */ | |
59 | bool WiFi_Loop(void); | |
60 | ||
61 | ||
62 | #endif |