File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -877,17 +877,21 @@ bool NimBLEDevice::init(const std::string& deviceName) {
877
877
nimble_port_init ();
878
878
879
879
// Setup callbacks for host events
880
- ble_hs_cfg.reset_cb = NimBLEDevice::onReset;
881
- ble_hs_cfg.sync_cb = NimBLEDevice::onSync;
880
+ ble_hs_cfg.reset_cb = NimBLEDevice::onReset;
881
+ ble_hs_cfg.sync_cb = NimBLEDevice::onSync;
882
+ ble_hs_cfg.store_status_cb = ble_store_util_status_rr; /* TODO: Implement handler for this*/
882
883
883
884
// Set initial security capabilities
884
885
ble_hs_cfg.sm_io_cap = BLE_HS_IO_NO_INPUT_OUTPUT;
885
886
ble_hs_cfg.sm_bonding = 0 ;
886
887
ble_hs_cfg.sm_mitm = 0 ;
887
888
ble_hs_cfg.sm_sc = 1 ;
888
- ble_hs_cfg.sm_our_key_dist = BLE_SM_PAIR_KEY_DIST_ENC | BLE_SM_PAIR_KEY_DIST_ID;
889
- ble_hs_cfg.sm_their_key_dist = BLE_SM_PAIR_KEY_DIST_ENC | BLE_SM_PAIR_KEY_DIST_ID;
890
- ble_hs_cfg.store_status_cb = ble_store_util_status_rr; /* TODO: Implement handler for this*/
889
+ ble_hs_cfg.sm_our_key_dist = BLE_SM_PAIR_KEY_DIST_ENC;
890
+ ble_hs_cfg.sm_their_key_dist = BLE_SM_PAIR_KEY_DIST_ENC;
891
+ # if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PRIVACY)
892
+ ble_hs_cfg.sm_our_key_dist |= BLE_SM_PAIR_KEY_DIST_ID;
893
+ ble_hs_cfg.sm_their_key_dist |= BLE_SM_PAIR_KEY_DIST_ID;
894
+ # endif
891
895
892
896
setDeviceName (deviceName);
893
897
ble_store_config_init ();
You can’t perform that action at this time.
0 commit comments