Skip to content

Commit 1087854

Browse files
Marcin Kajormarkaj-nordic
authored andcommitted
CI/CD: Synchronize ncs-aliro@82fa1c03b7dd and ncs-door-lock-app
Source commit ID: @82fa1c03b7dd sync-ncs-aliro-82fa1c03b7dd Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.com>
1 parent 37d251f commit 1087854

33 files changed

Lines changed: 1156 additions & 315 deletions

File tree

app/src/access_manager_impl_custom/access_manager_impl.cpp

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,38 @@ LOG_MODULE_REGISTER(access_manager_impl_custom, CONFIG_NCS_DOOR_LOCK_APP_LOG_LEV
1212

1313
namespace Aliro {
1414

15-
AliroError AccessManagerImpl::_Init(const Callbacks &callbacks)
15+
AliroError AccessManagerImpl::_Init(const ApplicationCallbacks &)
1616
{
1717
LOG_INF("AccessManagerImpl custom init");
1818
return ALIRO_ERROR_NOT_IMPLEMENTED;
1919
}
2020

21-
AliroError AccessManagerImpl::_StartAccessDecision(const CryptoTypes::PublicKey &userPublicKey, bool isBleSession)
21+
void AccessManagerImpl::_SetStackCallbacks(const StackCallbacks &)
2222
{
23-
LOG_INF("AccessManagerImpl custom start access decision");
23+
LOG_INF("AccessManagerImpl custom set stack callbacks");
24+
}
25+
26+
AliroError AccessManagerImpl::_VerifyAccessCredential(const CryptoTypes::PublicKey &, bool, SessionContext)
27+
{
28+
LOG_INF("AccessManagerImpl custom verify access credential");
29+
return ALIRO_ERROR_NOT_IMPLEMENTED;
30+
}
31+
32+
#ifdef CONFIG_ALIRO_BLE_TP
33+
AliroError AccessManagerImpl::_StartRangingSession(uint32_t, const CryptoTypes::Ursk &, SessionContext)
34+
{
35+
LOG_INF("AccessManagerImpl custom start ranging session");
2436
return ALIRO_ERROR_NOT_IMPLEMENTED;
2537
}
38+
#endif // CONFIG_ALIRO_BLE_TP
2639

27-
AliroError AccessManagerImpl::_AddPublicKey(const CryptoTypes::PublicKey &publicKey)
40+
AliroError AccessManagerImpl::_AddPublicKey(const CryptoTypes::PublicKey &)
2841
{
2942
LOG_INF("AccessManagerImpl custom add public key");
3043
return ALIRO_ERROR_NOT_IMPLEMENTED;
3144
}
3245

33-
AliroError AccessManagerImpl::_RemovePublicKey(const CryptoTypes::PublicKey &publicKey)
46+
AliroError AccessManagerImpl::_RemovePublicKey(const CryptoTypes::PublicKey &)
3447
{
3548
LOG_INF("AccessManagerImpl custom remove public key");
3649
return ALIRO_ERROR_NOT_IMPLEMENTED;
@@ -41,20 +54,25 @@ void AccessManagerImpl::_ClearStoredKeys()
4154
LOG_INF("AccessManagerImpl custom clear stored keys");
4255
}
4356

44-
void AccessManagerImpl::_SetMaxAllowedDistance(uint32_t maxDistance)
57+
void AccessManagerImpl::_SetMaxAllowedDistance(uint32_t)
4558
{
4659
LOG_INF("AccessManagerImpl custom set max allowed distance");
4760
}
4861

49-
uint32_t AccessManagerImpl::_GetMaxAllowedDistance() const
62+
uint32_t AccessManagerImpl::_GetMaxAllowedDistance()
5063
{
5164
LOG_INF("AccessManagerImpl custom get max allowed distance");
5265
return 0;
5366
}
5467

55-
void AccessManagerImpl::_HandleRangingSessionData(const UwbRangingData &uwbData)
68+
void AccessManagerImpl::_HandleRangingSessionData(SessionContext, const UwbRangingData &)
5669
{
5770
LOG_INF("AccessManagerImpl custom handle ranging session data");
5871
}
5972

73+
void AccessManagerImpl::_HandleSessionTermination(SessionContext)
74+
{
75+
LOG_INF("AccessManagerImpl custom handle session termination");
76+
}
77+
6078
} // namespace Aliro

app/src/access_manager_impl_custom/access_manager_impl.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,21 @@ class AccessManagerImpl : public AccessManager {
2121
private:
2222
friend class AccessManager;
2323

24-
AliroError _Init(const Callbacks &callbacks);
25-
AliroError _StartAccessDecision(const CryptoTypes::PublicKey &userPublicKey, bool isBleSession);
24+
AliroError _Init(const ApplicationCallbacks &callbacks);
25+
void _SetStackCallbacks(const StackCallbacks &callbacks);
26+
AliroError _VerifyAccessCredential(const CryptoTypes::PublicKey &userPublicKey, bool isNfcSession,
27+
SessionContext sessionContext);
28+
#ifdef CONFIG_ALIRO_BLE_TP
29+
AliroError _StartRangingSession(uint32_t rangingSessionId, const CryptoTypes::Ursk &ursk,
30+
SessionContext sessionContext);
31+
#endif // CONFIG_ALIRO_BLE_TP
2632
AliroError _AddPublicKey(const CryptoTypes::PublicKey &publicKey);
2733
AliroError _RemovePublicKey(const CryptoTypes::PublicKey &publicKey);
2834
void _ClearStoredKeys();
2935
void _SetMaxAllowedDistance(uint32_t maxDistance);
30-
uint32_t _GetMaxAllowedDistance() const;
31-
void _HandleRangingSessionData(const UwbRangingData &uwbData);
36+
uint32_t _GetMaxAllowedDistance();
37+
void _HandleRangingSessionData(SessionContext sessionContext, const UwbRangingData &uwbData);
38+
void _HandleSessionTermination(SessionContext sessionContext);
3239
};
3340

3441
inline AccessManager &AccessManagerInstance()

app/src/access_manager_impl_default/Kconfig

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66

7-
config ACCESS_MANAGER_MAX_STORED_KEYS
7+
config ALIRO_ACCESS_MANAGER_MAX_STORED_KEYS
88
int "Maximum number of stored public keys"
9-
default 1
9+
default 5
1010
help
1111
Specifies the maximum number of public keys that can be
1212
stored in the AccessManager. This determines the size of
1313
the statically allocated array for key storage.
1414

1515
if ALIRO_BLE_TP
1616

17-
config ACCESS_MANAGER_MAX_ALLOWED_DISTANCE_CM
17+
config ALIRO_ACCESS_MANAGER_MAX_ALLOWED_DISTANCE_CM
1818
int "Maximum allowed distance for granting access (cm)"
1919
default 100
2020
help
@@ -23,26 +23,33 @@ config ACCESS_MANAGER_MAX_ALLOWED_DISTANCE_CM
2323
This is used to determine if the Aliro User Device
2424
is within the allowed proximity range.
2525

26-
config AUTOMATIC_RANGING_SESSION_INITIATION
27-
bool "Automatic ranging session initiation"
28-
depends on SOC_SERIES_NRF53X
29-
default y
26+
choice ALIRO_ACCESS_MANAGER_TERMINATE_SESSION
27+
prompt "Terminate session on given condition"
28+
default ALIRO_ACCESS_MANAGER_TERMINATE_SESSION_ON_TIMEOUT
3029
help
31-
Specifies if the Reader Device will autonomously initiate
32-
the UWB ranging session in case the session is not initiated
33-
by the User Device after Access Protocol is finalized.
30+
Select the condition under which the AccessManager will
31+
terminate the current Aliro session.
3432

35-
if AUTOMATIC_RANGING_SESSION_INITIATION
33+
config ALIRO_ACCESS_MANAGER_TERMINATE_SESSION_ON_ACCESS_GRANTED
34+
bool "Terminate the session if the access was granted"
35+
help
36+
If enabled, the AccessManager will terminate each
37+
session immediately when an access is granted.
3638

37-
config RANGING_START_TIMEOUT_MS
38-
int "Ranging start timeout in ms"
39-
default 3000
39+
config ALIRO_ACCESS_MANAGER_TERMINATE_SESSION_ON_TIMEOUT
40+
bool "Terminate session on timeout"
4041
help
41-
Specifies the time a Reader Device waits before it
42-
initiates the ranging session by its own.
43-
Set 0 to initiate the ranging session immediately after
44-
the Access Protocol is finalized.
42+
If enabled, the AccessManager will terminate each ongoing
43+
session if it times out according to ALIRO_ACCESS_MANAGER_SESSION_TIMEOUT_MS.
44+
45+
endchoice
46+
47+
if ALIRO_ACCESS_MANAGER_TERMINATE_SESSION_ON_TIMEOUT
48+
49+
config ALIRO_ACCESS_MANAGER_SESSION_TIMEOUT_MS
50+
int "Session timeout in milliseconds"
51+
default 10000
4552

46-
endif # AUTOMATIC_RANGING_SESSION_INITIATION
53+
endif
4754

4855
endif # ALIRO_BLE_TP

0 commit comments

Comments
 (0)