I'm just trying to figuring out which is the best conf and sync_cb if in my application I want to pair with Android/iOs smartphones.
This is my configuration for the secure manager.
Code: Select all
ble_hs_cfg.sm_io_cap = 0;
ble_hs_cfg.sm_bonding = 1;
ble_hs_cfg.sm_our_key_dist = BLE_SM_PAIR_KEY_DIST_ENC | BLE_SM_PAIR_KEY_DIST_ID;
ble_hs_cfg.sm_their_key_dist = BLE_SM_PAIR_KEY_DIST_ENC | BLE_SM_PAIR_KEY_DIST_ID;
ble_hs_cfg.sm_mitm = 1;
ble_hs_cfg.sm_sc = 1;
Code: Select all
ble_hs_id_infer_auto(0, &addr_type);
uint8_t addr_val[6];
ble_hs_id_copy_addr(&addr_type, addr_val, NULL);
printf("\033[0;36m");
printf("Smartkey (host) address:\n");
for (int j = 0; j < 6; j++) {
printf("\033[0;36m");
printf("%x ",addr_val[j]);
}
printf("\n");
advertise();
- When I unpair client side (Smarphone) and not server side (ESP32) --> it kind recognise the smartphone but can't get encryption status change = 0.
- When I unpair server side (ESP32) (for this I've got a button which perform ble_store_clear() ) and not client side (Smartphone) --> First connection r/w over an encrypted gatt fails, the second connection will be ok.
Thanks for your help.