-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwifi_scan_page.h
More file actions
51 lines (39 loc) · 914 Bytes
/
Copy pathwifi_scan_page.h
File metadata and controls
51 lines (39 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef WIFI_PAGE_H
#define WIFI_PAGE_H
#include "menu_option.h"
#include "page.h"
#include "state.h"
#define FIRST_SCAN_MIN 20
#define FIRST_SCAN_MAX 20
#define SCAN_MIN 100
#define SCAN_MAX 200
struct WifiAP {
char ssid[33]; // 32 chars + null term
int32_t rssi;
int32_t channel;
};
class WiFiPage : public Page {
private:
WiFiPage();
std::vector<WifiAP> access_points;
int selected_index = 0;
int scroll_offset = 0;
bool scanning = false;
TaskHandle_t scan_task_handle = nullptr;
SemaphoreHandle_t data_mutex = nullptr;
static void scan_task_entry(void *pvParameters);
void scan_task_loop();
bool inited = false;
bool first_scan = true;
bool init();
public:
static WiFiPage *instance() {
static WiFiPage sp;
return &sp;
}
void on_enter() override;
void on_exit() override;
void draw() override;
void handle_input(InputEvent *ev) override;
};
#endif