Go to the documentation of this file.
63 #include "custom_config.h"
72 #define CTS_C_CONNECTION_MAX 10
73 #define CTS_C_CUR_TIME_VAL_LEN 10
74 #define CTS_C_LOC_TIME_INFO_VAL_LEN 2
75 #define CTS_C_TIME_Y_M_D_UNKNOWN 0
76 #define CTS_C_TIME_YEAR_VALID_VAL_MIN 1582
77 #define CTS_C_TIME_YEAR_VALID_VAL_MAX 9999
78 #define CTS_C_TIME_ZONE_OFFSET_MIN -48
79 #define CTS_C_TIME_ZONE_OFFSET_MAX 56
80 #define CTS_C_TIME_ACCURACY_OUT_RANGE 254
81 #define CTS_C_TIME_ACCURACT_UNKNOWN 255
82 #define CTS_C_ERROR_FIELDS_IGNORED 0x80
89 #define CTS_C_AR_NO_CHANGE (0x00 << 0)
90 #define CTS_C_AR_MAUAL_TIME_UPDATE (0x01 << 0)
91 #define CTS_C_AR_EXT_REF_TIME_UPDATE (0x01 << 1)
92 #define CTS_C_AR_TIME_ZONE_CHANGE (0x01 << 2)
93 #define CTS_C_AR_DST_CHANGE (0x01 << 3)
@ CTS_C_REF_TIME_SRC_NET_TIME_PROTOCOL
uint8_t hours_since_update
uint16_t cts_cur_time_handle
@ CTS_C_EVT_INVALID_CUR_TIME_REC
@ CTS_C_EVT_CUR_TIME_SET_SUCCESS
cts_c_ref_time_source_t
Reference time information:Time Source.
@ CTS_C_REF_TIME_SRC_UNKNOWN
cts_c_cur_time_t cur_time
@ CTS_C_EVT_VALID_REF_TIME_INFO_REC
cts_c_ref_time_source_t source
cts_c_exact_time_256_t day_date_time
sdk_err_t cts_c_loc_time_info_read(uint8_t conn_idx)
Read Local Time Information characteristic value.
prf_date_time_t date_time
@ CTS_C_EVT_INVALID_LOC_TIME_INFO_REC
@ CTS_C_DST_OFFSET_HALF_HOUR
@ CTS_C_EVT_INVALID_REF_TIME_INFO_REC
uint16_t cts_cur_time_cccd_handle
uint16_t cts_ref_time_info_handle
@ CTS_C_EVT_VALID_LOC_TIME_INFO_REC
@ CTS_C_REF_TIME_SRC_RADIO_TIME_SIGNAL
Handles on the connected peer device needed to interact with it.
@ CTS_C_DST_OFFSET_DOUB_DAYLIGHT_TIME
uint16_t cts_loc_time_info_handle
Current Time Service Client event.
void cts_c_data_parse(uint8_t *p_data, uint16_t length)
Data accepts data and processing functions.
sdk_err_t cts_c_disc_srvc_start(uint8_t conn_idx)
Discovery Current Time Service on peer.
@ CTS_C_EVT_CUR_TIME_NTF_SET_SUCCESS
cts_c_dst_offset_t
Local time information:Daylight Saving Time Offset.
@ CTS_C_REF_TIME_SRC_MANUAL
Reference Time Information.
cts_c_loc_time_info_t loc_time_info
uint16_t cts_srvc_end_handle
cts_c_ref_time_info_t ref_time_info
sdk_err_t cts_c_cur_time_set(uint8_t conn_idx, cts_c_cur_time_t *p_cur_time)
Set Current Time characteristic value.
@ CTS_C_REF_TIME_SRC_ATOMIC_CLOCK
sdk_err_t cts_c_loc_time_info_set(uint8_t conn_idx, cts_c_loc_time_info_t *p_loc_time_info)
Set Local Time Information characteristic value.
uint16_t sdk_err_t
SDK API result type.
The date and time structure. The packed size is 7 bytes.
sdk_err_t cts_client_init(cts_c_evt_handler_t evt_handler)
Register CTS Client event handler.
sdk_err_t cts_c_ref_time_info_read(uint8_t conn_idx)
Read Reference Time Information characteristic value.
@ CTS_C_DST_OFFSET_STANDAR_TIME
cts_c_evt_type_t
Current Time Service Client event type.
uint16_t cts_srvc_start_handle
cts_c_dst_offset_t dst_offset
sdk_err_t cts_c_cur_time_read(uint8_t conn_idx)
Read Current Time characteristic value.
cts_c_evt_type_t evt_type
@ CTS_C_EVT_DISCOVERY_FAIL
@ CTS_C_EVT_LOC_TIME_INFO_SET_SUCCESS
void(* cts_c_evt_handler_t)(cts_c_evt_t *p_evt)
Current Time Service Client event handler type.
Profile/Service Utilities API.
cts_c_week_day_t
Current Time Day of week.
@ CTS_C_DST_OFFSET_DAYLIGHT_TIME
@ CTS_C_EVT_DISCOVERY_COMPLETE
@ CTS_C_EVT_VALID_CUR_TIME_REC
@ CTS_C_REF_TIME_SRC_CELLUAR_NET
sdk_err_t cts_c_cur_time_notify_set(uint8_t conn_idx, bool is_enable)
Enable or disable peer Current Time characteristic notify.
uint8_t days_since_update