Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
rsource "drivers/Kconfig"
rsource "lib/Kconfig"

menuconfig NCS_ALIRO
bool "NCS Aliro reader [EXPERIMENTAL]"
menuconfig NCS_DOOR_LOCK
bool "NCS Door Lock Application [EXPERIMENTAL]"
depends on (SOC_SERIES_NRF54LX || SOC_SERIES_NRF53X || SOC_SERIES_NRF52X)
select EXPERIMENTAL
imply NFC_T4T_APDU
Expand All @@ -21,13 +21,13 @@ menuconfig NCS_ALIRO
imply REQUIRES_FULL_LIBC
imply NEWLIB_LIBC_NANO if NEWLIB_LIBC
help
This option enables the Aliro reader stack.
This option enables the Door Lock Application which uses the Aliro reader stack.

if NCS_ALIRO
if NCS_DOOR_LOCK

orsource "lib/aliro/interfaces/logger/Kconfig"

config ALIRO_BLE_UWB
config DOOR_LOCK_BLE_UWB
bool "Aliro Bluetooth LE (BLE) transport together with ultra wideband (UWB)"
help
Enable the Aliro BLE transport protocol (TP). This is the transport layer
Expand All @@ -40,31 +40,43 @@ config DISABLE_ALIRO_NFC_TP
help
Disable the NFC transport protocol. This is useful if you want to use Aliro with BLE only.

if ALIRO_BLE_UWB
if DOOR_LOCK_BLE_UWB

config ALIRO_BLE_UWB_MAX_SESSIONS
config DOOR_LOCK_BLE_UWB_MAX_SESSIONS
int "Maximum number of BLE and UWB sessions"
range 1 BT_MAX_CONN
default BT_MAX_CONN
help
The maximum number of BLE and UWB sessions that can be established.

rsource "lib/aliro/Kconfig.ble.defconfig"

endif # ALIRO_BLE_UWB
endif # DOOR_LOCK_BLE_UWB

rsource "lib/aliro/Kconfig.defconfig"

config DOOR_LOCK_DFU_BLE_SMP
config DOOR_LOCK_DFU_BLE_SMP
bool "Enable DFU over SMP"
depends on !CHIP
help
Enables Device Firmware Upgrade over Bluetooth LE.

config DOOR_LOCK_DFU_BLE_SMP_STANDALONE
bool
default y if DOOR_LOCK_DFU_BLE_SMP && !DOOR_LOCK_BLE_UWB && !DOOR_LOCK_BLE_NUS
help
Automatically enabled when DFU over SMP is enabled standalone (without DOOR_LOCK_BLE_UWB or DOOR_LOCK_BLE_NUS).
This simplifies conditional compilation checks in the code.

config DOOR_LOCK_BLE_NUS
bool "Enable Nordic Uart Service (NUS)"
depends on !CHIP
help
Enables the Bluetooth LE Nordic Uart Service (NUS). Using NUS service you can control a door lock using pre-defined BLE commands.

endif # NCS_ALIRO
# Source BLE defconfig when any BLE feature is enabled
if DOOR_LOCK_BLE_UWB || DOOR_LOCK_DFU_BLE_SMP || DOOR_LOCK_BLE_NUS

rsource "lib/aliro/Kconfig.ble.defconfig"

endif # DOOR_LOCK_BLE_UWB || DOOR_LOCK_DFU_BLE_SMP || DOOR_LOCK_BLE_NUS

endif # NCS_DOOR_LOCK
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ nrfutil sdk-manager toolchain launch --ncs-version v3.2.0-preview2 --shell
```

```shell
# initialize workspace for the ncs-door-lock-app (v0.5.0 release)
west init -m https://github.com/nrfconnect/ncs-door-lock-app --mr v0.5.0 door-lock-workspace
# initialize workspace for the ncs-door-lock-app (v0.6.0-rc1 release)
west init -m https://github.com/nrfconnect/ncs-door-lock-app --mr v0.6.0-rc1 door-lock-workspace
```

```shell
Expand Down
14 changes: 9 additions & 5 deletions app/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

module = NCS_DOOR_LOCK_APP
module = DOOR_LOCK_APP
module-str = NCS_DOOR_LOCK_APP
module-dep = LOG
module-help = Enables nRF Connect SDK Door Lock Application log messages.
source "$(ZEPHYR_BASE)/subsys/logging/Kconfig.template.log_config"

