Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to tell a peripheral to switch to central mode and connect to another specific peripheral?

Hello,

I'm not posting this as a problem, but rather to get some suggestions and ideas about this feature. I have a device based on the NRF52832. It is meant to work as a peripheral, but now I want to extend its features by connecting to other peripherals, for example, a BLE GPS receiver to get GPS data.

My device does not have a screen or any buttons, but I have a working app that connects to my peripheral. I would like to somehow choose in the app the peripheral I want my device to connect to.

I'm looking for suggestions on how to go about this. My initial idea is that the app should scan for devices, then the user would choose one and the app would tell the device to enable central mode and to start scanning for the chosen device. What would be a good way to identify the same device in both the app and the device?

Thanks in advance for your insights!

Parents
  • I have some general suggestions that you may consider.  Some of these assumes you have control of the GPS receiver implementation, not sure if that's the case or not.

    1. Include a unique service uuid in the advertisement packet for the GPS receiver so only relevant devices are displayed to user

    2. Append a unique number to the device name. Part of the mac address for instance. 

    3. Include measured RSSI along with device name 

    4. Scan and select device to connect from the phone, then send a command to the peripheral telling it what device to connect to. 

  • Hi Vidar,

    I'm not sure if I will have control of these things in 3rd-party devices. I have thought about the RSSI to at least differentiate similar devices, but I think I will pass the issue to the user so that he's responsible for turning off conflicting devices.

    I think in the end I'll just send the advertised name from the phone to my device and I'll use it in the device to scan and connect to a 3rd device with a matching name.

  • Hi,

    1 and 2 will not be possible for a 3rd party device. The RSSI part should be easy to do in the app. 

Reply Children
No Data
Related