I have a Central + Peripheral running on the nRF52840 (SDK 14.2.0). I have it configured to automatically connect to 3 Peripheral connections and allow 1 Central connection (from a phone). When I start the application, this is what I'm seeing:
- If I connect the phone first (the 3 Peripheral devices are turned OFF), I don't run into any issues
- If I turn on even one of the Peripherals, the nRF52 board will automatically connect to it, but here's where the problem starts: The phone now cannot connect to the nRF52 board.
- When looking at the sniffer trace, it looks like the nRF52 is not responding to the data length update request
- In the log messages on the nRF52 I am seeing that the phone always connects on conn_handle 0x0 for some reason (even if there were other devices connected already. Is this expected?). But then I see that the data length update request is received for a connection handle that does not match the phone connection handle:
Peripheral: Peripheral connected on connection handle 0x0 ble_gatt: Peer on connection 0x2 requested a data length of 251 bytes. ble_gatt: Updating data length to 27 bytes on connection 0x2. ble_gatt: Data length updated to 27 on connection 0x2.
I'm pretty sure the update request is from the phone (I can see it getting sent in the sniffer trace).
Any ideas why this may be happening? and how to fix it?