choice ACCESS_MANAGER_IMPLEMENTATION
choice DOOR_LOCK_ACCESS_MANAGER_IMPLEMENTATION
prompt "Access Manager implementation"
default ACCESS_MANAGER_IMPLEMENTATION_DEFAULT
default DOOR_LOCK_ACCESS_MANAGER_IMPLEMENTATION_DEFAULT

config ACCESS_MANAGER_IMPLEMENTATION_DEFAULT
config DOOR_LOCK_ACCESS_MANAGER_IMPLEMENTATION_DEFAULT
bool "Access Manager default implementation"
help
Uses the default implementation of the Access Manager
provided by the Door Lock Reference Application.

config ACCESS_MANAGER_IMPLEMENTATION_CUSTOM
config DOOR_LOCK_ACCESS_MANAGER_IMPLEMENTATION_CUSTOM
bool "Access Manager custom implementation"
help
Uses a custom implementation of the Access Manager.
Expand Down Expand Up @@ -60,6 +60,10 @@ if DOOR_LOCK_BLE_NUS
rsource "src/bt_nus/Kconfig"
endif # DOOR_LOCK_BLE_NUS

if DOOR_LOCK_DFU_BLE_SMP
rsource "src/dfu_smp/Kconfig"
endif # DOOR_LOCK_DFU_BLE_SMP

if CHIP

rsource "src/matter/Kconfig"
Expand Down
4 changes: 2 additions & 2 deletions app/VERSION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION_MAJOR = 0
VERSION_MINOR = 5
VERSION_MINOR = 6
PATCHLEVEL = 0
VERSION_TWEAK = 0
EXTRAVERSION =
EXTRAVERSION = rc1
12 changes: 6 additions & 6 deletions app/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
# Aliro
#

# Enable Aliro
CONFIG_NCS_ALIRO=y
CONFIG_NCS_DOOR_LOCK=y

# Basic system configuration
CONFIG_CPP=y
Expand All @@ -22,18 +21,19 @@ CONFIG_SYS_HEAP_RUNTIME_STATS=y

# Stack sizes
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=3072
CONFIG_SHELL_STACK_SIZE=4096

# Logging
CONFIG_CONSOLE=y
CONFIG_LOG=y
CONFIG_LOG_MODE_DEFERRED=y
CONFIG_NCS_ALIRO_RFAL_LOG_LEVEL_DBG=y
CONFIG_NCS_ALIRO_BLE_LOG_LEVEL_INF=y
CONFIG_NCS_ALIRO_UWB_LOG_LEVEL_INF=y
CONFIG_DOOR_LOCK_RFAL_LOG_LEVEL_DBG=y
CONFIG_DOOR_LOCK_BLE_LOG_LEVEL_INF=y
CONFIG_DOOR_LOCK_UWB_LOG_LEVEL_INF=y
CONFIG_USE_SEGGER_RTT=n
CONFIG_LOG_BACKEND_RTT=n
CONFIG_LOG_BACKEND_SHOW_COLOR=n
CONFIG_NCS_DOOR_LOCK_APP_LOG_LEVEL_INF=y
CONFIG_DOOR_LOCK_APP_LOG_LEVEL_INF=y
CONFIG_BT_HCI_CORE_LOG_LEVEL_ERR=y
CONFIG_BT_HCI_DRIVER_LOG_LEVEL_ERR=y

Expand Down
4 changes: 2 additions & 2 deletions app/src/aliro/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ add_subdirectory(platform)
add_subdirectory(storage)

add_subdirectory_ifdef(CONFIG_DOOR_LOCK_STEP_UP_PHASE access_document)
add_subdirectory_ifdef(CONFIG_ACCESS_MANAGER_IMPLEMENTATION_DEFAULT access_manager_impl_default)
add_subdirectory_ifdef(CONFIG_ACCESS_MANAGER_IMPLEMENTATION_CUSTOM access_manager_impl_custom)
add_subdirectory_ifdef(CONFIG_DOOR_LOCK_ACCESS_MANAGER_IMPLEMENTATION_DEFAULT access_manager_impl_default)
add_subdirectory_ifdef(CONFIG_DOOR_LOCK_ACCESS_MANAGER_IMPLEMENTATION_CUSTOM access_manager_impl_custom)
add_subdirectory_ifdef(CONFIG_DOOR_LOCK_EXPEDITED_FAST_PHASE kpersistent_manager)
add_subdirectory_ifdef(CONFIG_DOOR_LOCK_CLI cli)

Expand Down
36 changes: 28 additions & 8 deletions app/src/aliro/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,37 @@ config DOOR_LOCK_STEP_UP_PHASE
If enabled, the Step-up phase is supported.
The user authentication is based on the Access Document.

