BLE Multiple slave connection

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

cross mob
tomibayley
Level 1
Level 1
First reply posted First question asked Welcome!

Hello community!

I am using a Psoc 63 CYBLE-416045 processor and I need to be able to connect by BLE as Master to multiple Slaves.

Both the master and slaves are the same processor. I need to be able to send commands to as much of them as posible at the same time. The objective is to minimize the time needed for disconnecting from one device and reconnecting to another, i've seen that once the device is connected to the master the communication speed es much higher. 

Is this possible? is there any code example i could refer to? 

Thank  you in advance for any information related to this.

0 Likes
1 Solution
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

tomi,

Can I suggest something?   As long as the data you need to send to ALL slaves is the same and not too long (<31 bytes), you can just advertise it with the Master in Beacon mode.   It is in effect one-way from the Master to all listening slaves.  It's simple.  You just create the Advertisement packet you want and schedule the broadcasting intervals.

Pro:  You don't get (or expect) a response from any of the slaves.

Con: You don't get (or expect) a response from any of the slaves.

If you need to to have confirmation from the slaves that they received the message, there is a way.

Once you broadcast, you can go into listening (Scanning mode) to hear advertisement packets from your slaves that are responding.  Each slave would have a different BDADDR to identify which slave is responding.   You can then have an internal list to 'check off' which ones responded.

I have example code of two projects: Beacon and Scanner.   One will advertise and the other listen.  This may be a good starting point for you.

PSoC6-BLE-Beacon-and-Scanner-Creator-projects 

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

0 Likes
2 Replies
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

tomi,

Can I suggest something?   As long as the data you need to send to ALL slaves is the same and not too long (<31 bytes), you can just advertise it with the Master in Beacon mode.   It is in effect one-way from the Master to all listening slaves.  It's simple.  You just create the Advertisement packet you want and schedule the broadcasting intervals.

Pro:  You don't get (or expect) a response from any of the slaves.

Con: You don't get (or expect) a response from any of the slaves.

If you need to to have confirmation from the slaves that they received the message, there is a way.

Once you broadcast, you can go into listening (Scanning mode) to hear advertisement packets from your slaves that are responding.  Each slave would have a different BDADDR to identify which slave is responding.   You can then have an internal list to 'check off' which ones responded.

I have example code of two projects: Beacon and Scanner.   One will advertise and the other listen.  This may be a good starting point for you.

PSoC6-BLE-Beacon-and-Scanner-Creator-projects 

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
tomibayley
Level 1
Level 1
First reply posted First question asked Welcome!

len,

That seems like a very good idea! wil be trying that thank you very much

Tomi

0 Likes