Hi,
I am currently working on a product based on an nRF52832 (SDK 15.3, S112 6.1).
The firmware uses the Nordic UART Service to receive and send data from and to a smartphone.
I have added the Peer manager and set all characteristics access in ble_nus_init to SEC_JUST_WORKS.
When I connect to my device using nRF Connect mobile application, it works as expected : I can connect to the device and the bonding starts when I try to read of enable notification on a characteristic of the Nordic UART Service.
The problem is that if, on the smartphone side, I delete the bonding data, I am unable to connect again to the device. I see a popup on my Android smartphone requesting an "association with device null". If I click on the popup "Associate" button, I get connected, overwise there is a 30s timeout after which I get disconnected.
This is the logs I have when I try to connect after deleting the bonding data :
<debug> peer_manager_handler: Event PM_EVT_BONDED_PEER_CONNECTED<\r><\r><\n> <debug> peer_manager_handler: Previously bonded peer connected: role: Peripheral, conn_handle: 0, peer_id: 0<\r><\r><\n> <debug> peer_manager_handler: Event PM_EVT_CONN_SEC_PARAMS_REQ<\r><\r><\n> <debug> peer_manager_handler: Security parameter request<\r><\r><\n> <debug> peer_manager_handler: Event PM_EVT_PEER_DATA_UPDATE_SUCCEEDED<\r><\r><\n> <debug> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update<\r><\r><\n> <debug> peer_manager_handler: Event PM_EVT_LOCAL_DB_CACHE_APPLIED<\r><\r><\n> <debug> peer_manager_handler: Previously stored local DB applied: conn_handle: 0, peer_id: 0<\r><\r><\n> <debug> nrf_ble_gatt: Requesting to update ATT MTU to 247 bytes on connection 0x0.<\r><\r><\n> <info> app: Connected<\r><\r><\n> <debug> nrf_ble_gatt: ATT MTU updated to 247 bytes on connection 0x0 (response).<\r><\r><\n> <info> app: Data len is set to 0xF4(244)<\r><\r><\n> <debug> app: ATT MTU exchange completed. central 0xF7 peripheral 0xF7<\r><\r><\n> <info> app: Fast mode advertising<\r><\r><\n> <info> app: Disconnected<\r><\r><\n>
Is there a way for the device to detect that the central's bonding data is no longer valid and request a new bonding ? Why do you think the Android popup show "null" ? On the first bonding, I did not receive any popup on the smartphone side (Just works is used)...
Kind Regards.