Connections using UUID between two BLE modules

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

cross mob
saga_1136906
Level 3
Level 3
10 replies posted 10 questions asked 10 sign-ins

Hello everyone,

I'm new with BLE and I established a connection between a central Android smartphone and a BLE module, peripheral. I used UUIDs to get this connection. Now I would like to create a communication between the same peripheral BLE and another BLE module that works as a central unit: is it possible to do this always using the UUIDs of the services and features? I also looked at the examples in "Day020_BLE_UART" but I don't understand how to modify the programs. Can anyone give me a hand?

Thank you.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

In the peripheral BLE scan response data please enable the service UUID as shown in attached image then the scan response packet will contains the service UUID values of that peripheral device. We can check for particular service UUID value at the central device and then connect.

Please refer to the attached project where in the scan progress event "CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT" of central device I'm filtering with particular service UUID of peripheral.

Thanks,

P Yugandhar.

View solution in original post

0 Likes
14 Replies
lock attach
Attachments are accessible only for community members.
Yugandhar
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 5 likes given

Hello,

In the peripheral BLE scan response data please enable the service UUID as shown in attached image then the scan response packet will contains the service UUID values of that peripheral device. We can check for particular service UUID value at the central device and then connect.

Please refer to the attached project where in the scan progress event "CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT" of central device I'm filtering with particular service UUID of peripheral.

Thanks,

P Yugandhar.

0 Likes

Hi P Yugandhar,

Thank you for your answer. However, I must tell you that the two projects you have attached only open the "central" project. Did I make any mistakes?

Thanks

0 Likes

Solved, excuse me...

0 Likes

Hi P Yugandhar,

the projects work fine. Now wish to transmit data from peripheral to central. There is a way to obtain this?

Thanks

0 Likes

Hello,

Please refer to the same attached project which was taken from GitHub( Day020_BLE_UART ) which gives information on handling BLE central and peripheral communication.

Thanks,

P Yugandhar.

0 Likes

Hi P Yugandhar,

if I modify some hexadecimal values in the lines 35 to 50 of app_ble.c, so that the UUIDs are different from those of the peripheral, the serial monitor always gives:

"Server with matching custom service discovered ...

Connection established".

I do not understand why

Thanks

0 Likes

Hello,

In the scan progress event "CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT", advReport->data values will contains the peripheral service UUID values (if we enable the service UUID in scan response data in peripheral device). Before establishing the connection we are checking with these scan response data.

Thanks,

P Yugandhar.

0 Likes

Hi P Yugandhar,

I'm using the two projects of Day20_BLE_UART. The configurations of the UARTs are the same. Once the connections have been established I see the data written on the control unit terminal pass on the peripheral device, but I do not see the data passing from the peripheral to the control unit. Reading the pdf attached to Day20_BLE_UART it seems to me that the exchange must be reciprocal or did I understand wrong?

Thanks

0 Likes

Hello,

The data sent through the terminal application at one end, appears at the other end i.e., the data entered on peripheral will appear at the central and vice versa.

Thanks,

P Yugandhar.

0 Likes

Hi P Yugandhar,

then I don't understand why if I write data in the CENTRAL side of Teraterm I see data in the PERIPHERAL side of Teraterm and not vice versa

Thanks

0 Likes

Hello,

Can you please share your project so that we can check and see what is the problem.

Thanks,

P Yugandhar.

0 Likes
lock attach
Attachments are accessible only for community members.

Hi P Yugandhar,

there it is.

Thanks

0 Likes
lock attach
Attachments are accessible only for community members.

Hello,

I didn't see any issue in printing data from central to peripheral and vice versa as shown in attached images. Please check with proper UART connections at your end.

Thanks,

P Yugandhar.

0 Likes

Hi P Yugandhar,

solved!

Thank you very much!

0 Likes