Go to the documentation of this file.
61 #include "custom_config.h"
70 #define CTS_CONNECTION_MAX 10
71 #define CTS_CUR_TIME_VAL_LEN 10
72 #define TOTAL_CTS_CUR_TIME_VAL_LEN 27
73 #define CTS_LOC_TIME_INFO_VAL_LEN 2
74 #define TOTAL_CTS_LOC_TIME_INFO_VAL_LEN 6
75 #define CTS_REF_TIME_INFO_VAL_LEN 4
76 #define CTS_TIME_YEAR_VALID_VAL_MIN 1582
77 #define CTS_TIME_YEAR_VALID_VAL_MAX 9999
78 #define CTS_TIME_ZONE_OFFSET_MIN -48
79 #define CTS_TIME_ZONE_OFFSET_MAX 56
80 #define CTS_TIME_ACCURACY_OUT_RANGE 254
81 #define CTS_TIME_ACCURACT_UNKNOWN 255
82 #define CTS_ERROR_FIELDS_IGNORED 0x80
89 #define CTS_CHAR_MANDATORY 0x0f
90 #define CTS_CHAR_LOC_TIME_INFO_SUP 0x30
91 #define CTS_CHAR_REF_TIME_INFO_SUP 0xc0
92 #define CTS_CHAR_FULL 0xff
100 #define CTS_AR_NO_CHANGE (0x00 << 0)
101 #define CTS_AR_MAUAL_TIME_UPDATE (0x01 << 0)
102 #define CTS_AR_EXT_REF_TIME_UPDATE (0x01 << 1)
103 #define CTS_AR_TIME_ZONE_CHANGE (0x01 << 2)
104 #define CTS_AR_DST_CHANGE (0x01 << 3)
uint8_t days_since_update
@ CTS_DST_OFFSET_DOUB_DAYLIGHT_TIME
cts_ref_time_info_t ref_time_info
cts_loc_time_info_t loc_time_info
@ CTS_EVT_CUR_TIME_SET_BY_PEER
@ CTS_REF_TIME_SRC_MANUAL
void cts_exact_time_update(cts_init_t *p_cts_exact_time)
Update exact time.
cts_dst_offset_t dst_offset
uint8_t before_updata_sec
@ CTS_EVT_LOC_TIME_INFO_SET_BY_PEER
CTS Reference Time Updata Information.
uint8_t current_time_universal_decode(ble_gatts_write_cfm_t *p_cfm, cts_evt_t *p_evt)
Decode for a Current Time.
GATT write attribute result description.
cts_evt_handler_t evt_handler
@ CTS_DST_OFFSET_HALF_HOUR
@ CTS_REF_TIME_SRC_ATOMIC_CLOCK
@ CTS_DST_OFFSET_STANDAR_TIME
CTS Reference Time Information.
void reference_time_encode(uint8_t *p_data, uint16_t length)
Serial port data is converted into reference time.
void current_time_encode(uint8_t *p_data, uint16_t length)
Serial port data is converted into current time.
@ CTS_REF_TIME_SRC_UNKNOWN
@ CTS_REF_TIME_SRC_RADIO_TIME_SIGNAL
@ CTS_REF_TIME_SRC_CELLUAR_NET
uint8_t local_time_universal_decode(ble_gatts_write_cfm_t *p_cfm, cts_evt_t *p_evt)
Handle Local Time Information conversion.
@ CTS_EVT_CUR_TIME_NOTIFICATION_DISABLED
@ CTS_DST_OFFSET_DAYLIGHT_TIME
prf_date_time_t date_time
cts_loc_time_info_t loc_time_info
cts_evt_type_t
Current Time Service event type.
cts_dst_offset_t
Local time information:Daylight Saving Time Offset.
sdk_err_t cts_service_init(cts_init_t *p_cts_init)
Initialize a Current Time Service instance and add in the DB.
uint8_t expected_time_1min_adapt
cts_ref_time_source_t stage_update_source
cts_ref_time_info_t ref_time_info
sdk_err_t cts_cur_time_send(uint8_t conn_idx, cts_cur_time_t *p_cur_time)
Send Current Time if its notification has been enabled.
CTS Local Time Information.
void cts_exact_time_get(cts_init_t *p_exact_time)
Get exact time for user.
uint16_t sdk_err_t
SDK API result type.
@ CTS_REF_TIME_SRC_NET_TIME_PROTOCOL
The date and time structure. The packed size is 7 bytes.
@ CTS_EVT_CUR_TIME_NOTIFICATION_ENABLED
void(* cts_evt_handler_t)(cts_evt_t *p_evt)
Current Time Service event handler type.
cts_exact_time_256_t day_date_time
Current Time Service init structure. This contains all option and data needed for initialization of t...
cts_ref_time_source_t
Reference time information:Time Source.
uint8_t hours_since_update
cts_ref_time_source_t source
void cts_c_data_parse(uint8_t *p_data, uint16_t length)
Data accepts data and processing functions.
@ CTS_DST_OFFSET_DOUB_UNKNOWED_TIME
void cts_cur_time_adjust(cts_adj_info_t *p_adj_info)
Adjust current time.
cts_week_day_t
Current Time Day of week.
Profile/Service Utilities API.
cts_exact_time_256_t day_date_time
void local_time_encode(uint8_t *p_data, uint8_t length)
Serial port data is converted into local time.
cts_loc_time_info_t loc_time_info
Current Time Service event.