From 61ec2921003c4bd755f34de8219992d94005a26a Mon Sep 17 00:00:00 2001 From: iranl Date: Wed, 18 Jun 2025 12:23:26 +0200 Subject: [PATCH] C5 --- README.md | 2 +- lib/BleScanner/src/BleScanner.cpp | 16 ++++------------ lib/BleScanner/src/BleScanner.h | 2 +- lib/nuki_ble | 2 +- src/Config.h | 2 +- 5 files changed, 8 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 1e20d16..5b44d6c 100644 --- a/README.md +++ b/README.md @@ -201,7 +201,7 @@ On version >=9.10 of Nuki Hub with only a Nuki Lock connected the expected free - ESP32: 70.000 bytes - ESP32 with PSRAM: 110.000 bytes + PSRAM - ESP32-C3: 90.000 bytes -- ESP32-C5: TBD bytes +- ESP32-C5: 110.000 bytes - ESP32-C6: 200.000 bytes - ESP32-S3 130.000 bytes - ESP32-S3 with PSRAM: 180.000 bytes + PSRAM diff --git a/lib/BleScanner/src/BleScanner.cpp b/lib/BleScanner/src/BleScanner.cpp index 4469071..1d1d997 100644 --- a/lib/BleScanner/src/BleScanner.cpp +++ b/lib/BleScanner/src/BleScanner.cpp @@ -31,17 +31,16 @@ Scanner::~Scanner() { } void Scanner::initialize(const std::string& deviceName, const bool wantDuplicates, const uint16_t interval, const uint16_t window) { - if (!BLEDevice::isInitialized()) { + if (!NimBLEDevice::isInitialized()) { if (wantDuplicates) { - // reduce memory footprint, cache is not used anyway #ifdef CONFIG_BTDM_BLE_SCAN_DUPL NimBLEDevice::setScanDuplicateCacheSize(10); #endif } - BLEDevice::init(deviceName); + NimBLEDevice::init(deviceName); } - bleScan = BLEDevice::getScan(); + bleScan = NimBLEDevice::getScan(); #ifndef BLESCANNER_USE_LATEST_NIMBLE bleScan->setAdvertisedDeviceCallbacks(this, wantDuplicates); @@ -59,7 +58,6 @@ void Scanner::update() { } if (scanDuration == 0) { - // Avoid unbridled growth of results vector bleScan->setMaxResults(0); } else { log_w("Ble scanner max results not 0. Be aware of memory issue due to unbridled growth of results vector"); @@ -70,12 +68,6 @@ void Scanner::update() { #else bool result = bleScan->start(scanDuration * 1000, false); #endif - // if (!result) { - // scanErrors++; - // if (scanErrors % 100 == 0) { - // log_w("BLE Scan error (100x)"); - // } - // } } void Scanner::enableScanning(bool enable) { @@ -110,7 +102,7 @@ void Scanner::onResult(const NimBLEAdvertisedDevice* advertisedDevice) { } void Scanner::whitelist(BLEAddress bleAddress) { - BLEDevice::whiteListAdd(bleAddress); + NimBLEDevice::whiteListAdd(bleAddress); bleScan->setFilterPolicy(BLE_HCI_SCAN_FILT_USE_WL); } diff --git a/lib/BleScanner/src/BleScanner.h b/lib/BleScanner/src/BleScanner.h index 266c5a0..9a9a10f 100644 --- a/lib/BleScanner/src/BleScanner.h +++ b/lib/BleScanner/src/BleScanner.h @@ -95,7 +95,7 @@ class Scanner : public Publisher, BLEAdvertisedDeviceCallbacks { private: uint32_t scanDuration = 0; //default indefinite scanning time - BLEScan* bleScan = nullptr; + NimBLEScan* bleScan = nullptr; std::vector subscribers; uint16_t scanErrors = 0; bool scanningEnabled = true; diff --git a/lib/nuki_ble b/lib/nuki_ble index 893b6bb..01c81b5 160000 --- a/lib/nuki_ble +++ b/lib/nuki_ble @@ -1 +1 @@ -Subproject commit 893b6bb7f0768bb474d738b437b37813d4112e4a +Subproject commit 01c81b52b2ede42d8742dd0b5dff7e7b5813cf4d diff --git a/src/Config.h b/src/Config.h index a482d15..99ee1ea 100644 --- a/src/Config.h +++ b/src/Config.h @@ -5,7 +5,7 @@ #define NUKI_HUB_VERSION "9.11" #define NUKI_HUB_VERSION_INT (uint32_t)911 #define NUKI_HUB_BUILD "unknownbuildnr" -#define NUKI_HUB_DATE "2025-06-17" +#define NUKI_HUB_DATE "2025-06-18" #define GITHUB_LATEST_RELEASE_URL (char*)"https://github.com/technyon/nuki_hub/releases/latest" #define GITHUB_OTA_MANIFEST_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/manifest.json"