@@ -723,13 +723,10 @@ BLEStack BLEDevice::getBLEStack() {
723
723
724
724
String BLEDevice::getBLEStackString () {
725
725
switch (getBLEStack ()) {
726
- case BLEStack::BLUEDROID:
727
- return " Bluedroid" ;
728
- case BLEStack::NIMBLE:
729
- return " NimBLE" ;
726
+ case BLEStack::BLUEDROID: return " Bluedroid" ;
727
+ case BLEStack::NIMBLE: return " NimBLE" ;
730
728
case BLEStack::UNKNOWN:
731
- default :
732
- return " Unknown" ;
729
+ default : return " Unknown" ;
733
730
}
734
731
}
735
732
@@ -829,7 +826,7 @@ void BLEDevice::gapEventHandler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_par
829
826
case ESP_GAP_BLE_OOB_REQ_EVT: /* OOB request event */ log_i (" ESP_GAP_BLE_OOB_REQ_EVT" ); break ;
830
827
case ESP_GAP_BLE_LOCAL_IR_EVT: /* BLE local IR event */ log_i (" ESP_GAP_BLE_LOCAL_IR_EVT" ); break ;
831
828
case ESP_GAP_BLE_LOCAL_ER_EVT: /* BLE local ER event */ log_i (" ESP_GAP_BLE_LOCAL_ER_EVT" ); break ;
832
- case ESP_GAP_BLE_NC_REQ_EVT: /* NUMERIC CONFIRMATION */
829
+ case ESP_GAP_BLE_NC_REQ_EVT: /* NUMERIC CONFIRMATION */
833
830
{
834
831
log_i (" ESP_GAP_BLE_NC_REQ_EVT" );
835
832
#ifdef CONFIG_BLE_SMP_ENABLE // Check that BLE SMP (security) is configured in make menuconfig
@@ -840,8 +837,7 @@ void BLEDevice::gapEventHandler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_par
840
837
esp_ble_confirm_reply (param->ble_security .ble_req .bd_addr , false );
841
838
}
842
839
#endif // CONFIG_BLE_SMP_ENABLE
843
- }
844
- break ;
840
+ } break ;
845
841
case ESP_GAP_BLE_PASSKEY_REQ_EVT: /* passkey request event */
846
842
{
847
843
log_i (" ESP_GAP_BLE_PASSKEY_REQ_EVT: " );
@@ -867,8 +863,7 @@ void BLEDevice::gapEventHandler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_par
867
863
868
864
esp_ble_passkey_reply (param->ble_security .ble_req .bd_addr , true , passkey);
869
865
#endif // CONFIG_BLE_SMP_ENABLE
870
- }
871
- break ;
866
+ } break ;
872
867
/*
873
868
* TODO should we add white/black list comparison?
874
869
*/
@@ -885,8 +880,7 @@ void BLEDevice::gapEventHandler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_par
885
880
esp_ble_gap_security_rsp (param->ble_security .ble_req .bd_addr , true );
886
881
}
887
882
#endif // CONFIG_BLE_SMP_ENABLE
888
- }
889
- break ;
883
+ } break ;
890
884
/*
891
885
*
892
886
*/
@@ -897,7 +891,7 @@ void BLEDevice::gapEventHandler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_par
897
891
#ifdef CONFIG_BLE_SMP_ENABLE // Check that BLE SMP (security) is configured in make menuconfig
898
892
uint32_t passkey = param->ble_security .key_notif .passkey ;
899
893
900
- if (!BLESecurity::m_passkeySet) {
894
+ if (!BLESecurity::m_passkeySet) {
901
895
log_w (" No passkey set" );
902
896
}
903
897
@@ -912,17 +906,15 @@ void BLEDevice::gapEventHandler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_par
912
906
BLEDevice::m_securityCallbacks->onPassKeyNotify (passkey);
913
907
}
914
908
#endif // CONFIG_BLE_SMP_ENABLE
915
- }
916
- break ;
909
+ } break ;
917
910
case ESP_GAP_BLE_KEY_EVT:
918
911
{
919
912
// shows the ble key type info share with peer device to the user.
920
913
log_d (" ESP_GAP_BLE_KEY_EVT" );
921
914
#ifdef CONFIG_BLE_SMP_ENABLE // Check that BLE SMP (security) is configured in make menuconfig
922
915
log_i (" key type = %s" , BLESecurity::esp_key_type_to_str (param->ble_security .ble_key .key_type ));
923
916
#endif // CONFIG_BLE_SMP_ENABLE
924
- }
925
- break ;
917
+ } break ;
926
918
case ESP_GAP_BLE_AUTH_CMPL_EVT:
927
919
{
928
920
log_i (" ESP_GAP_BLE_AUTH_CMPL_EVT" );
@@ -931,8 +923,7 @@ void BLEDevice::gapEventHandler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_par
931
923
BLEDevice::m_securityCallbacks->onAuthenticationComplete (param->ble_security .auth_cmpl );
932
924
}
933
925
#endif // CONFIG_BLE_SMP_ENABLE
934
- }
935
- break ;
926
+ } break ;
936
927
default :
937
928
{
938
929
break ;
@@ -964,8 +955,6 @@ void BLEDevice::setCustomGattsHandler(gatts_event_handler handler) {
964
955
m_customGattsHandler = handler;
965
956
}
966
957
967
-
968
-
969
958
#endif
970
959
971
960
/* **************************************************************************
0 commit comments