rsource "platform/Kconfig"
config DOOR_LOCK_CREDENTIAL_ISSUER_CA
bool "Support for Credential Issuer CA public key"
default y if DOOR_LOCK_STEP_UP_PHASE
help
If enabled, the Credential Issuer CA public key is supported.
The Credential Issuer CA public key is used to verify the signature of the Credential Issuer certificate.

config DOOR_LOCK_READER_CERTIFICATE
bool "Support for Reader certificates"
default y if !CHIP
help
Use the reader certificate for the reader authentication.

config ALIRO_ACCESS_MANAGER_MAX_STORED_KEYS
int "Maximum number of stored public keys"
default 5
if DOOR_LOCK_READER_CERTIFICATE

config DOOR_LOCK_READER_CERTIFICATE_MAX_SIZE
int "Maximum size of the Reader certificate"
default 512
help
Specifies the maximum number of public keys that can be
stored in the AccessManager. This determines the size of
the statically allocated array for key storage.
Specifies the maximum size of the Reader certificate.
The Reader certificate is used to identify the Reader.

endif # DOOR_LOCK_READER_CERTIFICATE

rsource "platform/Kconfig"

if DOOR_LOCK_CLI
rsource "cli/Kconfig"
endif

if ACCESS_MANAGER_IMPLEMENTATION_DEFAULT
if DOOR_LOCK_ACCESS_MANAGER_IMPLEMENTATION_DEFAULT
rsource "access_manager_impl_default/Kconfig"
endif

Expand Down
10 changes: 5 additions & 5 deletions app/src/aliro/access_manager_impl_custom/access_manager_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <zephyr/logging/log.h>

LOG_MODULE_REGISTER(access_manager_impl_custom, CONFIG_NCS_DOOR_LOCK_APP_LOG_LEVEL);
LOG_MODULE_REGISTER(access_manager_impl_custom, CONFIG_DOOR_LOCK_APP_LOG_LEVEL);

