NRF52832 / S332 / SDK 14.2
Step 1: connect to mobile phone as Peripheral Role, and the connect handler of service was #0 that equal to Peripheral-connection handler number.
Regular sent out the notifications to mobile phone.
Step 2: connect to other BLE device as Central Role, and the connect handler of service changed to #1 that equal to Central Roles'.
Mobile phone no more got the notifications.
But, if I changed the connection sequence as following, then anything is fine althrough the connect handler of service also swap to new one:
Step 1: connect to BLE device as Central Role. Step 2: connect to mobile phone as Peripheral Role.
Additional information:
I added a special workaround in beginning of ble_dispatch_handler to solve the wrong role (BLE_GAP_ROLE_INVALID) for first connection:
if ((p_ble_evt->header.evt_id == BLE_GAP_EVT_CONNECTED) && (role == BLE_GAP_ROLE_INVALID))
{
(void)sd_ble_gap_disconnect(conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
// Do not process the event further.
return;
}
Does it make the further problem? if so, any suggest workaround for SDK 14.2/S332?
Please help, thank you.