fix presence detection

This commit is contained in:
technyon
2024-06-15 08:18:12 +02:00
parent a419447f9e
commit 705e0971d7
7 changed files with 47 additions and 75 deletions

View File

@@ -1,8 +1,9 @@
#pragma once
#include <Preferences.h>
#include "BleScanner.h"
#include "BleInterfaces.h"
#include "Network.h"
#include <memory>
struct PdDevice
{
@@ -16,11 +17,12 @@ struct PdDevice
class PresenceDetection : public BleScanner::Subscriber
{
public:
PresenceDetection(Preferences* preferences, BleScanner::Scanner* bleScanner, Network* network, char* buffer, size_t bufferSize);
PresenceDetection(Preferences* preferences, BleScanner::Scanner* bleScanner, char* buffer, size_t bufferSize);
virtual ~PresenceDetection();
void initialize();
void update();
char* generateCsv();
bool enabled();
void onResult(NimBLEAdvertisedDevice* advertisedDevice) override;
@@ -29,7 +31,6 @@ private:
Preferences* _preferences;
BleScanner::Scanner* _bleScanner;
Network* _network;
char* _csv = {0};
size_t _bufferSize = 0;
std::map<long long, std::shared_ptr<PdDevice>> _devices;