|
Nuki BLE ESP32
|
#include <NukiLock.h>
Inheritance diagram for NukiLock::NukiLock:
Collaboration diagram for NukiLock::NukiLock:Public Member Functions | |
| NukiLock (const std::string &deviceName, const uint32_t deviceId) | |
| Nuki::CmdResult | addTimeControlEntry (NewTimeControlEntry newTimecontrolEntry) |
| Sends a new time(d) control entry via BLE to the lock. This entry is independant of keypad or authorization entries, it will execute the defined action at the defined time in the newTimeControlEntry. | |
| Nuki::CmdResult | disableAutoUnlock (const bool disable) |
| Gets the current advanced config from the lock, updates the disable autounlock parameter and sends the new advanced config to the lock via BLE. | |
| Nuki::CmdResult | disableNightModeAutoUnlock (const bool disable) |
| Gets the current config from the lock, updates the night mode auto unlock parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | enableAutoBatteryTypeDetection (const bool enable) |
| Gets the current advanced config from the lock, updates the enable battery type detection parameter and sends the new advanced config to the lock via BLE. | |
| Nuki::CmdResult | enableAutoLock (const bool enable) |
| Gets the current advanced config from the lock, updates the enable autolock parameter and sends the new advanced config to the lock via BLE. | |
| Nuki::CmdResult | enableAutoUnlatch (const bool enable) |
| Gets the current config from the lock, updates the auto unlatch parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | enableAutoUpdate (const bool enable) |
| Gets the current advanced config from the lock, updates the enable auto update parameter and sends the new advanced config to the lock via BLE (Updating the firmware requires the Nuki app. CAUTION: updating FW could cause breaking changes) | |
| Nuki::CmdResult | enableButton (const bool enable) |
| Gets the current config from the lock, updates the enable button parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | enableDetachedCylinder (const bool enable) |
| Gets the current config from the lock, updates the detached cylinder parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | enableDst (const bool enable) |
| Gets the current config from the lock, updates the dst parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | enableImmediateAutoLock (const bool enable) |
| Gets the current advanced config from the lock, updates the enable immediate autolock parameter and sends the new advanced config to the lock via BLE. | |
| Nuki::CmdResult | enableLedFlash (const bool enable) |
| Gets the current config from the lock, updates the whether or not the flashing LED should be enabled to signal an unlocked door. And sends the new config to the lock via BLE. | |
| Nuki::CmdResult | enableNightMode (const bool enable) |
| Gets the current config from the lock, updates the night mode parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | enableNightModeAutoLock (const bool enable) |
| Gets the current config from the lock, updates the night mode auto lock parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | enableNightModeImmediateLockOnStart (const bool enable) |
| Gets the current config from the lock, updates the night mode immediate lock on start parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | enablePairing (const bool enable) |
| Sets the lock ability to pair with other devices (can be used to prevent unauthorized pairing) Gets the current config from the lock, updates the pairing parameter and sends the new config to the lock via BLE (CAUTION: if pairing is set to false and credentials are deleted a factory reset of the lock needs to be performed before pairing is possible again) | |
| Nuki::CmdResult | enableSingleLock (const bool enable) |
| Gets the current config from the lock, updates the LED brightness parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | enableSlowSpeedDuringNightMode (const bool enable) |
| Gets the current advanced config from the lock, updates the enable slow speed during NightMode parameter and sends the new advanced config to the lock via BLE. | |
| Nuki::CmdResult | getAccessoryInfo (const uint8_t accessoryType) |
| Retrieve information about an accessory. | |
| uint8_t | getBatteryPerc () |
| Returns battery charge percentage state parsed from the battery state byte (battery critical byte) | |
| void | getInternalLogEntries (std::list< InternalLogEntry > *requestedInternalLogEntries) |
| Get the Internal Log Entries stored on the esp. Only available after executing retrieveInternalLogEntries. | |
| const ErrorCode | getLastError () const |
| Get the Last Error code received from the lock. | |
| void | getLogEntries (std::list< LogEntry > *requestedLogEntries) |
| Get the Log Entries stored on the esp. Only available after executing retreiveLogEntries. | |
| void | getTimeControlEntries (std::list< TimeControlEntry > *timeControlEntries) |
| Get the time control entries stored on the esp (after executing retrieveTimeControlEntries()) | |
| void | getWifiScanEntries (std::list< WifiScanEntry > *wifiScanEntries) |
| Get the Wifi scan entries stored on the esp (after executing scanWifi) | |
| bool | isBatteryCharging () |
| Returns battery charging state parsed from the battery state byte (battery critical byte) | |
| bool | isBatteryCritical () |
| Returns battery critical state parsed from the battery state byte (battery critical byte) | |
| bool | isDoorSensorBatteryCritical () |
| Returns door sensor battery critical state in case this is supported. | |
| bool | isKeypadBatteryCritical () |
| Returns keypad battery critical state in case this is supported. | |
| Nuki::CmdResult | keypadAction (KeypadActionSource source, uint32_t code, KeypadAction keypadAction) |
| Send a keypad action entry to the lock via BLE. | |
| Nuki::CmdResult | lockAction (const LockAction lockAction, const uint32_t nukiAppId=1, const uint8_t flags=0, const char *nameSuffix=nullptr, const uint8_t nameSuffixLen=0) |
| Sends lock action cmd via BLE to the lock. | |
| virtual void | logErrorCode (uint8_t errorCode) override |
| bool | pairingEnabled () |
| Gets the lock current config wrt pairing with other devices. | |
| Nuki::CmdResult | removeTimeControlEntry (uint8_t entryId) |
| Deletes a time(d) control entry via BLE to the lock. (see addTimeControlEntry()) | |
| Nuki::CmdResult | requestAdvancedConfig (AdvancedConfig *retrievedAdvancedConfig) |
| Requests advanced config from Lock via BLE. | |
| Nuki::CmdResult | requestBatteryReport (BatteryReport *retrievedBatteryReport) |
| Requests battery status from Lock via BLE. | |
| Nuki::CmdResult | requestConfig (Config *retrievedConfig) |
| Requests config from Lock via BLE. | |
| Nuki::CmdResult | requestKeyTurnerState (KeyTurnerState *retrievedKeyTurnerState) |
| Requests keyturner state from Lock via BLE. | |
| Nuki::CmdResult | retrieveInternalLogEntries (const uint32_t startIndex, const uint16_t count, const uint8_t sortOrder, bool const totalCount) |
| Request the lock via BLE to send the internal log entries. | |
| void | retrieveKeyTunerState (KeyTurnerState *retrievedKeyTurnerState) |
| Gets the last keyturner state stored on the esp. | |
| Nuki::CmdResult | retrieveLogEntries (const uint32_t startIndex, const uint16_t count, const uint8_t sortOrder, const bool totalCount) |
| Request the lock via BLE to send the log entries. | |
| Nuki::CmdResult | retrieveTimeControlEntries () |
| Request the lock via BLE to send the existing time control entries. | |
| Nuki::CmdResult | scanWifi (uint8_t scanDurationSeconds=10) |
| Scan for WiFi networks. | |
| Nuki::CmdResult | setAdvertisingMode (const AdvertisingMode mode) |
| Gets the current config from the lock, updates the advertising frequency parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | setAutoLockTimeOut (const uint8_t timeout) |
| Gets the current config from the lock, updates the auto lock timeout parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | setBatteryType (const BatteryType type) |
| Gets the current advanced config from the lock, updates the battery type parameter and sends the new advanced config to the lock via BLE. | |
| Nuki::CmdResult | setDoubleButtonPressAction (const ButtonPressAction action) |
| Gets the current advanced config from the lock, updates the double button press action parameter and sends the new advanced config to the lock via BLE. | |
| Nuki::CmdResult | setFobAction (const uint8_t fobActionNr, const uint8_t fobAction) |
| Gets the current config from the lock, updates the given fob action parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | setLatitude (const float degrees) |
| Gets the current config from the lock, updates the latitude parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | setLedBrightness (const uint8_t level) |
| Gets the current config from the lock, updates the LED brightness parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | setLockedPositionOffsetDegrees (const int16_t degrees) |
| Gets the current config from the lock, updates the locked position offset degrees parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | setLockNgoTimeout (const uint8_t timeout) |
| Gets the current config from the lock, updates the lock n go timeout parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | setLongitude (const float degrees) |
| Gets the current config from the lock, updates the longitude parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | setMotorSpeed (const MotorSpeed speed) |
| Gets the current advanced config from the lock, updates the motor speed parameter and sends the new advanced config to the lock via BLE. | |
| Nuki::CmdResult | setName (const std::string &name) |
| Gets the current config from the lock, updates the name parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | setNightModeEndTime (unsigned char endtime[2]) |
| Gets the current config from the lock, updates the night mode end time parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | setNightModeStartTime (unsigned char starttime[2]) |
| Gets the current config from the lock, updates the night mode start time parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | setSingleButtonPressAction (const ButtonPressAction action) |
| Gets the current advanced config from the lock, updates the single button press action parameter and sends the new advanced config to the lock via BLE. | |
| Nuki::CmdResult | setSingleLockedPositionOffsetDegrees (const int16_t degrees) |
| Gets the current config from the lock, updates the single locked position offset degrees parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | setTimeZoneId (const TimeZoneId timeZoneId) |
| Gets the current config from the lock, updates the timezone id parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | setTimeZoneOffset (const int16_t minutes) |
| Gets the current config from the lock, updates the timezone offset parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | setUnlatchDuration (const uint8_t duration) |
| Gets the current config from the lock, updates the unlatch duration parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | setUnlockedPositionOffsetDegrees (const int16_t degrees) |
| Gets the current config from the lock, updates the unlocked position offset degrees parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | setUnlockedToLockedTransitionOffsetDegrees (const int16_t degrees) |
| Gets the current config from the lock, updates the unlocked to locked transition offset degrees parameter and sends the new config to the lock via BLE. | |
| Nuki::CmdResult | updateTimeControlEntry (TimeControlEntry TimeControlEntry) |
| Sends an updated time(d) control entry via BLE to the lock. (see addTimeControlEntry()) | |
Public Member Functions inherited from Nuki::NukiBle | |
| NukiBle (const std::string &deviceName, const uint32_t deviceId, const NimBLEUUID pairingServiceUUID, const NimBLEUUID pairingServiceUltraUUID, const NimBLEUUID deviceServiceUUID, const NimBLEUUID gdioUUID, const NimBLEUUID gdioUltraUUID, const NimBLEUUID userDataUUID, const std::string preferencedId) | |
| virtual | ~NukiBle () |
| Nuki::CmdResult | addAuthorizationEntry (NewAuthorizationEntry newAuthorizationEntry) |
| Sends a new authorization entry to the lock via BLE. | |
| Nuki::CmdResult | addKeypadEntry (NewKeypadEntry newKeypadEntry) |
| Send a new keypad entry to the lock via BLE. | |
| Nuki::CmdResult | deleteAuthorizationEntry (const uint32_t id) |
| Deletes the authorization entry from the lock. | |
| CmdResult | deleteKeypadEntry (uint16_t id) |
| Delete a Keypad Entry. | |
| Nuki::CmdResult | genericCommand (Command command, bool withPin=true) |
| Sends a custom command to the lock via BLE. | |
| void | getAuthorizationEntries (std::list< AuthorizationEntry > *requestedAuthorizationEntries) |
| Get the Authorization Entries stored on the esp (after executing retreiveAuthorizationEntries) | |
| const BLEAddress | getBleAddress () const |
| Returns the BLE address of the device if paired. | |
| void | getFingerprintEntries (std::list< FingerprintEntry > *requestedFingerprintEntries) |
| Get the Fingerprint Entries stored on the esp (after executing retrieveFingerprintEntries) | |
| void | getKeypadEntries (std::list< KeypadEntry > *requestedKeyPadEntries) |
| Get the Keypad Entries stored on the esp (after executing retreieveLogKeypadEntries) | |
| uint16_t | getKeypadEntryCount () |
| Returns the keypad entry count. Only available after executing retreiveKeypadEntries. | |
| unsigned long | getLastHeartbeat () |
| Returns the timestamp (millis) of the last received BLE beacon from the lock. | |
| unsigned long | getLastReceivedBeaconTs () const |
| Returns the timestamp in milliseconds when the last ble beacon has been received from the device. | |
| uint16_t | getLogEntryCount () |
| Returns the log entry count. Only available after executing retreiveLogEntries. | |
| void | getMacAddress (char *macAddress) |
| Gets the ble mac address of the paired lock stored on the esp. | |
| int | getRssi () const |
| Returns the RSSI of the last received ble beacon broadcast. | |
| uint16_t | getSecurityPincode () |
| Gets the pincode stored on the esp. This pincode is used for sending/setting config via BLE to the lock by other methods and needs to be the same pincode as stored in the lock. | |
| uint32_t | getUltraPincode () |
| void | initialize (bool initAltConnect=false) |
| Initializes stored preferences based on the devicename passed in the constructor, creates the BLE client, sets the BLE callback and checks if the lock is paired (if credentials are stored in preferences) | |
| const bool | isLockUltra () const |
| Returns if BLE is pairing/paired/connected with a Smart Lock Ultra. | |
| const bool | isPairedWithLock () const |
| Returns pairing state (if credentials are stored or not) | |
| Nuki::PairingResult | pairNuki (AuthorizationIdType idType=AuthorizationIdType::Bridge) |
| Checks if credentials are stored in preferences, if not initiate pairing. | |
| void | registerBleScanner (BleScanner::Publisher *bleScanner) |
| Registers the BLE scanner to be used for scanning for advertisements from the lock. BleScanner::Publisher is defined in dependent library https://github.com/I-Connect/BleScanner.git. | |
| void | registerLogger (Print *Log) |
| Registers a Logger to be used for printing debug logs. | |
| Nuki::CmdResult | requestCalibration () |
| Sends an calibration (mechanical) request to the lock via BLE. | |
| Nuki::CmdResult | requestDailyStatistics () |
| Sends a request for daily statistics to the lock via BLE. | |
| Nuki::CmdResult | requestReboot () |
| Sends an reboot request to the lock via BLE. | |
| void | resetHost () |
| Reset BLE host. | |
| Nuki::CmdResult | retrieveAuthorizationEntries (const uint16_t offset, const uint16_t count) |
| Request the lock via BLE to send the existing authorizationentries. | |
| Nuki::CmdResult | retrieveFingerprintEntries () |
| Request the lock via BLE to send the existing fingerprint entries. | |
| Nuki::CmdResult | retrieveKeypadEntries (const uint16_t offset, const uint16_t count) |
| Request the lock via BLE to send the existing keypad entries. | |
| bool | saveSecurityPincode (const uint16_t pinCode) |
| Saves the pincode on the esp. This pincode is used for sending/setting config via BLE to the lock by other methods and needs to be the same pincode as stored in the lock. | |
| bool | saveUltraPincode (const uint32_t pinCode, bool save=true) |
| void | setConnectRetries (uint8_t retries) |
| Set the BLE Connect number of retries. | |
| void | setConnectTimeout (uint8_t timeout) |
| Set the BLE Connect Timeout in seconds. | |
| void | setDebugCommand (bool enable) |
| Whether to enable or disable command debug logging. | |
| void | setDebugCommunication (bool enable) |
| Whether to enable or disable communication debug logging. | |
| void | setDebugConnect (bool enable) |
| Whether to enable or disable connect debug logging. | |
| void | setDebugHexData (bool enable) |
| Whether to enable or disable hex data debug logging. | |
| void | setDebugReadableData (bool enable) |
| Whether to enable or disable readable data debug logging. | |
| void | setDisconnectTimeout (uint32_t timeoutMs) |
| Set the BLE Disconnect Timeout, if longer than ~20 sec the lock will disconnect by itself if there is no BLE communication. | |
| void | setEventHandler (Nuki::SmartlockEventHandler *handler) |
| Set the Event Handler object. | |
| void | setPower (esp_power_level_t powerLevel) |
| the transmission power. | |
| Nuki::CmdResult | setSecurityPin (const uint16_t newSecurityPin) |
| Send the new pincode command to the lock via BLE (this command uses the earlier by saveSecurityPincode() stored pincode which needs to be the same as the pincode stored in the lock) | |
| Nuki::CmdResult | setUltraPin (const uint32_t newSecurityPin) |
| void | unPairNuki () |
| Delete stored credentials. | |
| Nuki::CmdResult | updateAuthorizationEntry (UpdatedAuthorizationEntry updatedAuthorizationEntry) |
| Sends an updated authorization entry to the lock via BLE. | |
| void | updateConnectionState () |
| checks the time past after last connect/communication sent, if the time past > timeout it will disconnect the BLE connection with the lock so that lock will start sending advertisements. | |
| Nuki::CmdResult | updateKeypadEntry (UpdatedKeypadEntry updatedKeyPadEntry) |
| Send an updated keypad entry to the lock via BLE. | |
| Nuki::CmdResult | updateTime (TimeValue time) |
| Sends the time to be set to the lock via BLE. | |
| Nuki::CmdResult | verifySecurityPin () |
| Send the verify pincode command via BLE to the lock. This command uses the earlier by saveSecurityPincode() stored pincode. | |
Protected Member Functions | |
| void | handleReturnMessage (Command returnCode, unsigned char *data, uint16_t dataLen) override |
Protected Member Functions inherited from Nuki::NukiBle | |
| template<typename TDeviceAction> | |
| Nuki::CmdResult | cmdChallAccStateMachine (const TDeviceAction action) |
| template<typename TDeviceAction> | |
| Nuki::CmdResult | cmdChallStateMachine (const TDeviceAction action, const bool sendPinCode=false) |
| template<typename TDeviceAction> | |
| Nuki::CmdResult | cmdStateMachine (const TDeviceAction action) |
| bool | connectBle (const BLEAddress bleAddress, bool pairing) |
| template<typename TDeviceAction> | |
| Nuki::CmdResult | executeAction (const TDeviceAction action) |
| void | extendDisconnectTimeout () |
| void | logMessage (const char *message, int level=4) |
| void | logMessageVar (const char *message, const char *var, int level=4) |
| void | logMessageVar (const char *message, unsigned int var, int level=4) |
Additional Inherited Members | |
Protected Attributes inherited from Nuki::NukiBle | |
| bool | debugNukiCommand = false |
| bool | debugNukiCommunication = false |
| bool | debugNukiConnect = false |
| bool | debugNukiHexData = false |
| bool | debugNukiReadableData = false |
| uint8_t | errorCode = 0 |
| Command | lastMsgCodeReceived = Command::Empty |
| Print * | logger = nullptr |
| NukiLock::NukiLock::NukiLock | ( | const std::string & | deviceName, |
| const uint32_t | deviceId ) |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::addTimeControlEntry | ( | NewTimeControlEntry | newTimecontrolEntry | ) |
Sends a new time(d) control entry via BLE to the lock. This entry is independant of keypad or authorization entries, it will execute the defined action at the defined time in the newTimeControlEntry.
| newTimecontrolEntry | Nuki api based datatype to send |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::disableAutoUnlock | ( | const bool | disable | ) |
Gets the current advanced config from the lock, updates the disable autounlock parameter and sends the new advanced config to the lock via BLE.
| disable | true if auto unlock should be disabled in general. |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::disableNightModeAutoUnlock | ( | const bool | disable | ) |
Gets the current config from the lock, updates the night mode auto unlock parameter and sends the new config to the lock via BLE.
| disable | true if night mode auto unlock disabled |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::enableAutoBatteryTypeDetection | ( | const bool | enable | ) |
Gets the current advanced config from the lock, updates the enable battery type detection parameter and sends the new advanced config to the lock via BLE.
| enable | true if the automatic detection of the battery type is enabled |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::enableAutoLock | ( | const bool | enable | ) |
Gets the current advanced config from the lock, updates the enable autolock parameter and sends the new advanced config to the lock via BLE.
| enable | true if auto lock should be enabled in general. |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::enableAutoUnlatch | ( | const bool | enable | ) |
Gets the current config from the lock, updates the auto unlatch parameter and sends the new config to the lock via BLE.
| enable | true if auto unlatch should be enabled in general. |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::enableAutoUpdate | ( | const bool | enable | ) |
Gets the current advanced config from the lock, updates the enable auto update parameter and sends the new advanced config to the lock via BLE (Updating the firmware requires the Nuki app. CAUTION: updating FW could cause breaking changes)
| enable | true if automatic firmware updates should be enabled |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::enableButton | ( | const bool | enable | ) |
Gets the current config from the lock, updates the enable button parameter and sends the new config to the lock via BLE.
| enable | true if button enabled |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::enableDetachedCylinder | ( | const bool | enable | ) |
Gets the current config from the lock, updates the detached cylinder parameter and sends the new config to the lock via BLE.
| enable | true if detached cylinder enabled (Flag that indicates that the inner side of the used cylinder is detached from the outer side and therefore the Smart Lock wonāt recognize if someone operates the door by using a key) |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::enableDst | ( | const bool | enable | ) |
Gets the current config from the lock, updates the dst parameter and sends the new config to the lock via BLE.
| enable | The desired daylight saving time mode. false disabled, true european |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::enableImmediateAutoLock | ( | const bool | enable | ) |
Gets the current advanced config from the lock, updates the enable immediate autolock parameter and sends the new advanced config to the lock via BLE.
| enable | true if auto lock should be performed immediately after the door has been closed (requires active door sensor) |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::enableLedFlash | ( | const bool | enable | ) |
Gets the current config from the lock, updates the whether or not the flashing LED should be enabled to signal an unlocked door. And sends the new config to the lock via BLE.
| enable | true if led enabled |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::enableNightMode | ( | const bool | enable | ) |
Gets the current config from the lock, updates the night mode parameter and sends the new config to the lock via BLE.
| enable | true if night mode enabled |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::enableNightModeAutoLock | ( | const bool | enable | ) |
Gets the current config from the lock, updates the night mode auto lock parameter and sends the new config to the lock via BLE.
| enable | true if night mode auto lock enabled |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::enableNightModeImmediateLockOnStart | ( | const bool | enable | ) |
Gets the current config from the lock, updates the night mode immediate lock on start parameter and sends the new config to the lock via BLE.
| enable | true if night mode immediate lock on start enabled |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::enablePairing | ( | const bool | enable | ) |
Sets the lock ability to pair with other devices (can be used to prevent unauthorized pairing) Gets the current config from the lock, updates the pairing parameter and sends the new config to the lock via BLE (CAUTION: if pairing is set to false and credentials are deleted a factory reset of the lock needs to be performed before pairing is possible again)
| enable | true if allowed to pair with other devices |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::enableSingleLock | ( | const bool | enable | ) |
Gets the current config from the lock, updates the LED brightness parameter and sends the new config to the lock via BLE.
| enable | true if only a single lock should be performed |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::enableSlowSpeedDuringNightMode | ( | const bool | enable | ) |
Gets the current advanced config from the lock, updates the enable slow speed during NightMode parameter and sends the new advanced config to the lock via BLE.
| action | the deired action for a single button press |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::getAccessoryInfo | ( | const uint8_t | accessoryType | ) |
Retrieve information about an accessory.
| accessoryType | The accessory type to retrieve information about |
Here is the call graph for this function:| uint8_t NukiLock::NukiLock::getBatteryPerc | ( | ) |
Returns battery charge percentage state parsed from the battery state byte (battery critical byte)
Note that retrieveOpenerState() needs to be called first to retrieve the needed data
| void NukiLock::NukiLock::getInternalLogEntries | ( | std::list< InternalLogEntry > * | requestedInternalLogEntries | ) |
Get the Internal Log Entries stored on the esp. Only available after executing retrieveInternalLogEntries.
| requestedInternalLogEntries | list to store the returned internal log entries |
| const ErrorCode NukiLock::NukiLock::getLastError | ( | ) | const |
Get the Last Error code received from the lock.
| void NukiLock::NukiLock::getLogEntries | ( | std::list< LogEntry > * | requestedLogEntries | ) |
Get the Log Entries stored on the esp. Only available after executing retreiveLogEntries.
| requestedLogEntries | list to store the returned log entries |
| void NukiLock::NukiLock::getTimeControlEntries | ( | std::list< TimeControlEntry > * | timeControlEntries | ) |
Get the time control entries stored on the esp (after executing retrieveTimeControlEntries())
| timeControlEntries | list to store the returned time control entries |
| void NukiLock::NukiLock::getWifiScanEntries | ( | std::list< WifiScanEntry > * | wifiScanEntries | ) |
Get the Wifi scan entries stored on the esp (after executing scanWifi)
| wifiScanEntries | list to store the returned Wifi scan entries |
|
overrideprotectedvirtual |
| bool NukiLock::NukiLock::isBatteryCharging | ( | ) |
Returns battery charging state parsed from the battery state byte (battery critical byte)
Note that retrieveOpenerState() needs to be called first to retrieve the needed data
| bool NukiLock::NukiLock::isBatteryCritical | ( | ) |
Returns battery critical state parsed from the battery state byte (battery critical byte)
Note that retrieveOpenerState() needs to be called first to retrieve the needed data
| bool NukiLock::NukiLock::isDoorSensorBatteryCritical | ( | ) |
Returns door sensor battery critical state in case this is supported.
Note that retrieveOpenerState() needs to be called first to retrieve the needed data
| bool NukiLock::NukiLock::isKeypadBatteryCritical | ( | ) |
Returns keypad battery critical state in case this is supported.
Note that retrieveOpenerState() needs to be called first to retrieve the needed data
| Nuki::CmdResult NukiLock::NukiLock::keypadAction | ( | KeypadActionSource | source, |
| uint32_t | code, | ||
| KeypadAction | keypadAction ) |
Send a keypad action entry to the lock via BLE.
| source | 0x00 = arrow key, 0x01 = code |
| code | The code that has been entered on the keypad |
| keypadAction | The action to be executed |
Here is the call graph for this function:
Here is the caller graph for this function:| Nuki::CmdResult NukiLock::NukiLock::lockAction | ( | const LockAction | lockAction, |
| const uint32_t | nukiAppId = 1, | ||
| const uint8_t | flags = 0, | ||
| const char * | nameSuffix = nullptr, | ||
| const uint8_t | nameSuffixLen = 0 ) |
Sends lock action cmd via BLE to the lock.
| lockAction | |
| nukiAppId | 0 = App, 1 = Bridge, 2 = Fob, 3 = Keypad |
| flags | optional |
| nameSuffix | optional |
| nameSuffixLen | len of nameSuffix if used ('\0' included, maximum 19) |
Here is the call graph for this function:
Here is the caller graph for this function:
|
overridevirtual |
| bool NukiLock::NukiLock::pairingEnabled | ( | ) |
Gets the lock current config wrt pairing with other devices.
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::removeTimeControlEntry | ( | uint8_t | entryId | ) |
Deletes a time(d) control entry via BLE to the lock. (see addTimeControlEntry())
| entryId | The ID to be deleted, can be retrieved via retrieveTimeControlEntries() |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::requestAdvancedConfig | ( | AdvancedConfig * | retrievedAdvancedConfig | ) |
Requests advanced config from Lock via BLE.
| retrievedAdvancedConfig | Nuki api based datatype to store the retrieved advanced config |
Here is the call graph for this function:
Here is the caller graph for this function:| Nuki::CmdResult NukiLock::NukiLock::requestBatteryReport | ( | BatteryReport * | retrievedBatteryReport | ) |
Requests battery status from Lock via BLE.
| retrievedBatteryReport | Nuki api based datatype to store the retrieved battery status |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::requestConfig | ( | Config * | retrievedConfig | ) |
Requests config from Lock via BLE.
| retrievedConfig | Nuki api based datatype to store the retrieved config |
Here is the call graph for this function:
Here is the caller graph for this function:| Nuki::CmdResult NukiLock::NukiLock::requestKeyTurnerState | ( | KeyTurnerState * | retrievedKeyTurnerState | ) |
Requests keyturner state from Lock via BLE.
| retrievedKeyTurnerState | Nuki api based datatype to store the retrieved keyturnerstate |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::retrieveInternalLogEntries | ( | const uint32_t | startIndex, |
| const uint16_t | count, | ||
| const uint8_t | sortOrder, | ||
| bool const | totalCount ) |
Request the lock via BLE to send the internal log entries.
| startIndex | Startindex of first log msg to be send |
| count | The number of log entries to be read, starting at the specified start index. |
| sortOrder | The desired sort order |
| totalCount | true if a Log Entry Count is requested from the lock |
Here is the call graph for this function:| void NukiLock::NukiLock::retrieveKeyTunerState | ( | KeyTurnerState * | retrievedKeyTurnerState | ) |
Gets the last keyturner state stored on the esp.
| retrievedKeyTurnerState | Nuki api based datatype to store the retrieved keyturnerstate |
| Nuki::CmdResult NukiLock::NukiLock::retrieveLogEntries | ( | const uint32_t | startIndex, |
| const uint16_t | count, | ||
| const uint8_t | sortOrder, | ||
| const bool | totalCount ) |
Request the lock via BLE to send the log entries.
| startIndex | Startindex of first log msg to be send |
| count | The number of log entries to be read, starting at the specified start index. |
| sortOrder | The desired sort order |
| totalCount | true if a Log Entry Count is requested from the lock |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::retrieveTimeControlEntries | ( | ) |
Request the lock via BLE to send the existing time control entries.
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::scanWifi | ( | uint8_t | scanDurationSeconds = 10 | ) |
Scan for WiFi networks.
| scanDurationSeconds | Amount of seconds to scan for WiFi networks |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::setAdvertisingMode | ( | const AdvertisingMode | mode | ) |
Gets the current config from the lock, updates the advertising frequency parameter and sends the new config to the lock via BLE.
| mode | 0x00 Automatic, 0x01 Normal, 0x02 Slow, 0x03 Slowest (~400ms till ~1s) |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::setAutoLockTimeOut | ( | const uint8_t | timeout | ) |
Gets the current config from the lock, updates the auto lock timeout parameter and sends the new config to the lock via BLE.
| timeout | the desired timeout until the smart lock relocks itself after it has been unlocked |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::setBatteryType | ( | const BatteryType | type | ) |
Gets the current advanced config from the lock, updates the battery type parameter and sends the new advanced config to the lock via BLE.
| type | The type of the batteries present in the smart lock. |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::setDoubleButtonPressAction | ( | const ButtonPressAction | action | ) |
Gets the current advanced config from the lock, updates the double button press action parameter and sends the new advanced config to the lock via BLE.
| action | the deired action for a double button press |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::setFobAction | ( | const uint8_t | fobActionNr, |
| const uint8_t | fobAction ) |
Gets the current config from the lock, updates the given fob action parameter and sends the new config to the lock via BLE.
| fobActionNr | the fob action to change (1 = single press, 2 = double press, 3 = triple press) |
| fobAction | the desired fob action setting |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::setLatitude | ( | const float | degrees | ) |
Gets the current config from the lock, updates the latitude parameter and sends the new config to the lock via BLE.
| degrees | the desired latitude |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::setLedBrightness | ( | const uint8_t | level | ) |
Gets the current config from the lock, updates the LED brightness parameter and sends the new config to the lock via BLE.
| level | The LED brightness level. Possible values are 0 to 5 0 = off, ā¦, 5 = max |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::setLockedPositionOffsetDegrees | ( | const int16_t | degrees | ) |
Gets the current config from the lock, updates the locked position offset degrees parameter and sends the new config to the lock via BLE.
| degrees | the desired offset that alters the locked position |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::setLockNgoTimeout | ( | const uint8_t | timeout | ) |
Gets the current config from the lock, updates the lock n go timeout parameter and sends the new config to the lock via BLE.
| timeout | the desired timeout for lock ānā go |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::setLongitude | ( | const float | degrees | ) |
Gets the current config from the lock, updates the longitude parameter and sends the new config to the lock via BLE.
| degrees | the desired longitude |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::setMotorSpeed | ( | const MotorSpeed | speed | ) |
Gets the current advanced config from the lock, updates the motor speed parameter and sends the new advanced config to the lock via BLE.
| action | the deired action for a single button press |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::setName | ( | const std::string & | name | ) |
Gets the current config from the lock, updates the name parameter and sends the new config to the lock via BLE.
| name | max 32 character name |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::setNightModeEndTime | ( | unsigned char | endtime[2] | ) |
Gets the current config from the lock, updates the night mode end time parameter and sends the new config to the lock via BLE.
| endtime | the desired night mode end time |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::setNightModeStartTime | ( | unsigned char | starttime[2] | ) |
Gets the current config from the lock, updates the night mode start time parameter and sends the new config to the lock via BLE.
| starttime | the desired night mode start time |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::setSingleButtonPressAction | ( | const ButtonPressAction | action | ) |
Gets the current advanced config from the lock, updates the single button press action parameter and sends the new advanced config to the lock via BLE.
| action | the deired action for a single button press |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::setSingleLockedPositionOffsetDegrees | ( | const int16_t | degrees | ) |
Gets the current config from the lock, updates the single locked position offset degrees parameter and sends the new config to the lock via BLE.
| degrees | the desired offset that alters the single locked position |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::setTimeZoneId | ( | const TimeZoneId | timeZoneId | ) |
Gets the current config from the lock, updates the timezone id parameter and sends the new config to the lock via BLE.
| timeZoneId | The id of the current timezone or 0xFFFF if timezones are not supported |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::setTimeZoneOffset | ( | const int16_t | minutes | ) |
Gets the current config from the lock, updates the timezone offset parameter and sends the new config to the lock via BLE.
| minutes | The timezone offset (UTC) in minutes |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::setUnlatchDuration | ( | const uint8_t | duration | ) |
Gets the current config from the lock, updates the unlatch duration parameter and sends the new config to the lock via BLE.
| duration | the desired duration in seconds for holding the latch in unlatched position |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::setUnlockedPositionOffsetDegrees | ( | const int16_t | degrees | ) |
Gets the current config from the lock, updates the unlocked position offset degrees parameter and sends the new config to the lock via BLE.
| degrees | the desired offset that alters the unlocked position |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::setUnlockedToLockedTransitionOffsetDegrees | ( | const int16_t | degrees | ) |
Gets the current config from the lock, updates the unlocked to locked transition offset degrees parameter and sends the new config to the lock via BLE.
| degrees | the desired offset that alters the position where transition from unlocked to locked happens |
Here is the call graph for this function:| Nuki::CmdResult NukiLock::NukiLock::updateTimeControlEntry | ( | TimeControlEntry | TimeControlEntry | ) |
Sends an updated time(d) control entry via BLE to the lock. (see addTimeControlEntry())
| TimeControlEntry | Nuki api based datatype to send. The ID can be retrieved via retrieveTimeControlEntries() |
Here is the call graph for this function: