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

Format of data sent from central in Current Time Service.

Hi,

It is understood that,If to the function on_cts_c_evt BLE_CTS_C_EVT_CURRENT_TIME event is passed as arguement then it gives a call to the function  current_time_print(p_evt);And All the arguments within passed structure are passed to the corresponding structures and we are able to retrieve data by printing those particular structure members.

But ,we are passing  value for Current Time characteristic (UUID 0x2A2B) as C2-07-0B-0F-0D-25-2A-06-FE-08 and we can observe that the below data is printed on log:

Date:
  Day of week   Saturday
  Day of month  15
  Month of year November
  Year          1986

Time:
    Hours     13
    Minutes   37
    Seconds   42
    Fractions 254/256 of a second

Adjust Reason:
    Daylight savings 1
    Time zone        0
    External update  0
    Manual update    0



Can I know where exactly this conversion is taking place.And the content I required is that to store recieved current hours min and sec value in other variables.
Can I store values of p_evt->params.current_time.exact_time_256.day_date_time... into some variables directly?
Can I know the exact data format recieved from BLE_CTS_C_EVT_CURRENT_TIME?

Is it storing data as hrs,min,sec format ?Can I retrieve them and use them in app_timer application directly?

Thanks & Regards,
Swathi P

Parents
  • Hi,

    The values are printed to log using the function current_time_print() in main.c. The values are provided from the Current Time Service client event, and the parsing itself is implemented in ble_cts.c.c.

    You can store the values in the application as you wish, yes. For instance store them to variables instead of printing them to log.

    Data formats are specified from the Bluetooth SIG, see e.g. the Current Time Service specification which you can obtain from https://www.bluetooth.com/specifications/gatt/

    Regards,
    Terje

  • Hi Terje,

    Apologies for reviving this thread, but I have the same question about the Current Time Service, and the format of the characteristic data.

    Going to the link you mentioned, one finds a document called CTS_SPEC_V1.1.0. This document does not define the actual content of the characteristics. Do you know where the characteristic bytes are actually defined now? 

    thanks,

    Paul

Reply
  • Hi Terje,

    Apologies for reviving this thread, but I have the same question about the Current Time Service, and the format of the characteristic data.

    Going to the link you mentioned, one finds a document called CTS_SPEC_V1.1.0. This document does not define the actual content of the characteristics. Do you know where the characteristic bytes are actually defined now? 

    thanks,

    Paul

Children
Related