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

CTS -- is it necessary to establish security

I am trying to implement the Current Time Service in my project and had a few questions:

-The example requires that security be established before services can be discovered. Is security absolutely necessary? I am just interested in getting time from a central device to set time on my peripheral.

-Is bonding required to get time from a central device?

Ultimately, This device will be operated in a large office with a few central devices that will be available to provide time to the peripheral.

I am trying to copy in the important bits into the HRM example, but am having difficulty with getting the CTS to discover (as indicated on the Nordic Android application). I was able to successfully run the HRM before modifying it, so I know THAT part works...

Thanks, -Ben

Parents
  • I don't understand why the example is implemented in this way, it seems to be that this service doesn't require any security.

    This is easy to change. It is actually the peripheral that sends the security request, it is sent by a timer that expires 4 seconds after a connection is made, see how the DM_EVT_CONNECTION event is handled in device_manager_evt_handler(). Comment out app_timer_start() to not send the security request.

    But if you do this, service discovery is never performed, because you will never get the DM_EVT_LINK_SECURED event, where ble_db_discovery_start() is called. So just call ble_db_discovery_start() when you get the DM_EVT_CONNECTION instead, and it should work.

  • Hi Petter, Your suggestion worked really well! Thanks for the advice!

    I have now migrated to SDK13, it seems that there is no longer a device manager. Based off the HRM example, it seems that the new appropriate place to put this is in the on_ble_evt(), under the BLE_GAP_EVT_CONNECTED case, correct?

    Cheers, -Ben

Reply Children
No Data
Related