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

Characteristic of the current time service could not be found in the APP.

I am doing a program based on Current Time Application example. But I have a few questions, so I hope you can help me.

First, I am using Battery service together. By the way, why doesn't the current time service add characteristic when the battery service adds the characteristic?

// Add battery level characteristic
    err_code = battery_level_char_add(p_bas, p_bas_init);

I think it's because battery service is server and current time service is client. Right?

So when I use these two services on GATT, can I operate as a server and a client at the same time?

If I could use either one, would I be able to read the time from the client (e.g., the phone) while using CTS as a server?

Parents
  • Hi, 

    I think it's because battery service is server and current time service is client. Right?

    There are two API's, one called Battery Service Client, and one called Battery Service. Which one are you using?

    I think you have to use the functions in the ble_bas_c.c and ble_bas_c.h for the Battery Service Client if you want to have current time service and battery service on the client.

    So when I use these two services on GATT, can I operate as a server and a client at the same time?

    No. But A Service change indication which is only sent by a GATT server can change to the role. (However, a GATT server and GATT client may very well be present on the same device.) Please see this thread.

    If I could use either one, would I be able to read the time from the client (e.g., the phone) while using CTS as a server?

    Please see the following figure. Only the client can send the read data request to the server, and the server will send the data to the client.

    The SDK Current Time Application is an example that implements the client role of the Current Time Profile using the hardware delivered in the nRF5 Development Kit. 

    -Amanda H.

  • Hi. Thank you.
    Amanda.
    I'm using the battery service as a server. It's used to send battery levels from my device to my Android phone
    And I'm going to read the current time on my Android phone and set the time on my device.
    I wonder if battery service works as a server and current time service as a client is possible. I think it's possible because it's a different service.

    And I don't think Nordic nRF Toolbox offers current time service server. Is that right? Is there a project I can refer to to to build an Android APP? iOS nRF Toolbox has confirmed that my device and current time service work.

  • Hi,

    moon.kim said:
    I wonder if battery service works as a server and current time service as a client is possible.

    As I explained in the previous reply, a service change indication from the GAT server can change the role.  

    Unfortunately, we do not have any CTS server profile as  CTS is a native service in most mobile OSes. 

    -Amanda H.

     

Reply Children
No Data
Related