namespace Aliro {

Expand Down Expand Up @@ -41,15 +41,15 @@ AliroError AccessManagerImpl::_VerifyKPersistentKey(CryptoTypes::KeyId, bool, Se
return ALIRO_ERROR_NOT_IMPLEMENTED;
}

#ifdef CONFIG_ALIRO_BLE_UWB
#ifdef CONFIG_DOOR_LOCK_BLE_UWB
AliroError AccessManagerImpl::_StartRangingSession(uint32_t, const CryptoTypes::Ursk &, SessionContext)
{
LOG_INF("Custom %s function", __FUNCTION__);
return ALIRO_ERROR_NOT_IMPLEMENTED;
}
#endif // CONFIG_ALIRO_BLE_UWB
#endif // CONFIG_DOOR_LOCK_BLE_UWB

AliroError AccessManagerImpl::_AddPublicKey(const CryptoTypes::PublicKey &, PublicKeyType, std::optional<size_t>)
AliroError AccessManagerImpl::_AddPublicKey(const CryptoTypes::PublicKey &, PublicKeyType, size_t)
{
LOG_INF("Custom %s function", __FUNCTION__);
return ALIRO_ERROR_NOT_IMPLEMENTED;
Expand All @@ -74,7 +74,7 @@ AliroError AccessManagerImpl::_GetPublicKey(size_t, CryptoTypes::PublicKey &)
return ALIRO_ERROR_NOT_IMPLEMENTED;
}

AliroError AccessManagerImpl::_RemovePublicKey(const CryptoTypes::PublicKey &, PublicKeyType)
AliroError AccessManagerImpl::_RemovePublicKey(PublicKeyType, size_t)
{
LOG_INF("Custom %s function", __FUNCTION__);
return ALIRO_ERROR_NOT_IMPLEMENTED;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@ class AccessManagerImpl : public AccessManager {
const std::optional<AccessDocumentTypes::AccessDocument> &accessDocument = std::nullopt);
AliroError _VerifyKPersistentKey(CryptoTypes::KeyId kpersistentKeyId, bool isNfcSession,
SessionContext sessionContext);
#ifdef CONFIG_ALIRO_BLE_UWB
#ifdef CONFIG_DOOR_LOCK_BLE_UWB
AliroError _StartRangingSession(uint32_t rangingSessionId, const CryptoTypes::Ursk &ursk,
SessionContext sessionContext);
#endif // CONFIG_ALIRO_BLE_UWB
AliroError _AddPublicKey(const CryptoTypes::PublicKey &publicKey, PublicKeyType publicKeyType,
std::optional<size_t> keyIndex = std::nullopt);
#endif // CONFIG_DOOR_LOCK_BLE_UWB
AliroError _AddPublicKey(const CryptoTypes::PublicKey &publicKey, PublicKeyType publicKeyType, size_t keyIndex);
bool _IsPublicKeyStored(const CryptoTypes::PublicKey &publicKey, size_t *keyIndex);
AliroError _GetPublicKey(size_t keyIndex, CryptoTypes::PublicKey &publicKey);
AliroError _RemovePublicKey(const CryptoTypes::PublicKey &publicKey, PublicKeyType publicKeyType);
AliroError _RemovePublicKey(PublicKeyType publicKeyType, size_t keyIndex);
AliroError _GetCredentialIssuerPublicKey(const CryptoTypes::KeyIdentifier &keyIdentifier,
CryptoTypes::PublicKey &publicKey) const;
void _ClearStoredKeys();
Expand Down
24 changes: 12 additions & 12 deletions app/src/aliro/access_manager_impl_default/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

config ALIRO_CREDENTIAL_ISSUER_MAX_STORED_KEYS
config DOOR_LOCK_ACCESS_MANAGER_CREDENTIAL_ISSUER_MAX_STORED_KEYS
int "Maximum number of stored Credential Issuer public keys"
default 5 if DOOR_LOCK_STEP_UP_PHASE
default 0
Expand All @@ -15,17 +15,17 @@ config ALIRO_CREDENTIAL_ISSUER_MAX_STORED_KEYS
public key is used to verify the signature of the access document.
If this option is set to 0, the access document is not supported.

config ALIRO_ACCESS_MANAGER_MAX_STORED_KEYS
config DOOR_LOCK_ACCESS_MANAGER_ACCESS_CREDENTIAL_MAX_STORED_KEYS
int "Maximum number of stored public keys"
default 5
help
Specifies the maximum number of public keys that can be
stored in the AccessManager. This determines the size of
the statically allocated array for key storage.

if ALIRO_BLE_UWB
if DOOR_LOCK_BLE_UWB

config ALIRO_ACCESS_MANAGER_MAX_ALLOWED_DISTANCE_CM
config DOOR_LOCK_ACCESS_MANAGER_MAX_ALLOWED_DISTANCE_CM
int "Maximum allowed distance for granting access (cm)"
default 100
help
Expand All @@ -34,33 +34,33 @@ config ALIRO_ACCESS_MANAGER_MAX_ALLOWED_DISTANCE_CM
This is used to determine if the Aliro User Device
is within the allowed proximity range.

choice ALIRO_ACCESS_MANAGER_TERMINATE_SESSION
choice DOOR_LOCK_ACCESS_MANAGER_TERMINATE_SESSION
prompt "Terminate session on given condition"
default ALIRO_ACCESS_MANAGER_TERMINATE_SESSION_ON_TIMEOUT
default DOOR_LOCK_ACCESS_MANAGER_TERMINATE_SESSION_ON_TIMEOUT
help
Select the condition under which the AccessManager will
terminate the current Aliro session.

config ALIRO_ACCESS_MANAGER_TERMINATE_SESSION_ON_ACCESS_GRANTED
config DOOR_LOCK_ACCESS_MANAGER_TERMINATE_SESSION_ON_ACCESS_GRANTED
bool "Terminate the session if the access was granted"
help
If enabled, the AccessManager will terminate each
session immediately when an access is granted.

config ALIRO_ACCESS_MANAGER_TERMINATE_SESSION_ON_TIMEOUT
config DOOR_LOCK_ACCESS_MANAGER_TERMINATE_SESSION_ON_TIMEOUT
bool "Terminate session on timeout"
help
If enabled, the AccessManager will terminate each ongoing
session if it times out according to ALIRO_ACCESS_MANAGER_SESSION_TIMEOUT_MS.
session if it times out according to DOOR_LOCK_ACCESS_MANAGER_SESSION_TIMEOUT_MS.

endchoice

if ALIRO_ACCESS_MANAGER_TERMINATE_SESSION_ON_TIMEOUT
if DOOR_LOCK_ACCESS_MANAGER_TERMINATE_SESSION_ON_TIMEOUT

config ALIRO_ACCESS_MANAGER_SESSION_TIMEOUT_MS
config DOOR_LOCK_ACCESS_MANAGER_SESSION_TIMEOUT_MS
int "Session timeout in milliseconds"
default 10000

endif

endif # ALIRO_BLE_UWB
endif # DOOR_LOCK_BLE_UWB
Loading