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

nRF52 BLE central auto-reconnect to iPhone

Hi all,

My nRF52 application (central) uses a BLE link to connect to an Iphone (peripheral).

However it happens that the connection breaks, and I want to implement an automatic way the application

would reconnect to the phone. The issue is that iPhones do NOT advertise when they are locked (e.g. in a pocket).

I want to have this reconnction happen WITHOUT user interaction.

Is there a way to reconnect to the phone if it is not advertising, if we have just been connected with it ?

(I am using nRF SDK 15.3 and nRF52840)

Thanks !

Parents
  • Per the BLE specification, a peripheral can only connect when it is 'connectable advertising'. This is because right after sending an advertising it starts the receiver to listen for a response for a possible scanner. This is a really short period. If nothing is received in this period, the peripheral will shut down (after it did the same on the other two advertising channels) and wait for the next advertising interval. So, if the peripheral is not advertising, no connection can be established.

    Just out of curiosity: is there a reason why you want the iPhone to be the peripheral? If you make the iPhone the Scanner/Central you can configure it to work even if locked by setting the application to update on the background.

  • Hi,

    And thanks !

    The iPhone needs to be the peripheral because it contains several 3rd party apps that i want/need to connect to.

    Hence I am stuck being the central device

  • Ah, I see.

    Regarding the point of the iPhone not advertising when it is locked (i.e. the app moved to background processing), I myself only did this for the iPhone being a Central, but this link from Apple explains that this should be possible.

Reply Children
No Data
Related