Merge pull request #514 from iranl/esp-nimble-nuki-ble-update
Update esp-nimble-cpp and Nuki BLE
This commit is contained in:
@@ -21,7 +21,7 @@ Scanner::Scanner(int reservedSubscribers) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Scanner::initialize(const std::string& deviceName, const bool wantDuplicates, const uint16_t interval, const uint16_t window) {
|
void Scanner::initialize(const std::string& deviceName, const bool wantDuplicates, const uint16_t interval, const uint16_t window) {
|
||||||
if (!BLEDevice::getInitialized()) {
|
if (!BLEDevice::isInitialized()) {
|
||||||
if (wantDuplicates) {
|
if (wantDuplicates) {
|
||||||
// reduce memory footprint, cache is not used anyway
|
// reduce memory footprint, cache is not used anyway
|
||||||
#ifdef CONFIG_BTDM_BLE_SCAN_DUPL
|
#ifdef CONFIG_BTDM_BLE_SCAN_DUPL
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#define NUKI_HUB_VERSION "9.02"
|
#define NUKI_HUB_VERSION "9.02"
|
||||||
#define NUKI_HUB_BUILD "unknownbuildnr"
|
#define NUKI_HUB_BUILD "unknownbuildnr"
|
||||||
#define NUKI_HUB_DATE "2024-11-08"
|
#define NUKI_HUB_DATE "2024-11-11"
|
||||||
|
|
||||||
#define GITHUB_LATEST_RELEASE_URL (char*)"https://github.com/technyon/nuki_hub/releases/latest"
|
#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"
|
#define GITHUB_OTA_MANIFEST_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/manifest.json"
|
||||||
|
|||||||
@@ -272,9 +272,8 @@ void NukiOpenerWrapper::update()
|
|||||||
}
|
}
|
||||||
if(_statusUpdated || _nextLockStateUpdateTs == 0 || ts >= _nextLockStateUpdateTs || (queryCommands & QUERY_COMMAND_LOCKSTATE) > 0)
|
if(_statusUpdated || _nextLockStateUpdateTs == 0 || ts >= _nextLockStateUpdateTs || (queryCommands & QUERY_COMMAND_LOCKSTATE) > 0)
|
||||||
{
|
{
|
||||||
updateKeyTurnerState();
|
_statusUpdated = updateKeyTurnerState();
|
||||||
_nextLockStateUpdateTs = ts + _intervalLockstate * 1000;
|
_nextLockStateUpdateTs = ts + _intervalLockstate * 1000;
|
||||||
_statusUpdated = false;
|
|
||||||
_network->publishStatusUpdated(_statusUpdated);
|
_network->publishStatusUpdated(_statusUpdated);
|
||||||
}
|
}
|
||||||
if(_network->mqttConnectionState() == 2)
|
if(_network->mqttConnectionState() == 2)
|
||||||
@@ -418,8 +417,9 @@ void NukiOpenerWrapper::unpair()
|
|||||||
_paired = false;
|
_paired = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NukiOpenerWrapper::updateKeyTurnerState()
|
bool NukiOpenerWrapper::updateKeyTurnerState()
|
||||||
{
|
{
|
||||||
|
bool updateStatus = false;
|
||||||
Nuki::CmdResult result = (Nuki::CmdResult)-1;
|
Nuki::CmdResult result = (Nuki::CmdResult)-1;
|
||||||
int retryCount = 0;
|
int retryCount = 0;
|
||||||
|
|
||||||
@@ -445,7 +445,7 @@ void NukiOpenerWrapper::updateKeyTurnerState()
|
|||||||
{
|
{
|
||||||
_nextLockStateUpdateTs = espMillis() + _retryDelay;
|
_nextLockStateUpdateTs = espMillis() + _retryDelay;
|
||||||
}
|
}
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
_retryLockstateCount = 0;
|
_retryLockstateCount = 0;
|
||||||
|
|
||||||
@@ -491,6 +491,7 @@ void NukiOpenerWrapper::updateKeyTurnerState()
|
|||||||
|
|
||||||
postponeBleWatchdog();
|
postponeBleWatchdog();
|
||||||
Log->println(F("Done querying opener state"));
|
Log->println(F("Done querying opener state"));
|
||||||
|
return updateStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NukiOpenerWrapper::updateBatteryState()
|
void NukiOpenerWrapper::updateBatteryState()
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ private:
|
|||||||
void onTimeControlCommandReceived(const char* value);
|
void onTimeControlCommandReceived(const char* value);
|
||||||
void onAuthCommandReceived(const char* value);
|
void onAuthCommandReceived(const char* value);
|
||||||
|
|
||||||
void updateKeyTurnerState();
|
bool updateKeyTurnerState();
|
||||||
void updateBatteryState();
|
void updateBatteryState();
|
||||||
void updateConfig();
|
void updateConfig();
|
||||||
void updateAuthData(bool retrieved);
|
void updateAuthData(bool retrieved);
|
||||||
|
|||||||
@@ -291,8 +291,7 @@ void NukiWrapper::update()
|
|||||||
if(_nukiOfficial->getStatusUpdated() || _statusUpdated || _nextLockStateUpdateTs == 0 || ts >= _nextLockStateUpdateTs || (queryCommands & QUERY_COMMAND_LOCKSTATE) > 0)
|
if(_nukiOfficial->getStatusUpdated() || _statusUpdated || _nextLockStateUpdateTs == 0 || ts >= _nextLockStateUpdateTs || (queryCommands & QUERY_COMMAND_LOCKSTATE) > 0)
|
||||||
{
|
{
|
||||||
Log->println("Updating Lock state based on status, timer or query");
|
Log->println("Updating Lock state based on status, timer or query");
|
||||||
updateKeyTurnerState();
|
_statusUpdated = updateKeyTurnerState();
|
||||||
_statusUpdated = false;
|
|
||||||
_nextLockStateUpdateTs = ts + _intervalLockstate * 1000;
|
_nextLockStateUpdateTs = ts + _intervalLockstate * 1000;
|
||||||
_network->publishStatusUpdated(_statusUpdated);
|
_network->publishStatusUpdated(_statusUpdated);
|
||||||
}
|
}
|
||||||
@@ -427,8 +426,9 @@ void NukiWrapper::unpair()
|
|||||||
_paired = false;
|
_paired = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NukiWrapper::updateKeyTurnerState()
|
bool NukiWrapper::updateKeyTurnerState()
|
||||||
{
|
{
|
||||||
|
bool updateStatus = false;
|
||||||
Nuki::CmdResult result = (Nuki::CmdResult)-1;
|
Nuki::CmdResult result = (Nuki::CmdResult)-1;
|
||||||
int retryCount = 0;
|
int retryCount = 0;
|
||||||
|
|
||||||
@@ -460,7 +460,7 @@ void NukiWrapper::updateKeyTurnerState()
|
|||||||
Log->println("ms");
|
Log->println("ms");
|
||||||
_nextLockStateUpdateTs = espMillis() + _retryDelay;
|
_nextLockStateUpdateTs = espMillis() + _retryDelay;
|
||||||
}
|
}
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
_retryLockstateCount = 0;
|
_retryLockstateCount = 0;
|
||||||
@@ -489,7 +489,7 @@ void NukiWrapper::updateKeyTurnerState()
|
|||||||
}
|
}
|
||||||
else if(!_nukiOfficial->getOffConnected() && espMillis() < _statusUpdatedTs + 10000)
|
else if(!_nukiOfficial->getOffConnected() && espMillis() < _statusUpdatedTs + 10000)
|
||||||
{
|
{
|
||||||
_statusUpdated = true;
|
updateStatus = true;
|
||||||
Log->println(F("Lock: Keep updating status on intermediate lock state"));
|
Log->println(F("Lock: Keep updating status on intermediate lock state"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -501,6 +501,7 @@ void NukiWrapper::updateKeyTurnerState()
|
|||||||
|
|
||||||
postponeBleWatchdog();
|
postponeBleWatchdog();
|
||||||
Log->println(F("Done querying lock state"));
|
Log->println(F("Done querying lock state"));
|
||||||
|
return updateStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NukiWrapper::updateBatteryState()
|
void NukiWrapper::updateBatteryState()
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ private:
|
|||||||
void onAuthCommandReceived(const char* value);
|
void onAuthCommandReceived(const char* value);
|
||||||
void onGpioActionReceived(const GpioAction& action, const int& pin);
|
void onGpioActionReceived(const GpioAction& action, const int& pin);
|
||||||
|
|
||||||
void updateKeyTurnerState();
|
bool updateKeyTurnerState();
|
||||||
void updateBatteryState();
|
void updateBatteryState();
|
||||||
void updateConfig();
|
void updateConfig();
|
||||||
void updateAuthData(bool retrieved);
|
void updateAuthData(bool retrieved);
|
||||||
|
|||||||
@@ -4063,10 +4063,10 @@ esp_err_t WebCfgServer::buildInfoHtml(PsychicRequest *request)
|
|||||||
if(esp_psram_get_size() > 0)
|
if(esp_psram_get_size() > 0)
|
||||||
{
|
{
|
||||||
response.print("\nPSRAM Available: Yes");
|
response.print("\nPSRAM Available: Yes");
|
||||||
response.print("\nTotal PSRAM: ");
|
|
||||||
response.print(esp_psram_get_size());
|
|
||||||
response.print("\nFree PSRAM: ");
|
response.print("\nFree PSRAM: ");
|
||||||
response.print((esp_get_free_heap_size() - ESP.getFreeHeap()));
|
response.print((esp_get_free_heap_size() - ESP.getFreeHeap()));
|
||||||
|
response.print("\nTotal PSRAM: ");
|
||||||
|
response.print(esp_psram_get_size());
|
||||||
response.print("\nTotal free heap: ");
|
response.print("\nTotal free heap: ");
|
||||||
response.print(esp_get_free_heap_size());
|
response.print(esp_get_free_heap_size());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ dependencies:
|
|||||||
|
|
||||||
esp-nimble-cpp:
|
esp-nimble-cpp:
|
||||||
git: https://github.com/h2zero/esp-nimble-cpp.git
|
git: https://github.com/h2zero/esp-nimble-cpp.git
|
||||||
version: 758c4d0471cca8a00c8652aac2e16940ecb30cb3
|
version: 020c61700dce2174769f855d45ab0ea70a2aaac4
|
||||||
|
|
||||||
espressif/libsodium: "^1.0.20~1"
|
espressif/libsodium: "^1.0.20~1"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user