Skip to content

Commit 54f3f64

Browse files
Marcin Kajormarkaj-nordic
authored andcommitted
CI/CD: Synchronize ncs-aliro@1728be7563bc and ncs-door-lock-app
Source commit ID: @1728be7563bc sync-ncs-aliro-1728be7563bc Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.com>
1 parent eb223c3 commit 54f3f64

80 files changed

Lines changed: 2894 additions & 1186 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 9 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,17 @@
1-
# ncs-door-lock-app
2-
NCS manifest repo for the door lock reference application.
1+
# nRF Door Lock and Access Control Add-on
32

4-
## Getting started
5-
6-
Before getting started, set up the nRF Connect SDK development environment.
7-
8-
Follow the official [Installing the nRF Connect SDK](https://docs.nordicsemi.com/bundle/ncs-3.2.0/page/nrf/installation/install_ncs.html) guide and complete the following steps:
9-
10-
- [Update operating system](https://docs.nordicsemi.com/bundle/ncs-3.2.0/page/nrf/installation/install_ncs.html#update_operating_system)
11-
- [Install prerequisites](https://docs.nordicsemi.com/bundle/ncs-3.2.0/page/nrf/installation/install_ncs.html#install_prerequisites)
12-
- [Install the nRF Connect SDK toolchain](https://docs.nordicsemi.com/bundle/ncs-3.2.0/page/nrf/installation/install_ncs.html#install_the_nrf_connect_sdk_toolchain)
13-
14-
### Initialization
15-
16-
First, initialize the workspace folder (``door-lock-workspace``) where
17-
the ``ncs-door-lock-app`` and all nRF Connect SDK modules will be cloned.
3+
In combination with the nRF Connect SDK, the nRF Door Lock and Access Control Add-on provides a complete reference for building Aliro- and Matter-compatible locks and access control readers for both residential and commercial applications. The reference integrates multiple wireless technologies - including Bluetooth Low Energy (BLE), Ultra-Wideband (UWB), NFC, Thread, and Wi-Fi - allowing developers to choose the appropriate technology for their specific use case.
184

19-
Run the following commands:
5+
Aliro standardizes the interaction that lets a phone or wearable act as a digital key at an opening. Matter specifies how connected products communicate for command-and-control use cases like remotely locking or unlocking a door, checking lock status, user provisioning or integrating with home automation systems. The reference can support Aliro alone, Matter alone, or both protocols, depending on the specific use case and product requirements.
206

21-
```shell
22-
# launch nRF Connect toolchain for v3.2.0 release
23-
nrfutil sdk-manager toolchain launch --ncs-version v3.2.0 --shell
24-
```
25-
26-
```shell
27-
# initialize workspace for the ncs-door-lock-app (v0.6.0 release)
28-
west init -m https://github.com/nrfconnect/ncs-door-lock-app --mr v0.6.0 door-lock-workspace
29-
```
30-
31-
```shell
32-
# update nRF Connect SDK modules
33-
cd door-lock-workspace
34-
west update
35-
```
36-
37-
For detailed instructions on building and testing the `ncs-door-lock-app` application, see the technical documentation in the `docs` directory.
38-
To build this documentation locally, follow the steps in the section below.
39-
40-
## Building local documentation
41-
42-
To build the documentation locally, you must complete a minimal setup.
7+
## Getting started
438

44-
Navigate to the ``docs`` folder, and install Sphinx and other documentation dependencies by running the following command:
9+
To get started with the nRF Door Lock and Access Control Add-on, follow the [documentation](https://docs.nordicsemi.com/bundle/aliro_1.0.0/page/index.html).
4510

46-
```shell
47-
pip install -r requirements.txt
48-
```
11+
## License
4912

50-
Once successfully installed, you can build the Sphinx documentation from the ``docs`` folder:
13+
Source code included within this repository is licensed under the [LicenseRef-Nordic-5-Clause](LICENSE).
5114

52-
```shell
53-
make html
54-
```
15+
## Support
5516

56-
The documentation will be generated in the ``build`` folder.
57-
To view the built documentation, open ``docs/build/html/index.html`` in your web browser.
17+
To ask questions about the reference or to get technical support, please refer to [Nordic DevZone](https://devzone.nordicsemi.com).

app/VERSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
VERSION_MAJOR = 0
2-
VERSION_MINOR = 6
1+
VERSION_MAJOR = 1
2+
VERSION_MINOR = 0
33
PATCHLEVEL = 0
44
VERSION_TWEAK = 0
55
EXTRAVERSION =

app/src/aliro/Kconfig

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@
77
menu "Aliro features"
88

99
config DOOR_LOCK_BLE_UWB
10-
bool "Aliro Bluetooth LE (BLE) transport together with ultra wideband (UWB)"
10+
bool "Integration with Aliro BLE and UWB [EXPERIMENTAL]"
1111
select NCS_ALIRO_BLE_UWB
12+
select EXPERIMENTAL
1213
help
13-
Enable the Aliro BLE transport protocol (TP). This is the transport layer
14-
used by the Reader to communicate with the User Device. It is used to send and
15-
receive packets over BLE. Additionally the UWB is enabled in order to manage the
16-
ranging between the Reader and the User Device.
14+
Enable the door lock application integration with Aliro Bluetooth LE (BLE) and ultra wideband (UWB).
1715

1816
if DOOR_LOCK_BLE_UWB
1917

app/src/aliro/access_manager/access_manager_impl.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,9 +1055,13 @@ AliroError AccessManagerImpl::ProcessAccessDocument(const CryptoTypes::PublicKey
10551055
#if CONFIG_DOOR_LOCK_STORAGE_MAX_STORED_ACCESS_DOCUMENTS > 0
10561056
MutexGuard lock{ sMutex };
10571057

1058-
// Check if there is a free index in the Access Document container to store the Access Document.
10591058
size_t keyIndex = 0;
1060-
error = GetFirstFreeIndex(mAdKeys, keyIndex);
1059+
const bool adKeyStored = IsPublicKeyStored(mAdKeys, userPublicKey, &keyIndex);
1060+
1061+
if (!adKeyStored) {
1062+
// Check if there is a free index in the Access Document container to store the Access Document.
1063+
error = GetFirstFreeIndex(mAdKeys, keyIndex);
1064+
}
10611065

10621066
if (error == ALIRO_NO_MEMORY) {
10631067
LOG_DBG("No free index in the Access Document container, removing oldest credential");
@@ -1072,7 +1076,7 @@ AliroError AccessManagerImpl::ProcessAccessDocument(const CryptoTypes::PublicKey
10721076

10731077
if (credentialIssuerKeyStored) {
10741078
error = StoreAccessDocument(keyIndex, credentialIssuerKeyIndex, ad);
1075-
if (error == ALIRO_NO_ERROR) {
1079+
if (error == ALIRO_NO_ERROR && !adKeyStored) {
10761080
AddKeyToContainer(mAdKeys, userPublicKey, keyIndex);
10771081
}
10781082
}

app/src/aliro/aliro_state_control.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66

77
#include "aliro_state_control.h"
88

9-
#include "aliro/crypto_key_ids.h"
109
#include "aliro/init.h"
11-
#include "crypto/utils.h"
12-
#include "reader_cache.h"
10+
#include "reader.h"
1311

1412
#include <aliro/aliro.h>
1513
#include <aliro/utils.h>
@@ -21,19 +19,9 @@ LOG_MODULE_DECLARE(aliro);
2119

2220
namespace {
2321

24-
bool IsReaderIdentifierProvisioned()
25-
{
26-
return Aliro::ReaderCache::Instance().IsIdentifierSet();
27-
}
28-
29-
bool IsReaderPrivateKeyProvisioned()
30-
{
31-
return DoorLock::Crypto::IsKeyAvailable(Aliro::kPrivateKeyId) == ALIRO_NO_ERROR;
32-
}
33-
3422
bool IsProvisioningComplete()
3523
{
36-
return IsReaderPrivateKeyProvisioned() && IsReaderIdentifierProvisioned();
24+
return DoorLock::Storage::Reader::IsIdentifierSet() && DoorLock::Storage::Reader::IsPrivateKeySet();
3725
}
3826

3927
} // anonymous namespace

app/src/aliro/cli/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ zephyr_library_sources_ifdef(CONFIG_BT btaddr.cpp)
1414
zephyr_library_sources_ifdef(CONFIG_DOOR_LOCK_EXPEDITED_FAST_PHASE kpersistent.cpp)
1515
zephyr_library_sources_ifndef(CONFIG_CHIP
1616
factory_reset.cpp
17-
install.cpp
1817
provisioning.cpp
18+
reader.cpp
1919
)
2020

2121
zephyr_include_directories(.)

app/src/aliro/cli/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
#
66

77
config SHELL_CMD_BUFF_SIZE
8-
# Shell buffer must fit: "dl provisioning reader_cert set " (28 chars) + hex string (2 * cert size)
9-
# For 512 byte cert: 28 + 1024 = 1052
8+
# Shell buffer must fit: "dl reader certificate set " (26 chars) + hex string (2 * cert size)
9+
# For 512 byte cert: 26 + 1024 = 1050
1010
default 1052 if (SHELL && DOOR_LOCK_READER_CERTIFICATE)

app/src/aliro/cli/install.cpp

Lines changed: 0 additions & 103 deletions
This file was deleted.

app/src/aliro/cli/kpersistent.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
#include "shell_private.h"
88

9-
#include <aliro/crypto_key_ids.h>
109
#include <aliro/memory.h>
1110
#include <aliro/utils.h>
11+
#include <psa_key_ids.h>
1212

1313
#include "aliro/utils/hex_string.h"
1414

@@ -37,7 +37,8 @@ int PrintKpersistentKeys(const struct shell *shell, Aliro::CryptoTypes::KeyId *k
3737
shell_print(shell, "--------------------------------");
3838
for (size_t i = 0; i < kpersistentCount; i++) {
3939
const Aliro::CryptoTypes::KeyId kpersistentKeyId = kpersistentKeyIds[i];
40-
const size_t kpersistentKeyIndex = kpersistentKeyId - Aliro::kKpersistentRangeBegin;
40+
const size_t kpersistentKeyIndex =
41+
kpersistentKeyId - DoorLock::Storage::PsaKeyIds::kKpersistentRangeBegin;
4142

4243
Aliro::CryptoTypes::PublicKey publicKey{};
4344
auto *kpersistentManager = GetShellKpersistentManager();

0 commit comments

Comments
 (0)