This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

let a peripheral select a central device to connect to

Other Parts Discussed in Thread: CC2540

Hi,

I'm trying to program a device in peripheral mode which shall select its central-device from a priority list. So like sending out open advertising, waiting for a while and then refuse every request but the one from the one's available that has the highest priority.

I thought about using a multi-role peripheral+observer and the central device using broadcast+central so the peripheral can find available devices and send a directed advertisement, but as the central device shall be a smartphone for example with android and android only supports peripheral/broadcast mode since version 5.0 this would only be a partial solution.

My next idea is to connect once to every single device collect its address and disconnect again. the disconnected master devices shall not try to connect for a while. When there are no more master devices responding to the advertising, the peripheral will check the priority list and send out a directed advertising to the master with the highest priority. if no device from the list is available, the peripheral will use undirected advertising and connect with whoever wants to.

But I'm not sure if this is the easiest way to go and if it really is achievable so I'd be thankful for any advice.

I'm using the cc2540 on a custom board derived from the ti blelights example. The lights shall be controlled by a custom android/ios app.

Thanks

Robin

  • Hi Robin,

    Since you indicate that you intend for the Central device to be a Android or iOS device, you're options are limited. I suggest first reviewing the Apple Bluetooth Accessory Design Guidelines document as well. Specifically, ADV_DIRECT_IND should not be used as per this document.

    Also, using the whitelist on the peripheral is not advisable. See this thread: e2e.ti.com/.../379356

    One option may be to change your Adv data such that your iOS or Android app "knows" that the peripheral is requesting a connection request.

    Best wishes
  • thanks for your advice, I'll try and see if I'll get it working by putting information into advertising data!