I have a central application and peripheral application that are based on the multilink-central/multilink-peripheral examples.
I've modified them to run on the PCA10001 board. Everything seemed to be going well until I started having trouble bonding the two devices. I have them configured to delete all bonding information with a button press and perform undirected advertisement/scanning.
Suddenly I can't get much further than the completion of service discovery.
A successful connection on the central looked something like this:
BLE_GAP_EVT_ADV_REPORT
BLE_GAP_EVT_ADV_REPORT
BLE_GAP_EVT_ADV_REPORT
[DB]: Starting discovery of service with UUID 0x4a30 for Connection handle 0
[APPL]:[0x00] << DM_EVT_CONNECTION
[DB]: Discovery of service with UUID 0x4a30 completed with success for Connectionhandle 0
BLE_GATTC_EVT_WRITE_RSP
BLE_GATTC_EVT_HVX
Now my central gets stuck after discovery of service like this:
Scanning for new peer
BLE_GAP_EVT_ADV_REPORT
[DB]: Starting discovery of service with UUID 0x4a30 for Connection handle 0
[APPL]:[0x00] << DM_EVT_CONNECTION
[DB]: Discovery of service with UUID 0x4a30 completed with success for Connection handle 0
If I power off the peripheral, I get a disconnect event:
[APPL]:[0x00] >> DM_EVT_DISCONNECTION
So I know that the app is not hung up.
I just can't figure out why it stopped working. I've tried backtracking re-flashing etc.. but I can't get it to work again. It briefly worked while I was backtracking but then stopped working again without me changing anything.
Anyone have any ideas?
Edit: I modified my peripheral app from using
BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(&attr_md.write_perm);
BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(&cccd_md.write_perm);
to
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&attr_md.write_perm);
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&cccd_md.write_perm);
and it connected successfully. I then changed it back to requiring security and it continues to work.
Is there anyone out there that can help me understand what's going on?