This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

device manager central problem

I use s130 based device as central to connect to my ios device, when connected, the central will issue a bond request, if user accept this request on ios device, the bond finish, and the related infomation will be saved.

I found that the ios device's addr type in it's advertiing packet is BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE, and the addr type in saved information is BLE_GAP_ADDR_TYPE_PUBLIC (already resolved),so when the central connect to the same peripheral again, device_manager_central cannot recognise it because it just simply compare the private_resolvable addr and the public addr which will never equal:

line 767: if (memcmp(&m_peer_table[index].peer_id.id_addr_info, p_addr, sizeof(ble_gap_addr_t)) == 0)

if the central call dm_security_setup_req() again, that will issue another bond.

so my question is:

  1. Is this a bug or something? how can I reuse the saved information?

  2. What's the irk_match and irk_match_idx in ble_gap_evt_connected_t? Can the stack resolve the addr automaticly? how?

Edit: tested in sdk_6.0.0+s130_0.9.0alpha and sdk_6.1.0+s130_0.9.0alpha, both can't recognise the same device, and I checked sdk_7.1.0 and sdk_7.2.0, seems there are no changes in device_manager_central.c, I believe the same problem exists in sdk7.x.x too.

Related