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.

iphone 4S BLE Keyfob demo application discovery time

Other Parts Discussed in Thread: CC2540

Dear All, 

  I am testing the CC2540 key fob demo program in iphone 4s. 

  It seems that it takes about 5 second to get the connection done. while I am looking at the debug message, it seems that the discovery is done in about 2 seconds. Then it takes about several second asking the peripheral about their characteristics and services.

  I wonder if it is possible to some how skip the step of querying the available characteristics and services in order to speed up the  connection progress? It is because both the peripheral and the iphone 4S program are going to be written by me. The iphone application should know the available service of the peripheral.

Thank you!

Tony

  • Hi Tony,

    Well, if the Central Device (iPhone) already knows the UUIDs for the profile/services in your peripheral, I assume that you could hard code those in the iOS application. Consider the use of BTool, when you use it you would't typically do a device discovery since you "know" the peripheral yourself, you simply write and read directly to the UUID or handle for the characteristic you want. Have a look at the TI BLE Software Developers Guide for more info on BTool. As far as I know thought, handles aren't provided to the iOS application so the UUIDs would be the way to go.

    Br 

  • I noticed this too.  Is this communication speed an indication of the speed i can expect while reading lots of characteristics?

    I am building an application that uses the iphone to query roughly ~50-70 characteristics (usually 1-2 bytes in the payload) at speeds of up to 1hz to 5hz.  Would you see this as being a problem?

    I'm also not exactly sure what type of attribute operation i should use between this device and an iphone.  (mainly because each attribute could update at a different rate (1-5hz)

    • iPhone can 'read' each attribute and therefore the iphone sets up the timers and decides when to read each attribute
    • device can notify each attribute and therefore the device notifies the iphone on an attribute change
  • Hi Jonathan,

    I'm not sure about the implementation in the iOS but speaking BLE in general I see no issue with your application, although remember that the amount of time that the service discovery takes, is correlated to the connection interval. A connection interval of 10-50ms will perform the service discovery much faster than connection interval of 1-5s. Since the iOS does not include any options to set connection parameters through the API (yet) you would have to request a connection parameter update from the keyfob after the connection is established, with desired parameters (DEFAULT_ENABLE_UPDATE_REQUEST set to TRUE in keyfobdemo.c)

    As for the question regarding which type of operation to use when sending data, consider what user scenario the conenction would have. If the keyfob should be sending measurements or sensor data you would probably want to use notifications so the iPhone does not have to "poll" the attribute. If there is something constant stored in the keyfob you should use "read". You can also consider the case where you have temperature data (for example) in the keyfob that is updated every 100ms and you only want the data every 5 seconds, then the "read" would be more effective.

    Br