@@ -247,6 +247,7 @@ class SecurityManager
247
247
// Pairing
248
248
//
249
249
250
+ #if BLE_ROLE_PERIPHERAL
250
251
/* *
251
252
* Request application to accept or reject pairing. Application should respond by
252
253
* calling the appropriate function: acceptPairingRequest or cancelPairingRequest
@@ -256,6 +257,7 @@ class SecurityManager
256
257
virtual void pairingRequest (ble::connection_handle_t connectionHandle) {
257
258
(void )connectionHandle;
258
259
}
260
+ #endif // BLE_ROLE_PERIPHERAL
259
261
260
262
/* *
261
263
* Indicate to the application that pairing has completed.
@@ -327,6 +329,7 @@ class SecurityManager
327
329
(void )passkey;
328
330
}
329
331
332
+ #if BLE_FEATURE_SECURE_CONNECTIONS
330
333
/* *
331
334
* Indicate to the application that a confirmation is required. This is used
332
335
* when the device does not have a keyboard but has a yes/no button. The device
@@ -339,6 +342,7 @@ class SecurityManager
339
342
virtual void confirmationRequest (ble::connection_handle_t connectionHandle) {
340
343
(void )connectionHandle;
341
344
}
345
+ #endif // BLE_FEATURE_SECURE_CONNECTIONS
342
346
343
347
/* *
344
348
* Indicate to the application that a passkey is required. The application should
@@ -350,6 +354,7 @@ class SecurityManager
350
354
(void )connectionHandle;
351
355
}
352
356
357
+ #if BLE_FEATURE_SECURE_CONNECTIONS
353
358
/* *
354
359
* Notify the application that a key was pressed by the peer during passkey entry.
355
360
*
@@ -360,6 +365,7 @@ class SecurityManager
360
365
(void )connectionHandle;
361
366
(void )keypress;
362
367
}
368
+ #endif // BLE_FEATURE_SECURE_CONNECTIONS
363
369
364
370
/* *
365
371
* Indicate to the application it needs to return legacy pairing OOB to the stack.
@@ -402,6 +408,7 @@ class SecurityManager
402
408
// Keys
403
409
//
404
410
411
+ #if BLE_FEATURE_SIGNING
405
412
/* *
406
413
* Deliver the signing key to the application.
407
414
*
@@ -414,6 +421,8 @@ class SecurityManager
414
421
(void )csrk;
415
422
(void )authenticated;
416
423
}
424
+ #endif // BLE_FEATURE_SIGNING
425
+
417
426
/* *
418
427
* Prevent polymorphic deletion and avoid unnecessary virtual destructor
419
428
* as the SecurityManager class will never delete the instance it contains.
@@ -526,6 +535,7 @@ class SecurityManager
526
535
// Pairing
527
536
//
528
537
538
+ #if BLE_ROLE_CENTRAL
529
539
/* *
530
540
* Request pairing with the peer. Called by the master.
531
541
* @note Slave can call requestAuthentication or setLinkEncryption to achieve security.
@@ -534,7 +544,9 @@ class SecurityManager
534
544
* @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
535
545
*/
536
546
ble_error_t requestPairing (ble::connection_handle_t connectionHandle);
547
+ #endif // BLE_ROLE_CENTRAL
537
548
549
+ #if BLE_ROLE_PERIPHERAL
538
550
/* *
539
551
* Accept the pairing request. Called as a result of pairingRequest being called
540
552
* on the event handler.
@@ -543,6 +555,7 @@ class SecurityManager
543
555
* @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
544
556
*/
545
557
ble_error_t acceptPairingRequest (ble::connection_handle_t connectionHandle);
558
+ #endif // BLE_ROLE_PERIPHERAL
546
559
547
560
/* *
548
561
* Reject pairing request if the local device is the slave or cancel an outstanding
@@ -577,6 +590,7 @@ class SecurityManager
577
590
// Feature support
578
591
//
579
592
593
+ #if BLE_FEATURE_SECURE_CONNECTIONS
580
594
/* *
581
595
* Allow of disallow the use of legacy pairing in case the application only wants
582
596
* to force the use of Secure Connections. If legacy pairing is disallowed and either
@@ -594,6 +608,7 @@ class SecurityManager
594
608
* @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
595
609
*/
596
610
ble_error_t getSecureConnectionsSupport (bool *enabled);
611
+ #endif // BLE_FEATURE_SECURE_CONNECTIONS
597
612
598
613
// //////////////////////////////////////////////////////////////////////////
599
614
// Security settings
@@ -766,6 +781,7 @@ class SecurityManager
766
781
*/
767
782
ble_error_t setOOBDataUsage (ble::connection_handle_t connectionHandle, bool useOOB, bool OOBProvidesMITM = true );
768
783
784
+ #if BLE_FEATURE_SECURE_CONNECTIONS
769
785
/* *
770
786
* Report to the stack if the passkey matches or not. Used during pairing to provide MITM protection.
771
787
*
@@ -774,6 +790,7 @@ class SecurityManager
774
790
* @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
775
791
*/
776
792
ble_error_t confirmationEntered (ble::connection_handle_t connectionHandle, bool confirmation);
793
+ #endif // BLE_FEATURE_SECURE_CONNECTIONS
777
794
778
795
/* *
779
796
* Supply the stack with the user entered passkey.
@@ -784,6 +801,7 @@ class SecurityManager
784
801
*/
785
802
ble_error_t passkeyEntered (ble::connection_handle_t connectionHandle, Passkey_t passkey);
786
803
804
+ #if BLE_FEATURE_SECURE_CONNECTIONS
787
805
/* *
788
806
* Send a notification to the peer that the user pressed a key on the local device.
789
807
* @note This will only be delivered if the keypress notifications have been enabled during pairing.
@@ -793,6 +811,7 @@ class SecurityManager
793
811
* @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
794
812
*/
795
813
ble_error_t sendKeypressNotification (ble::connection_handle_t connectionHandle, ble::Keypress_t keypress);
814
+ #endif // BLE_FEATURE_SECURE_CONNECTIONS
796
815
797
816
/* *
798
817
* Supply the stack with the OOB data for legacy connections.
@@ -803,6 +822,7 @@ class SecurityManager
803
822
*/
804
823
ble_error_t legacyPairingOobReceived (const ble::address_t *address, const ble::oob_tk_t *tk);
805
824
825
+ #if BLE_FEATURE_SECURE_CONNECTIONS
806
826
/* *
807
827
* Supply the stack with the OOB data for secure connections.
808
828
*
@@ -813,11 +833,13 @@ class SecurityManager
813
833
* @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
814
834
*/
815
835
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
816
837
817
838
// //////////////////////////////////////////////////////////////////////////
818
839
// Keys
819
840
//
820
841
842
+ #if BLE_FEATURE_SIGNING
821
843
/* *
822
844
* Retrieves a signing key through a signingKey event.
823
845
* If a signing key is not present, pairing/authentication will be attempted.
@@ -830,6 +852,7 @@ class SecurityManager
830
852
* @return BLE_ERROR_NONE or appropriate error code indicating the failure reason.
831
853
*/
832
854
ble_error_t getSigningKey (ble::connection_handle_t connectionHandle, bool authenticated);
855
+ #endif // BLE_FEATURE_SIGNING
833
856
834
857
// //////////////////////////////////////////////////////////////////////////
835
858
// Privacy
0 commit comments