This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to tell central devices apart?

Hello.

I am running ble_app_uart altered to allow for connection of two central devices.

The connection of two devices work fine.

Upon each connected central, I can tell the connections apart if I make m_conn_handle into an array of 2, I guess.

Haven't done this yes, but that should not be a problem.

I can then connect two devices and call them instance 0 and instance 1.

But can I tell what kind of central they are?

For instance: if I, in any order, connect an iPhone and an Android phone (both running nRF toolbox) how do I know that connection instance 0 is an Android and not an iPhone?

Thanks.

Anders

Parents
  • Hi,

    You can separate peers with the connection handle as you describe yes.

    I am not aware of any built in feature in BLE that can identify a peer automatically, however you may for instance add a proprietary characteristic that the app running on the peer can write to after connection is established to identify itself. Think this would be the preferred option. Alternatively you can do a database discovery of the peer, however I would not expect that you could get any reliable information from this without doing this for many vendors and versions, this could also change if they update the peer.

    Kenneth

Reply
  • Hi,

    You can separate peers with the connection handle as you describe yes.

    I am not aware of any built in feature in BLE that can identify a peer automatically, however you may for instance add a proprietary characteristic that the app running on the peer can write to after connection is established to identify itself. Think this would be the preferred option. Alternatively you can do a database discovery of the peer, however I would not expect that you could get any reliable information from this without doing this for many vendors and versions, this could also change if they update the peer.

    Kenneth

Children
Related