Go to the documentation of this file.
61 #include "custom_config.h"
70 #define CTS_CONNECTION_MAX (10 < CFG_MAX_CONNECTIONS ?\
71 10 : CFG_MAX_CONNECTIONS)
72 #define CTS_CUR_TIME_VAL_LEN 10
73 #define CTS_LOC_TIME_INFO_VAL_LEN 2
74 #define CTS_REF_TIME_INFO_VAL_LEN 4
75 #define CTS_TIME_YEAR_VALID_VAL_MIN 1582
76 #define CTS_TIME_YEAR_VALID_VAL_MAX 9999
77 #define CTS_TIME_ZONE_OFFSET_MIN -48
78 #define CTS_TIME_ZONE_OFFSET_MAX 56
79 #define CTS_TIME_ACCURACY_OUT_RANGE 254
80 #define CTS_TIME_ACCURACT_UNKNOWN 255
81 #define CTS_ERROR_FIELDS_IGNORED 0x80
88 #define CTS_CHAR_MANDATORY 0x0f
89 #define CTS_CHAR_LOC_TIME_INFO_SUP 0x30
90 #define CTS_CHAR_REF_TIME_INFO_SUP 0xc0
91 #define CTS_CHAR_FULL 0xff
99 #define CTS_AR_NO_CHANGE (0x00 << 0)
100 #define CTS_AR_MAUAL_TIME_UPDATE (0x01 << 0)
101 #define CTS_AR_EXT_REF_TIME_UPDATE (0x01 << 1)
102 #define CTS_AR_TIME_ZONE_CHANGE (0x01 << 2)
103 #define CTS_AR_DST_CHANGE (0x01 << 3)
cts_evt_type_t evt_type
The CTS event type.
uint8_t days_since_update
Days Since Update.
@ CTS_DST_OFFSET_DOUB_DAYLIGHT_TIME
Double Daylight Time (+2h).
cts_ref_time_info_t ref_time_info
Reference Time information.
cts_loc_time_info_t loc_time_info
Local Time information.
@ CTS_EVT_CUR_TIME_SET_BY_PEER
Current Time has been set by peer.
@ CTS_REF_TIME_SRC_MANUAL
Manual.
uint8_t day_of_week
Day of Week.
uint16_t length
Length of event data.
@ CTS_WEEK_UNKNOWN_DAY
Day of week is not known.
cts_dst_offset_t dst_offset
Daylight Saving Time Offset.
@ CTS_EVT_LOC_TIME_INFO_SET_BY_PEER
Local Time information has been set by peer.
cts_evt_handler_t evt_handler
Current Time Service event handler.
@ CTS_DST_OFFSET_HALF_HOUR
Half An Hour Daylight Time (+0.5h).
@ CTS_REF_TIME_SRC_ATOMIC_CLOCK
Atomic Clock.
@ CTS_DST_OFFSET_STANDAR_TIME
Standard Time.
CTS Reference Time Information.
@ CTS_WEEK_WEDNESDAY
Wednesday.
@ CTS_REF_TIME_SRC_UNKNOWN
Unknown.
@ CTS_REF_TIME_SRC_RADIO_TIME_SIGNAL
Radio Time Signal.
@ CTS_REF_TIME_SRC_CELLUAR_NET
Cellular Network.
@ CTS_EVT_CUR_TIME_NOTIFICATION_DISABLED
Current Time Notification is disabled.
@ CTS_DST_OFFSET_DAYLIGHT_TIME
Daylight Time (+1h).
uint8_t conn_idx
The index of the connection.
int8_t time_zone
Time Zone, Offset from UTC in number of 15-minute increments.
@ CTS_EVT_INVALID
Invalid event.
const uint8_t * p_data
Pointer to event data.
prf_date_time_t date_time
Date Time.
uint8_t fractions_256
1/256th of a second.
cts_loc_time_info_t loc_time_info
Local Time information.
cts_evt_type_t
Current Time Service event type.
cts_dst_offset_t
Local time information:Daylight Saving Time Offset.
@ CTS_REF_TIME_SRC_GPS
GPS.
sdk_err_t cts_service_init(cts_init_t *p_cts_init)
Initialize a Current Time Service instance and add in the DB.
cts_ref_time_info_t ref_time_info
Reference Time information.
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.
uint16_t sdk_err_t
SDK API result type.
@ CTS_REF_TIME_SRC_NET_TIME_PROTOCOL
Network Time Protocol.
void cts_exact_time_get(cts_exact_time_256_t *p_exact_time)
Get exact time for user.
cts_cur_time_t cur_time
Current Time.
The date and time structure.
@ CTS_EVT_CUR_TIME_NOTIFICATION_ENABLED
Current Time Notification is 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
Exact Time 256.
@ CTS_WEEK_TUSEDAY
Tuesday.
Current Time Service init structure.
void cts_exact_time_update(cts_exact_time_256_t *p_exact_time)
Update exact time.
cts_ref_time_source_t
Reference time information:Time Source.
uint8_t hours_since_update
Hours Since Update.
cts_ref_time_source_t source
Time Source.
@ CTS_WEEK_SATURDAY
Saturday.
cts_cur_time_t cur_time
Curren time set by peer.
void cts_cur_time_adjust(cts_adj_info_t *p_adj_info)
Adjust current time.
@ CTS_WEEK_THURSDAT
Thursday.
cts_week_day_t
Current Time Day of week.
uint16_t char_mask
Initial mask of supported characteristics, and configured with Characteristics Mask.
uint8_t accuracy
Accuracy of time information.
Profile/Service Utilities API.
uint8_t adjust_reason
Adjust Reason.
cts_exact_time_256_t day_date_time
Exact Time 256.
cts_loc_time_info_t loc_time_info
Local time information set by peer.
uint8_t adjust_reason
Adjust Reason.
Current Time Service event.