I have an Psoc63 as BLE 5 central and three PSoC 4200 as BLE 4.2 peripheral. After a successful discovery from central using whitelist I try to connect to one of the three peripheral using his address. Unexpectedly the central was connected with a peripheral with different address!!!!! Also I try an unexisting address and again it was connected with a random peripheral with different address. Maybe the issue arise from the BLE 4.2 peripherals.
I will appreciate your help to this
Please check the address type of your peripheral device. You can use the CyBle_GetDeviceAddress() api to get device address and address type. If your peripheral device is set with Random Device address, then set your device with Public Device Address. Please refer to the BLE Component datasheet for more information.
If you are still facing the issue then please share your peripheral project.
For the peripheral devices I use the BLE_Battery_Level example from PSoc Creator. I have checked that the address is Public from default.
I try Cy_BLE_GAPC_ConnectDevice() from central with an unexisting address (00:00:00:00:00:00) and still connected with the first discovered peripheral. I double checked that the address passed to Cy_BLE_GAPC_InitConnection() is the one I put.
Inside the CY_BLE_EVT_GAP_DEVICE_CONNECTED event, from the central side, I check the (cy_stc_ble_gap_connected_param_t *)eventParam)->peerAddr and I found that the peripheral address that actually has been connected is not the address I have put at Cy_BLE_GAPC_ConnectDevice().
When I connect to the same peripherals with Cysmart 1.3 using BLE 4.1 USB Dongle as central all works as expected. That make me thinking that maybe something go wrong with PSoc 63 and BLE 5 lib.
I tried connecting the device with address (00:00:00:00:00:00), but I'm not able to establish the connection, where I got an error from the API Cy_BLE_GAPC_ConnectDevice(). Could you please share your project so that we can check at our end ?
Please check the "CE222046 Throughput_Measurement" code example from the PSoC Creator for reference.