#pragma once #include #include "BleFingerprint.h" #define ONE_EURO_FCMIN 1e-1f #define ONE_EURO_BETA 1e-3f #define ONE_EURO_DCUTOFF 5e-3f #ifndef ALLOW_BLE_CONTROLLER_RESTART_AFTER_SECS #define ALLOW_BLE_CONTROLLER_RESTART_AFTER_SECS 1800 #endif struct DeviceConfig { std::string id; std::string alias; std::string name; int8_t calRssi = NO_RSSI; }; namespace BleFingerprintCollection { typedef std::function TCallbackBool; typedef std::function TCallbackFingerprint; void Setup(); void ConnectToWifi(); bool Command(std::string &command, std::string &pay); bool Config(std::string &id, std::string &json); void Close(BleFingerprint *f, bool close); void Count(BleFingerprint *f, bool counting); void Seen(BLEAdvertisedDevice *advertisedDevice); BleFingerprint *GetFingerprint(BLEAdvertisedDevice *advertisedDevice); void CleanupOldFingerprints(); const std::vector GetCopy(); bool FindDeviceConfig(const std::string &id, DeviceConfig &config); extern TCallbackBool onSeen; extern TCallbackFingerprint onAdd; extern TCallbackFingerprint onDel; extern TCallbackFingerprint onClose; extern TCallbackFingerprint onLeft; extern TCallbackFingerprint onCountAdd; extern TCallbackFingerprint onCountDel; extern std::string include, exclude, query, knownMacs, knownIrks, countIds; extern float skipDistance, maxDistance, absorption, countEnter, countExit; extern int8_t rxRefRssi, rxAdjRssi, txRefRssi; extern int forgetMs, skipMs, countMs, requeryMs; extern std::vector deviceConfigs; extern std::vector irks; extern std::vector fingerprints; } // namespace BleFingerprintCollection