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.

New to BLE - Pairing Question w/ Smartphone

Other Parts Discussed in Thread: CC2541

Let me start by stating that I am not very technical, at least not in this area, so forgive me for asking what may be a very simple question that I am about to overcomplicate.  I have been looking at the CC2541 SoC as a potential component in a peripheral I am looking to produce.  At this point I am still trying to educate myself on the bluetooth low energy specs to see if they will fulfill my application's pairing requirements.  My "future" smartphone application is based on a key technical requirement -  my BLE peripheral devices (unlimited # manufactured and distributed) can automatically pair with any bluetooth 4.0 capable smartphone that has my application installed (no user intervention upon pairing or exchange of data from peripheral to phone).  The relationship is potentially short lived, and the next time the peripheral "wakes up" there may be a completely new smartphone which it pairs with next.  This process could repeat itself indefinitely with new and random smartphones (assuming my app is installed).  Since there will be an unknown # of peripherals and smartphones with the app installed, there is no defined list of possible "approved" devices and therefore no previous knowledge of each other.  Similarly, a single smartphone with my app installed could and will likely have an indefinite amount of peripherals that it could pair with throughout the course of a day should it come within BLE proximity.

I am not as concerned with security at this point as I am just trying to see if this can even work.  Once the application is installed on a BLE smartphone then I need the pairing with any of my random peripherals to be automatic.  Again, no user intervention can take place at the peripheral or phone (application is running in background).  From what I have read "Just Works" might be an option.  I can't seem to find a similar open pairing requirement in my searches, so I wanted to open it up to the community for their experience.  Is this possible with BLE and the CC2541 peripherals?  Any limitations from a scale perspective with the many:many relationship?

Thanks in advance.

Brad

  • Brad

    Did you get an answer to your question?  I am looking to do essentially the same thing.

    Thanks

    Joe

  • The application you are looking to develop is certainly feasible with Bluetooth Low Energy.

    For one, the standard method of "pairing" used in Classic Bluetooth has changed in BLE. With BLE, you can create a connection between a smartphone and a peripheral without the need for passwords and such, using the Just Works method. You can also have the smartphone tie to a specific device by "bonding" to it, similar to pairing but not quite. There may still need to be some form of user intervention on the app side of things to get the smartphone to scan for BLE devices (I believe this cannot be done automatically in iOS), but that can be tied to a simple push of a button on the app itself and the TI BLE demo demonstrates this. The peripheral will need to be programmed to simply advertise as it "wakes up".

    I do have to stress that, at least in iOS 5.1, you cannot set the device to advertise while in the background or keep advertising indefinitely. The application has to be in the foreground and there has to be some user intervention to start the connection. You can, however, keep the connection active while the app is in the background, but that may not be needed on your application.

    In theory, there are no restrictions on single phone to peripheral connections, so a smartphone can certainly connect to many peripherals, one at a time, and one peripheral can advertise and connect to a smartphone, one at a time. I believe, though, that you cannot have one peripheral talk to multiple phones at the same time, at least based on the current BLE spec.

    Hope that information helps.

  • Thanks for the reply - based off your responses and some of the iOS limitations of running in the background it might not be possible, at least if I interpreted them correctly. 

    The peripheral will be programmed to advertise once the sleep interval completes, that should be pretty straightforward.  My concerns may be on the smartphone side it seems.  Ultimately, once the smartphone installs my app I need it to be able to sleep for a predefined interval (ex. 1 minute) where nothing is happening with the application and BLE is sleeping.  After 1 minute of sleep the application wakes up, starts BLE and scans for any peripherals with my app on them.  If any are found it takes action, then goes back to sleep for the same interval.  Wake up and repeat.  All of this without user intervention when the device wakes up from sleep.  I need it to all happen in the background as well.  In other words, if you are on the phone, checking email, playing a game, browsing the web, etc., the app can still run in the background whenever it wakes up from sleep and follow the short process above.  A requirement to run in the foreground would be a showstopper.  You stated, "You can, however, keep the connection active while the app is in the background, but that may not be needed on your application."  Does that meet my requirement above or did I misinterpret it?

    Thanks again.

    Brad

  • BradG said:

    You stated, "You can, however, keep the connection active while the app is in the background, but that may not be needed on your application."  Does that meet my requirement above or did I misinterpret it?

    Sadly it does not meet your requirement. iOS 5.0 and 5.1 only allow a BLE connection to maintain connectivity once it has already been established (and also allow the app to remain present in the background) and that connection must be established when the app being in the foreground, at the very least. That may change with iOS 6, but the beta for that will not be out until mid June. There are ways to bring an app back to the foreground with user intervention required, but that does not look like it will be at all convenient to the user with an alert every minute.

    Hope that helps.