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.

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
Where would I have included the Current Time Service in my application? I assumed the API was enough (assuming I included "cts.h")
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