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

NRF52 adding CTS service( not CTS_C ) to application

I am using nrf52 DK board with  SDK15.3.0 developing my application on top of ble_blinky_peripheral example .

How do add CTS service in my application ??

 I have refered CTS_C ( client ) example which is provided with the SDK but , I want it to be configured for server since the CTS_C example needs to get paired first with the mobile app ( nrf_connect) and then it transfers CTS data . I want something like the CTS service (1805 ) should be available once I connect to the nrf device via nrf_connect app , and it must have necessary characteristics for writing CTS data .    

  • Hi

    The most common implementation is to use the nRF as the CTS client, and a phone or computer as the server, as the server will have to get the current time from somewhere (often GPS, WI-Fi or phone network).

    If you'd like to use the nRF52 as the server, I assume you have some external time keeping device that you can read from, as the CTS is not meant to be used for setting time, but rather for a Client to get the current time from a server without user interaction. 

    Best regards,

    Simon

  • Simonr ,

    thanks for the reply !

    My application has calendar example using RTC  to have my date and time running and getting displayed on LCD display .    So I need to set all these timing parameters from the mobile app via CTS service . Then how can I use standard CTS service to send Date and Time from my mobile app without setting my nrf as client ?.

    Even if the NRF is in client , and if the service is visible ( 1805 and  char UUID : 2A2B) without getting it paired , that should be enough for me since my application ( andriod / ios ) will take care of reading timings from  mobile device and sending it to the characteristics ( 2A2B ) . 

  • Hi

    I'm sorry, but it sounds like you want to do exactly what the CTS client service does. That you want the nRF peripheral to get the time from a mobile phoneto keep track ot time. The purpose of the Current Time application example is to use the CTS to read the current time, and then print the time (date, time, etc.) onto a display. 

    If I'm not understanding you correctly, please try to explain what you'd like to do that the Current Time application does not do.

    Best regards,

    Simon

  • I have found out solution for this . Actually your concern makes sense if we have nrf running no timing feature and it has to fetch timing parameters from a remote device / system ( server ) and initially , CTS_C example requires pairing post which , it sends current time data which is not suitable for my application .

    But , in my case , since the client ( NRF ) has it's timing feature running and All I wanted was to update the current time from a remote device using standard service ( CTS : 1805 ) without any pairing  . 

    For the solution , I have created a new service with the same CTS UUIDs ( with write permission ) which  will fetch my mobile phone ( server ) timing data and send it to NRF device .

    Now I can able to  update my NRF timings from mobile app using Standard CTS service .

  • hey man, 

    I am trying to do the same for my project. can you guide me on how you are fetching timing data from the android?

    Thanks 

Related