Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
technyon committed Jun 29, 2024
2 parents f65f23f + 0ebea6a commit 2f1dc82
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
7 changes: 5 additions & 2 deletions src/NukiBle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ PairingResult NukiBle::pairNuki(AuthorizationIdType idType) {
return PairingResult::Success;
}
PairingResult result = PairingResult::Pairing;

if (pairingLastSeen < millis() - 2000) pairingServiceAvailable = false;

if (pairingLastSeen < millis() - 2000) pairingServiceAvailable = false;

Expand All @@ -101,7 +103,7 @@ PairingResult NukiBle::pairNuki(AuthorizationIdType idType) {
PairingState nukiPairingState = PairingState::InitPairing;
do {
nukiPairingState = pairStateMachine(nukiPairingState);
extendDisonnectTimeout();
extendDisconnectTimeout();
delay(50);
} while ((nukiPairingState != PairingState::Success) && (nukiPairingState != PairingState::Timeout));

Expand All @@ -112,6 +114,7 @@ PairingResult NukiBle::pairNuki(AuthorizationIdType idType) {
} else {
result = PairingResult::Timeout;
}
extendDisconnectTimeout();
}
} else {
#ifdef DEBUG_NUKI_CONNECT
Expand Down Expand Up @@ -213,7 +216,7 @@ void NukiBle::setConnectRetries(uint8_t retries) {
connectRetries = retries;
}

void NukiBle::extendDisonnectTimeout() {
void NukiBle::extendDisconnectTimeout() {
lastStartTimeout = millis();
}

Expand Down
2 changes: 1 addition & 1 deletion src/NukiBle.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ class NukiBle : public BLEClientCallbacks, public BleScanner::Subscriber {

protected:
bool connectBle(const BLEAddress bleAddress);
void extendDisonnectTimeout();
void extendDisconnectTimeout();

template <typename TDeviceAction>
Nuki::CmdResult executeAction(const TDeviceAction action);
Expand Down
8 changes: 4 additions & 4 deletions src/NukiBle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Nuki::CmdResult NukiBle::executeAction(const TDeviceAction action) {
Nuki::CmdResult result = cmdStateMachine(action);
if (result != Nuki::CmdResult::Working) {
giveNukiBleSemaphore();
extendDisonnectTimeout();
extendDisconnectTimeout();
return result;
}
#ifndef NUKI_NO_WDT_RESET
Expand All @@ -46,7 +46,7 @@ Nuki::CmdResult NukiBle::executeAction(const TDeviceAction action) {
Nuki::CmdResult result = cmdChallStateMachine(action);
if (result != Nuki::CmdResult::Working) {
giveNukiBleSemaphore();
extendDisonnectTimeout();
extendDisconnectTimeout();
return result;
}
#ifndef NUKI_NO_WDT_RESET
Expand All @@ -59,7 +59,7 @@ Nuki::CmdResult NukiBle::executeAction(const TDeviceAction action) {
Nuki::CmdResult result = cmdChallAccStateMachine(action);
if (result != Nuki::CmdResult::Working) {
giveNukiBleSemaphore();
extendDisonnectTimeout();
extendDisconnectTimeout();
return result;
}
#ifndef NUKI_NO_WDT_RESET
Expand All @@ -72,7 +72,7 @@ Nuki::CmdResult NukiBle::executeAction(const TDeviceAction action) {
Nuki::CmdResult result = cmdChallStateMachine(action, true);
if (result != Nuki::CmdResult::Working) {
giveNukiBleSemaphore();
extendDisonnectTimeout();
extendDisconnectTimeout();
return result;
}
#ifndef NUKI_NO_WDT_RESET
Expand Down
2 changes: 1 addition & 1 deletion src/NukiLock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ void NukiLock::createNewAdvancedConfig(const AdvancedConfig* oldConfig, NewAdvan
}

void NukiLock::handleReturnMessage(Command returnCode, unsigned char* data, uint16_t dataLen) {
extendDisonnectTimeout();
extendDisconnectTimeout();

switch (returnCode) {
case Command::KeyturnerStates : {
Expand Down
2 changes: 1 addition & 1 deletion src/NukiOpener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ void NukiOpener::createNewAdvancedConfig(const AdvancedConfig* oldConfig, NewAdv


void NukiOpener::handleReturnMessage(Command returnCode, unsigned char* data, uint16_t dataLen) {
extendDisonnectTimeout();
extendDisconnectTimeout();

switch (returnCode) {
case Command::KeyturnerStates : {
Expand Down

0 comments on commit 2f1dc82

Please sign in to comment.