PSOC 6 central/peripheral simultaneously

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
FaBi_2763241
Level 4
Level 4
10 likes given 5 likes given First like received

Hello all

I want to use a psoc 63 to connect to the client app as peripheral while at the same time being as central scanning/connecting to another peripheral(psoc 4).

I was able to do the above step, by using the psoc 4 device name as advertising and on the gapc_scan_progress_result event, connect to it from the psoc 63.

I am trying to write to a custom characteristic from the app to the psoc 4 device through the connection established with the psoc 63, basically the psoc 6 acting as a bridge to copy what has been written to its gatt db and write it to the psoc 4 which is connected to. The custom service and characteristics in the psoc 63 are both in server and client gatt db, I have implemented the event gatts_write_req to get data from the client app, and the Cy_BLE_GATTC_WriteCharacteristicValue in the gap_device_connected event to write the same data to the psoc 4 peripheral. Connections are established but can't make the write succeeding, actually it times out.

Is there a way to achieve this bridge implementation? (the multi role code example doesn't really apply to this scenario).

Regards

0 Likes
1 Solution
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi,

Please check the following points in your project:

1) Are you calling the Cy_BLE_GATTWriteResponse() API on the peripheral side (in your case it is both PSoC 6 and PSoC 4 device).

2) Have you gone through the code example CE224714 - PSoC 6 MCU IMPLEMENTING BLE MULTI-CONNECTION (3 MASTERS, 1 SLAVE)? If not, please go through this code example for the firmware flow.

https://www.cypress.com/documentation/code-examples/ce224714-psoc-6-mcu-implementing-ble-multi-conne...

3) Please check the communication between the PSoC 6 and its Master, PSoC 4 BLE and its Master.

Please check all the above points and kindly update back.

Thanks

Ganesh

View solution in original post

0 Likes
2 Replies
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi,

Please check the following points in your project:

1) Are you calling the Cy_BLE_GATTWriteResponse() API on the peripheral side (in your case it is both PSoC 6 and PSoC 4 device).

2) Have you gone through the code example CE224714 - PSoC 6 MCU IMPLEMENTING BLE MULTI-CONNECTION (3 MASTERS, 1 SLAVE)? If not, please go through this code example for the firmware flow.

https://www.cypress.com/documentation/code-examples/ce224714-psoc-6-mcu-implementing-ble-multi-conne...

3) Please check the communication between the PSoC 6 and its Master, PSoC 4 BLE and its Master.

Please check all the above points and kindly update back.

Thanks

Ganesh

0 Likes

Hi Ganesh

it does work now, the psoc 4 gets the packet and updates its gatt db.

in my case I had a custom service/characteristic in psoc 6 with the same UUIDs in both central and peripheral gatt, I deleted the instance in the peripheral role and after that the writing to the psoc 4 was successful. I think that was the trouble but not 100% confident to say.

Thanks

Fausto

0 Likes