From 3959c9a5595dad5c9d56833e8136af85177dd04d Mon Sep 17 00:00:00 2001 From: technyon Date: Wed, 6 Apr 2022 18:33:04 +0200 Subject: [PATCH] change device name to NukiHub --- NukiWrapper.cpp | 7 ++++--- NukiWrapper.h | 3 ++- main.cpp | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/NukiWrapper.cpp b/NukiWrapper.cpp index 029406d..578e098 100644 --- a/NukiWrapper.cpp +++ b/NukiWrapper.cpp @@ -4,8 +4,9 @@ NukiWrapper* nukiInst; -NukiWrapper::NukiWrapper(const std::string& name, uint32_t id, Network* network, Preferences* preferences) -: _nukiBle(name, id), +NukiWrapper::NukiWrapper(const std::string& deviceName, uint32_t id, Network* network, Preferences* preferences) +: _deviceName(deviceName), + _nukiBle(deviceName, id), _network(network), _preferences(preferences) { @@ -30,7 +31,7 @@ NukiWrapper::~NukiWrapper() void NukiWrapper::initialize() { _bleScanner = new BleScanner(); - _bleScanner->initialize(); + _bleScanner->initialize(_deviceName); _bleScanner->setScanDuration(10); _nukiBle.initialize(); _nukiBle.registerBleScanner(_bleScanner); diff --git a/NukiWrapper.h b/NukiWrapper.h index c019cf8..f420ac8 100644 --- a/NukiWrapper.h +++ b/NukiWrapper.h @@ -8,7 +8,7 @@ class NukiWrapper : public Nuki::SmartlockEventHandler { public: - NukiWrapper(const std::string& name, uint32_t id, Network* network, Preferences* preferences); + NukiWrapper(const std::string& deviceName, uint32_t id, Network* network, Preferences* preferences); virtual ~NukiWrapper(); void initialize(); @@ -28,6 +28,7 @@ private: Nuki::LockAction lockActionToEnum(const char* str); // char array at least 14 characters + std::string _deviceName; Nuki::NukiBle _nukiBle; BleScanner* _bleScanner; Network* _network; diff --git a/main.cpp b/main.cpp index f839118..8f7de36 100644 --- a/main.cpp +++ b/main.cpp @@ -74,7 +74,7 @@ void setup() preferences->putUInt(preference_deviceId, deviceId); } - nuki = new NukiWrapper("ESP", deviceId, network, preferences); + nuki = new NukiWrapper("NukiHub", deviceId, network, preferences); webCfgServer = new WebCfgServer(nuki, network, preferences); webCfgServer->initialize(); nuki->initialize();