Current Time Service issues

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
SamsonLeoMarch
Offline
Last seen:1 year 12 months ago
Joined:2018-10-17 17:57
Current Time Service issues

Hi there,

I am trying to implement a CTS client but I can't seem to get it working. I added the cts.h library to the task where I am calling the cts_init(); along with the below code to set up the call backs.


static void getTimeCTS_cb(ble_service_t *svc, uint16_t conn_idx)
{
printf("getTimeCTS_cb");
}
static void setTimeCTS_cb(ble_service_t *svc, uint16_t conn_idx, const cts_current_time_t *time)
{
printf("setTimeCTS_cb");
}
static void setLocalTimeCTS_cb(ble_service_t *svc, uint16_t conn_idx,const cts_local_time_info_t *info)
{
printf("setLocalTimeCTS_cb");
}
静态孔隙getRefTimeCTS_cb (ble_service_t * svc, uint16_t conn_idx)
{
printf("getRefTimeCTS_cb");
}

static const cts_callbacks_t currentTimeService_cb =
{
.get_time = getTimeCTS_cb,
.set_time = setTimeCTS_cb,
.set_local_time_info = setLocalTimeCTS_cb,
.get_ref_time_info = getRefTimeCTS_cb,
};

But when I try to compile I get an error saying that there is an "undefined reference to `ble_gatts_add_characteristic'" in cts.c. However, cts.c has #include "ble_gatts.h" where that function call is defined.

Any ideas?

Thanks in advance.

Device:
PM_Dialog
Offline
Last seen:21 hours 11 min ago
Staff
Joined:2018-02-08 11:03
Hi SamsonLeoMarch.

Hi SamsonLeoMarch.

Could you please let me know if you have include the Current Time Service into you application or you just using the CTS APIs?

Thanks, PM_Dialog

SamsonLeoMarch
Offline
Last seen:1 year 12 months ago
Joined:2018-10-17 17:57
Where would I have included

Where would I have included the Current Time Service in my application? I assumed the API was enough (assuming I included "cts.h")

PM_Dialog
Offline
Last seen:21 hours 11 min ago
Staff
Joined:2018-02-08 11:03
Hi SamsonLeoMarch,

Hi SamsonLeoMarch,

Apologies for the delay. Please check the ble_peripheral example of the SDK. This example includes the Current Time Service.

Thanks, PM_Dialog