Sat, 04 May 2019 21:18:51 +0200
Websocket interface is working for the main screen and manual mode.
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. | |
22
90f22a101fc6
Boot now checks got IP status before installing the http and vnc servers.
Michiel Broek <mbroek@mbse.eu>
parents:
1
diff
changeset
|
33 | bool STA_online; ///< Connected and online. |
0 | 34 | char STA_ssid[33]; ///< Connected to this SSID. |
35 | int8_t STA_rssi; ///< Signal strength. | |
36 | char STA_ip[16]; ///< IP address. | |
37 | char STA_nm[16]; ///< IP netmask. | |
38 | char STA_gw[16]; ///< IP gateway. | |
39 | } WIFI_State; | |
40 | ||
1
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
41 | /** |
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
42 | * @brief Update reason codes. |
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
43 | */ |
0 | 44 | typedef enum update_reason_code_t { |
45 | UPDATE_CONNECTION_OK = 0, | |
46 | UPDATE_FAILED_ATTEMPT = 1, | |
47 | UPDATE_USER_DISCONNECT = 2, | |
48 | UPDATE_LOST_CONNECTION = 3 | |
49 | } update_reason_code_t; | |
50 | ||
51 | ||
52 | ||
53 | /** | |
54 | * @brief Main task for the wifi_manager | |
55 | */ | |
1
ad2c8b13eb88
Updated lots of doxygen comments
Michiel Broek <mbroek@mbse.eu>
parents:
0
diff
changeset
|
56 | void task_wifi(void *); |
0 | 57 | |
58 | /** | |
59 | * @brief WiFi setup, init screens. | |
60 | */ | |
61 | bool WiFi_Init(void); | |
62 | ||
63 | /** | |
64 | * @brief WiFi setup, loop screens. | |
65 | */ | |
66 | bool WiFi_Loop(void); | |
67 | ||
68 | ||
69 | #endif |