Skip to content

Commit a057e5c

Browse files
committed
BLE - Cordio PAL SM: Fix force secure connection.
1 parent cd7d9c5 commit a057e5c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

features/FEATURE_BLE/targets/TARGET_CORDIO/source/CordioPalSecurityManager.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,13 @@ ble_error_t CordioSecurityManager::clear_resolving_list()
9696
ble_error_t CordioSecurityManager::set_secure_connections_support(
9797
bool enabled, bool secure_connections_only
9898
) {
99-
return BLE_ERROR_NOT_IMPLEMENTED;
99+
// secure connection support is enabled automatically at the stack level.
100+
if (secure_connections_only) {
101+
pSmpCfg->auth |= SMP_AUTH_SC_FLAG;
102+
} else {
103+
pSmpCfg->auth &= ~SMP_AUTH_SC_FLAG;
104+
}
105+
return BLE_ERROR_NONE;
100106
}
101107

102108
ble_error_t CordioSecurityManager::get_secure_connections_support(
@@ -289,9 +295,6 @@ ble_error_t CordioSecurityManager::send_pairing_request(
289295
KeyDistribution initiator_dist,
290296
KeyDistribution responder_dist
291297
) {
292-
//FIXME: understand if this is required
293-
pSmpCfg->auth = authentication_requirements.value();
294-
295298
DmSecPairReq(
296299
connection,
297300
oob_data_flag,

0 commit comments

Comments
 (0)