@@ -247,6 +247,7 @@ class SecurityManager
247247 // Pairing
248248 //
249249
250+ #if BLE_ROLE_PERIPHERAL
250251 /* *
251252 * Request application to accept or reject pairing. Application should respond by
252253 * calling the appropriate function: acceptPairingRequest or cancelPairingRequest
@@ -256,6 +257,7 @@ class SecurityManager
256257 virtual void pairingRequest (ble::connection_handle_t connectionHandle) {
257258 (void )connectionHandle;
258259 }
260+ #endif // BLE_ROLE_PERIPHERAL
259261
260262 /* *
261263 * Indicate to the application that pairing has completed.
@@ -327,6 +329,7 @@ class SecurityManager
327329 (void )passkey;
328330 }
329331
332+ #if BLE_FEATURE_SECURE_CONNECTIONS
330333 /* *
331334 * Indicate to the application that a confirmation is required. This is used
332335 * when the device does not have a keyboard but has a yes/no button. The device
@@ -339,6 +342,7 @@ class SecurityManager
339342 virtual void confirmationRequest (ble::connection_handle_t connectionHandle) {
340343 (void )connectionHandle;
341344 }
345+ #endif // BLE_FEATURE_SECURE_CONNECTIONS
342346
343347 /* *
344348 * Indicate to the application that a passkey is required. The application should
@@ -350,6 +354,7 @@ class SecurityManager
350354 (void )connectionHandle;
351355 }
352356
357+ #if BLE_FEATURE_SECURE_CONNECTIONS
353358 /* *
354359 * Notify the application that a key was pressed by the peer during passkey entry.
355360 *
@@ -360,6 +365,7 @@ class SecurityManager
360365 (void )connectionHandle;
361366 (void )keypress;
362367 }
368+ #endif // BLE_FEATURE_SECURE_CONNECTIONS
363369
364370 /* *
365371 * Indicate to the application it needs to return legacy pairing OOB to the stack.
@@ -402,6 +408,7 @@ class SecurityManager
402408 // Keys
403409 //
404410
411+ #if BLE_FEATURE_SIGNING
405412 /* *
406413 * Deliver the signing key to the application.
407414 *
@@ -414,6 +421,8 @@ class SecurityManager
414421 (void )csrk;
415422 (void )authenticated;
416423 }
424+ #endif // BLE_FEATURE_SIGNING
425+
417426 /* *
418427 * Prevent polymorphic deletion and avoid unnecessary virtual destructor
419428 * as the SecurityManager class will never delete the instance it contains.
@@ -526,6 +535,7 @@ class SecurityManager
526535 // Pairing
527536 //
528537
538+ #if BLE_ROLE_CENTRAL
529539 /* *
530540 * Request pairing with the peer. Called by the master.
531541 * @note Slave can call requestAuthentication or setLinkEncryption to achieve security.
@@ -534,7 +544,9 @@ class SecurityManager
534544 * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
535545 */
536546 ble_error_t requestPairing (ble::connection_handle_t connectionHandle);
547+ #endif // BLE_ROLE_CENTRAL
537548
549+ #if BLE_ROLE_PERIPHERAL
538550 /* *
539551 * Accept the pairing request. Called as a result of pairingRequest being called
540552 * on the event handler.
@@ -543,6 +555,7 @@ class SecurityManager
543555 * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
544556 */
545557 ble_error_t acceptPairingRequest (ble::connection_handle_t connectionHandle);
558+ #endif // BLE_ROLE_PERIPHERAL
546559
547560 /* *
548561 * Reject pairing request if the local device is the slave or cancel an outstanding
@@ -577,6 +590,7 @@ class SecurityManager
577590 // Feature support
578591 //
579592
593+ #if BLE_FEATURE_SECURE_CONNECTIONS
580594 /* *
581595 * Allow of disallow the use of legacy pairing in case the application only wants
582596 * to force the use of Secure Connections. If legacy pairing is disallowed and either
@@ -594,6 +608,7 @@ class SecurityManager
594608 * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
595609 */
596610 ble_error_t getSecureConnectionsSupport (bool *enabled);
611+ #endif // BLE_FEATURE_SECURE_CONNECTIONS
597612
598613 // //////////////////////////////////////////////////////////////////////////
599614 // Security settings
@@ -766,6 +781,7 @@ class SecurityManager
766781 */
767782 ble_error_t setOOBDataUsage (ble::connection_handle_t connectionHandle, bool useOOB, bool OOBProvidesMITM = true );
768783
784+ #if BLE_FEATURE_SECURE_CONNECTIONS
769785 /* *
770786 * Report to the stack if the passkey matches or not. Used during pairing to provide MITM protection.
771787 *
@@ -774,6 +790,7 @@ class SecurityManager
774790 * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
775791 */
776792 ble_error_t confirmationEntered (ble::connection_handle_t connectionHandle, bool confirmation);
793+ #endif // BLE_FEATURE_SECURE_CONNECTIONS
777794
778795 /* *
779796 * Supply the stack with the user entered passkey.
@@ -784,6 +801,7 @@ class SecurityManager
784801 */
785802 ble_error_t passkeyEntered (ble::connection_handle_t connectionHandle, Passkey_t passkey);
786803
804+ #if BLE_FEATURE_SECURE_CONNECTIONS
787805 /* *
788806 * Send a notification to the peer that the user pressed a key on the local device.
789807 * @note This will only be delivered if the keypress notifications have been enabled during pairing.
@@ -793,6 +811,7 @@ class SecurityManager
793811 * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
794812 */
795813 ble_error_t sendKeypressNotification (ble::connection_handle_t connectionHandle, ble::Keypress_t keypress);
814+ #endif // BLE_FEATURE_SECURE_CONNECTIONS
796815
797816 /* *
798817 * Supply the stack with the OOB data for legacy connections.
@@ -803,6 +822,7 @@ class SecurityManager
803822 */
804823 ble_error_t legacyPairingOobReceived (const ble::address_t *address, const ble::oob_tk_t *tk);
805824
825+ #if BLE_FEATURE_SECURE_CONNECTIONS
806826 /* *
807827 * Supply the stack with the OOB data for secure connections.
808828 *
@@ -813,11 +833,13 @@ class SecurityManager
813833 * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
814834 */
815835 ble_error_t oobReceived (const ble::address_t *address, const ble::oob_lesc_value_t *random, const ble::oob_confirm_t *confirm);
836+ #endif // BLE_FEATURE_SECURE_CONNECTIONS
816837
817838 // //////////////////////////////////////////////////////////////////////////
818839 // Keys
819840 //
820841
842+ #if BLE_FEATURE_SIGNING
821843 /* *
822844 * Retrieves a signing key through a signingKey event.
823845 * If a signing key is not present, pairing/authentication will be attempted.
@@ -830,6 +852,7 @@ class SecurityManager
830852 * @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
831853 */
832854 ble_error_t getSigningKey (ble::connection_handle_t connectionHandle, bool authenticated);
855+ #endif // BLE_FEATURE_SIGNING
833856
834857 // //////////////////////////////////////////////////////////////////////////
835858 // Privacy
0 commit comments