@@ -2,33 +2,12 @@
|
||||
|
||||
#include <WiFiUdp.h>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include "NodeInfo.h"
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <initializer_list>
|
||||
#include "Config.h"
|
||||
|
||||
// Forward declaration
|
||||
class TaskManager;
|
||||
|
||||
// WiFi access point structure
|
||||
struct WiFiAccessPoint {
|
||||
String ssid;
|
||||
int32_t rssi;
|
||||
uint8_t encryption;
|
||||
uint8_t* bssid;
|
||||
int32_t channel;
|
||||
bool isHidden;
|
||||
|
||||
WiFiAccessPoint() : rssi(0), encryption(0), bssid(nullptr), channel(0), isHidden(false) {}
|
||||
~WiFiAccessPoint() {
|
||||
if (bssid) {
|
||||
delete[] bssid;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class NodeContext {
|
||||
public:
|
||||
NodeContext();
|
||||
@@ -40,14 +19,10 @@ public:
|
||||
NodeInfo self;
|
||||
std::map<String, NodeInfo>* memberList;
|
||||
Config config;
|
||||
TaskManager* taskManager;
|
||||
|
||||
using EventCallback = std::function<void(void*)>;
|
||||
std::map<std::string, std::vector<EventCallback>> eventRegistry;
|
||||
|
||||
void on(const std::string& event, EventCallback cb);
|
||||
void fire(const std::string& event, void* data);
|
||||
|
||||
// WiFi access points storage
|
||||
std::vector<WiFiAccessPoint>* wifiAccessPoints;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user