This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Add CTS current time service

Hi all,

i want to add a cts service to my project. i started with ble_cts example of sdk 11.0, but it's not clear what is the correct procedure to do it. I add the service in service init and the db_ event_handler and cts_event_handler in my project. But the problem is that softdevice don't receive the BLE_GATTC_EVT_CHAR_DISC_RSP. There is other thing that i must done? What is the correct procedure to add a service current time?

Thank you!!

Parents
  • FormerMember
    0 FormerMember

    In general, when adding a service, what you need to add is everything that is specific for that service. From looking at ble_app_cts_c, it should a least be the following:

    • Services_init()
    • The discovery module:
    • db_discovery_init()
    • db_disc_handler(..)
    • ble_db_discovery_on_ble_evt(..): should be added in ble_evt_dispatch(..)
    • ble_cts_c_on_ble_evt(..): should bed added in ble_evt_dispatch(..)
    • on_cts_c_evt() :

    Functions that you may consider to take a look at:

    • on_ble_evt(..)
    • current_time_print()

    Let me know if it still doesn't work after adding everything from the above list.

  • FormerMember
    0 FormerMember in reply to FormerMember

    Do you have an extra nRF51-DK or a nRF51-Dongle? If so, could you use the sniffer to check how/if the service/characteristic discovery takes place? And upload then sniffer trace here?

    The sniffer should be used with Wireshark, and it works best with version 1.10, not one of the newer versions. Wireshark can be downloaded here:

Reply Children
No Data
Related