Mon, 22 Oct 2018 21:43:45 +0200
Updated esp-ide. Removed VNC server corre encoding because no clients would use it. Enabled WiFi error logmessages. Write runtime record is now debug logging. Removed recipe.Record number, not usefull and was wrong too. Removed console print of json log data.
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 | * @brief Defines access point's maximum number of clients. | |
22 | */ | |
23 | #define AP_MAX_CONNECTIONS 4 | |
24 | ||
25 | ||
26 | /** | |
27 | * @brief Structure containing the information of the driver task. | |
28 | */ | |
29 | typedef struct { | |
30 | bool AP_active; ///< Is the AP active. | |
31 | uint8_t AP_clients; ///< Connected AP clients. | |
32 | bool STA_connected; ///< Connected to AP as station. | |
33 | char STA_ssid[33]; ///< Connected to this SSID. | |
34 | int8_t STA_rssi; ///< Signal strength. | |
35 | char STA_ip[16]; ///< IP address. | |
36 | char STA_nm[16]; ///< IP netmask. | |
37 | char STA_gw[16]; ///< IP gateway. | |
38 | } WIFI_State; | |
39 | ||
1
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
40 | /** |
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
41 | * @brief Update reason codes. |
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
42 | */ |
0 | 43 | typedef enum update_reason_code_t { |
44 | UPDATE_CONNECTION_OK = 0, | |
45 | UPDATE_FAILED_ATTEMPT = 1, | |
46 | UPDATE_USER_DISCONNECT = 2, | |
47 | UPDATE_LOST_CONNECTION = 3 | |
48 | } update_reason_code_t; | |
49 | ||
50 | ||
51 | ||
52 | /** | |
53 | * @brief Main task for the wifi_manager | |
54 | */ | |
1
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
55 | void task_wifi(void *); |
0 | 56 | |
57 | /** | |
58 | * @brief WiFi setup, init screens. | |
59 | */ | |
60 | bool WiFi_Init(void); | |
61 | ||
62 | /** | |
63 | * @brief WiFi setup, loop screens. | |
64 | */ | |
65 | bool WiFi_Loop(void); | |
66 | ||
67 | ||
68 | #endif |