Skip to content

Commit a31d101

Browse files
committed
BLE - Cleanup CordioPalSecurityManager conditional directives.
- Within constructor - Within member declaration - Private function declaration and definition.
1 parent b0d62a7 commit a31d101

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

features/FEATURE_BLE/targets/TARGET_CORDIO/CordioPalSecurityManager.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ class CordioSecurityManager : public ::ble::pal::SecurityManager<CordioSecurityM
238238
*/
239239
ble_error_t set_irk_(const irk_t &irk);
240240

241-
#if BLE_FEATURE_SIGNING
242241
/**
243242
* @see ::ble::pal::SecurityManager::set_csrk
244243
*/
@@ -258,7 +257,6 @@ class CordioSecurityManager : public ::ble::pal::SecurityManager<CordioSecurityM
258257
);
259258

260259
ble_error_t remove_peer_csrk_(connection_handle_t connection);
261-
#endif // BLE_FEATURE_SIGNING
262260

263261
////////////////////////////////////////////////////////////////////////////
264262
// Authentication
@@ -363,10 +361,8 @@ class CordioSecurityManager : public ::ble::pal::SecurityManager<CordioSecurityM
363361
// Try to dequeue and process the next control block
364362
// cb_completed is set when the previous block has completed
365363
void process_privacy_control_blocks(bool cb_completed);
366-
367-
#if BLE_FEATURE_SIGNING
364+
368365
void cleanup_peer_csrks();
369-
#endif
370366

371367
bool _use_default_passkey;
372368
passkey_num_t _default_passkey;
@@ -377,10 +373,8 @@ class CordioSecurityManager : public ::ble::pal::SecurityManager<CordioSecurityM
377373
bool _processing_privacy_control_block;
378374
irk_t _irk;
379375

380-
#if BLE_FEATURE_SIGNING
381376
csrk_t _csrk;
382377
csrk_t* _peer_csrks[DM_CONN_MAX];
383-
#endif // BLE_FEATURE_SIGNING
384378
};
385379

386380
} // cordio

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

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
#include "BLERoles.h"
1818

19-
#if BLE_FEATURE_SECURITY
20-
2119
#include <string.h>
2220

2321
#include "CordioPalSecurityManager.h"
@@ -39,10 +37,8 @@ CordioSecurityManager<EventHandler>::CordioSecurityManager() :
3937
_lesc_keys_generated(false),
4038
_public_key_x(),
4139
_pending_privacy_control_blocks(NULL),
42-
_processing_privacy_control_block(false)
43-
#if BLE_FEATURE_SIGNING
44-
, _peer_csrks()
45-
#endif
40+
_processing_privacy_control_block(false),
41+
_peer_csrks()
4642
{
4743
}
4844

@@ -332,7 +328,6 @@ ble_error_t CordioSecurityManager<EventHandler>::set_irk_(const irk_t& irk)
332328
return BLE_ERROR_NONE;
333329
}
334330

335-
#if BLE_FEATURE_SIGNING
336331
template <class EventHandler>
337332
ble_error_t CordioSecurityManager<EventHandler>::set_csrk_(
338333
const csrk_t& csrk,
@@ -390,7 +385,6 @@ ble_error_t CordioSecurityManager<EventHandler>::remove_peer_csrk_(connection_ha
390385
AttsSetCsrk(connection, NULL, false);
391386
return BLE_ERROR_NONE;
392387
}
393-
#endif // BLE_FEATURE_SIGNING
394388

395389
////////////////////////////////////////////////////////////////////////////
396390
// Global parameters
@@ -1011,7 +1005,6 @@ void CordioSecurityManager<EventHandler>::process_privacy_control_blocks(bool cb
10111005
_pending_privacy_control_blocks = next;
10121006
}
10131007

1014-
#if BLE_FEATURE_SIGNING
10151008
template <class EventHandler>
10161009
void CordioSecurityManager<EventHandler>::cleanup_peer_csrks() {
10171010
for (size_t i = 0; i < DM_CONN_MAX; ++i) {
@@ -1021,11 +1014,8 @@ void CordioSecurityManager<EventHandler>::cleanup_peer_csrks() {
10211014
}
10221015
}
10231016
}
1024-
#endif // BLE_FEATURE_SIGNING
10251017

10261018
} // cordio
10271019
} // vendor
10281020
} // pal
10291021
} // ble
1030-
1031-
#endif // BLE_FEATURE_SECURITY

0 commit comments

Comments
 (0)