Hi,
We have a product which needs to connect to both a peripheral and central device (a phone), after a pairing is made they get whitelisted.
The state in which the problem occurs is the following:
- Both the peripheral and central device have been paired and whitelisted but both are disconnected. The phone has bluetooth turned on.
The issue:
When the pheripheral device wants to connect to the local device a NRF_BLE_SCAN_EVT_WHITELIST_ADV_REPORT event occurs, we verify that the device is the peripheral by comparing the stored bonded data and print out the BLE mac address of the pheripheral device. Once verified we start a sd_ble_gap_connect with the details of the pheripheral device.
But instead of the pheripheral device being connected the phone connects and it connects as if it is a pheripheral device instead of a central device.
The address given to sd_ble_gap_connect call have been more than tripled checked to be sure that we initiate a connection to the pheripheral device.
Looking at peer_addr struct of the connected device in the NRF_BLE_SCAN_EVT_CONNECTED we can see that the peer address is valid but of type 0x4B which does not seem to be a valid type (at least it is not defined) and the adress does not correspond to the address of the phone nor the pheripheral device.
If the phones bluetooth is off or already connected there is no issue to start a connection from the pheripheral device.
Thanks for the help in advance,
Best Regards,
Andreas