Bluetooth LE Profile API document
Bluetooth LE Profile API document Rev.1.00 [May 22, 2020]
Current Time Service Client

This is the client for the Current Time Service Service. More...

Detailed Description

This is the client for the Current Time Service Service.

Data Structures

struct  st_ble_ctc_cur_time_exact_time_256_t
 Current Time Exact Time 256 value structure. More...
 
struct  st_ble_ctc_cur_time_adjust_reason_t
 Current Time Adjust Reason value structure. More...
 
struct  st_ble_ctc_cur_time_t
 Current Time value structure. More...
 
struct  st_ble_ctc_cur_time_attr_hdl_t
 Current Time attribute handle value. More...
 
struct  st_ble_ctc_local_time_info_t
 Local Time Information value structure. More...
 
struct  st_ble_ctc_local_time_info_attr_hdl_t
 Local Time Information attribute handle value. More...
 
struct  st_ble_ctc_ref_time_info_t
 Reference Time Information value structure. More...
 
struct  st_ble_ctc_ref_time_info_attr_hdl_t
 Reference Time Information attribute handle value. More...
 
struct  st_ble_ctc_evt_data_t
 Current Time Service client event data. More...
 

Macros

#define BLE_CTC_CUR_TIME_UUID   (0x2A2B)
 
#define BLE_CTC_CUR_TIME_LEN   (10)
 
#define BLE_CTC_CUR_TIME_CLI_CNFG_UUID   (0x2902)
 
#define BLE_CTC_CUR_TIME_CLI_CNFG_LEN   (2)
 
#define BLE_CTC_LOCAL_TIME_INFO_UUID   (0x2A0F)
 
#define BLE_CTC_LOCAL_TIME_INFO_LEN   (2)
 
#define BLE_CTC_REF_TIME_INFO_UUID   (0x2A14)
 
#define BLE_CTC_REF_TIME_INFO_LEN   (4)
 
#define BLE_CTC_DATA_FIELD_IGNORED_ERROR   (BLE_ERR_GROUP_GATT | 0x80)
 The server ignored one or more fields. More...
 

Enumerations

enum  e_ble_ctc_local_time_info_daylight_saving_time_offset_t {
  BLE_CTC_LOCAL_TIME_INFO_DAYLIGHT_SAVING_TIME_OFFSET_STANDARD_TIME = 0,
  BLE_CTC_LOCAL_TIME_INFO_DAYLIGHT_SAVING_TIME_OFFSET_HALF_AN_HOUR_DAYLIGHT_TIME = 2,
  BLE_CTC_LOCAL_TIME_INFO_DAYLIGHT_SAVING_TIME_OFFSET_DAYLIGHT_TIME = 4,
  BLE_CTC_LOCAL_TIME_INFO_DAYLIGHT_SAVING_TIME_OFFSET_DOUBLE_DAYLIGHT_TIME = 8
}
 Local Time Information Daylight Saving Time Offset enumeration. More...
 
enum  e_ble_ctc_ref_time_info_source_t {
  BLE_CTC_REF_TIME_INFO_SOURCE_UNKNOWN = 0,
  BLE_CTC_REF_TIME_INFO_SOURCE_NETWORK_TIME_PROTOCOL = 1,
  BLE_CTC_REF_TIME_INFO_SOURCE_GPS = 2,
  BLE_CTC_REF_TIME_INFO_SOURCE_RADIO_TIME_SIGNAL = 3,
  BLE_CTC_REF_TIME_INFO_SOURCE_MANUAL = 4,
  BLE_CTC_REF_TIME_INFO_SOURCE_ATOMIC_CLOCK = 5,
  BLE_CTC_REF_TIME_INFO_SOURCE_CELLULAR_NETWORK = 6
}
 Reference Time Information Source enumeration. More...
 
enum  e_ble_ctc_char_idx_t {
  BLE_CTC_CUR_TIME_IDX,
  BLE_CTC_CUR_TIME_CLI_CNFG_IDX,
  BLE_CTC_LOCAL_TIME_INFO_IDX,
  BLE_CTC_REF_TIME_INFO_IDX
}
 Current Time Service characteristic ID. More...
 
enum  e_ble_ctc_event_t {
  BLE_CTC_EVENT_CUR_TIME_READ_RSP = BLE_SERVC_ATTR_EVENT(BLE_CTC_CUR_TIME_IDX, BLE_SERVC_READ_RSP),
  BLE_CTC_EVENT_CUR_TIME_WRITE_RSP = BLE_SERVC_ATTR_EVENT(BLE_CTC_CUR_TIME_IDX, BLE_SERVC_WRITE_RSP),
  BLE_CTC_EVENT_CUR_TIME_HDL_VAL_NTF = BLE_SERVC_ATTR_EVENT(BLE_CTC_CUR_TIME_IDX, BLE_SERVC_HDL_VAL_IND),
  BLE_CTC_EVENT_CUR_TIME_CLI_CNFG_READ_RSP = BLE_SERVC_ATTR_EVENT(BLE_CTC_CUR_TIME_CLI_CNFG_IDX, BLE_SERVC_READ_RSP),
  BLE_CTC_EVENT_CUR_TIME_CLI_CNFG_WRITE_RSP = BLE_SERVC_ATTR_EVENT(BLE_CTC_CUR_TIME_CLI_CNFG_IDX, BLE_SERVC_WRITE_RSP),
  BLE_CTC_EVENT_LOCAL_TIME_INFO_READ_RSP = BLE_SERVC_ATTR_EVENT(BLE_CTC_LOCAL_TIME_INFO_IDX, BLE_SERVC_READ_RSP),
  BLE_CTC_EVENT_LOCAL_TIME_INFO_WRITE_RSP = BLE_SERVC_ATTR_EVENT(BLE_CTC_LOCAL_TIME_INFO_IDX, BLE_SERVC_WRITE_RSP),
  BLE_CTC_EVENT_REF_TIME_INFO_READ_RSP = BLE_SERVC_ATTR_EVENT(BLE_CTC_REF_TIME_INFO_IDX, BLE_SERVC_READ_RSP)
}
 Current Time Service client event type. More...
 

Functions

ble_status_t R_BLE_CTC_ReadCurTimeCliCnfg (uint16_t conn_hdl)
 Read Current Time characteristic Client Characteristic Configuration descriptor value from the remote GATT database. More...
 
ble_status_t R_BLE_CTC_WriteCurTimeCliCnfg (uint16_t conn_hdl, const uint16_t *p_value)
 Write Current Time characteristic Client Characteristic Configuration descriptor value to remote GATT database. More...
 
ble_status_t R_BLE_CTC_ReadCurTime (uint16_t conn_hdl)
 Read Current Time characteristic value from the remote GATT database. More...
 
ble_status_t R_BLE_CTC_WriteCurTime (uint16_t conn_hdl, const st_ble_ctc_cur_time_t *p_value)
 Write Current Time characteristic value to remote GATT database. More...
 
void R_BLE_CTC_GetCurTimeAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_ctc_cur_time_attr_hdl_t *p_hdl)
 Get Current Time attribute handles. More...
 
ble_status_t R_BLE_CTC_ReadLocalTimeInfo (uint16_t conn_hdl)
 Read Local Time Information characteristic value from the remote GATT database. More...
 
ble_status_t R_BLE_CTC_WriteLocalTimeInfo (uint16_t conn_hdl, const st_ble_ctc_local_time_info_t *p_value)
 Write Local Time Information characteristic value to remote GATT database. More...
 
void R_BLE_CTC_GetLocalTimeInfoAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_ctc_local_time_info_attr_hdl_t *p_hdl)
 Get Local Time Information attribute handles. More...
 
ble_status_t R_BLE_CTC_ReadRefTimeInfo (uint16_t conn_hdl)
 Read Reference Time Information characteristic value from the remote GATT database. More...
 
void R_BLE_CTC_GetRefTimeInfoAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_ctc_ref_time_info_attr_hdl_t *p_hdl)
 Get Reference Time Information attribute handles. More...
 
ble_status_t R_BLE_CTC_Init (ble_servc_app_cb_t cb)
 Initialize Current Time Service client. More...
 
void R_BLE_CTC_ServDiscCb (uint16_t conn_hdl, uint8_t serv_idx, uint16_t type, void *p_param)
 Current Time Service client discovery callback. More...
 
void R_BLE_CTC_GetServAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_gatt_hdl_range_t *p_hdl)
 Get Current Time Service client attribute handle. More...
 

Macro Definition Documentation

◆ BLE_CTC_DATA_FIELD_IGNORED_ERROR

#define BLE_CTC_DATA_FIELD_IGNORED_ERROR   (BLE_ERR_GROUP_GATT | 0x80)

The server ignored one or more fields.

Enumeration Type Documentation

◆ e_ble_ctc_local_time_info_daylight_saving_time_offset_t

Local Time Information Daylight Saving Time Offset enumeration.

Enumerator
BLE_CTC_LOCAL_TIME_INFO_DAYLIGHT_SAVING_TIME_OFFSET_STANDARD_TIME 

Standard Time

BLE_CTC_LOCAL_TIME_INFO_DAYLIGHT_SAVING_TIME_OFFSET_HALF_AN_HOUR_DAYLIGHT_TIME 

Half An Hour Daylight Time (+0.5h)

BLE_CTC_LOCAL_TIME_INFO_DAYLIGHT_SAVING_TIME_OFFSET_DAYLIGHT_TIME 

Daylight Time (+1h)

BLE_CTC_LOCAL_TIME_INFO_DAYLIGHT_SAVING_TIME_OFFSET_DOUBLE_DAYLIGHT_TIME 

Double Daylight Time (+2h)

◆ e_ble_ctc_ref_time_info_source_t

Reference Time Information Source enumeration.

Enumerator
BLE_CTC_REF_TIME_INFO_SOURCE_UNKNOWN 

Unknown

BLE_CTC_REF_TIME_INFO_SOURCE_NETWORK_TIME_PROTOCOL 

Network Time Protocol

BLE_CTC_REF_TIME_INFO_SOURCE_GPS 

GPS

BLE_CTC_REF_TIME_INFO_SOURCE_RADIO_TIME_SIGNAL 

Radio Time Signal

BLE_CTC_REF_TIME_INFO_SOURCE_MANUAL 

Manual

BLE_CTC_REF_TIME_INFO_SOURCE_ATOMIC_CLOCK 

Atomic Clock

BLE_CTC_REF_TIME_INFO_SOURCE_CELLULAR_NETWORK 

Cellular Network

◆ e_ble_ctc_char_idx_t

Current Time Service characteristic ID.

◆ e_ble_ctc_event_t

Current Time Service client event type.

Function Documentation

◆ R_BLE_CTC_ReadCurTimeCliCnfg()

ble_status_t R_BLE_CTC_ReadCurTimeCliCnfg ( uint16_t  conn_hdl)

Read Current Time characteristic Client Characteristic Configuration descriptor value from the remote GATT database.

Parameters
[in]conn_hdlConnection handle.
Returns
ble_status_t

◆ R_BLE_CTC_WriteCurTimeCliCnfg()

ble_status_t R_BLE_CTC_WriteCurTimeCliCnfg ( uint16_t  conn_hdl,
const uint16_t *  p_value 
)

Write Current Time characteristic Client Characteristic Configuration descriptor value to remote GATT database.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueCurrent Time characteristic Client Characteristic Configuration descriptor value to write.
Returns
ble_status_t

◆ R_BLE_CTC_ReadCurTime()

ble_status_t R_BLE_CTC_ReadCurTime ( uint16_t  conn_hdl)

Read Current Time characteristic value from the remote GATT database.

Parameters
[in]conn_hdlConnection handle.
Returns
ble_status_t

◆ R_BLE_CTC_WriteCurTime()

ble_status_t R_BLE_CTC_WriteCurTime ( uint16_t  conn_hdl,
const st_ble_ctc_cur_time_t p_value 
)

Write Current Time characteristic value to remote GATT database.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueCurrent Time characteristic value to write.
Returns
ble_status_t

◆ R_BLE_CTC_GetCurTimeAttrHdl()

void R_BLE_CTC_GetCurTimeAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_ctc_cur_time_attr_hdl_t p_hdl 
)

Get Current Time attribute handles.

Parameters
[in]p_addrBluetooth device address for the attribute handles.
[out]p_hdlThe pointer to store the retrieved attribute handles.
Returns
ble_status_t

◆ R_BLE_CTC_ReadLocalTimeInfo()

ble_status_t R_BLE_CTC_ReadLocalTimeInfo ( uint16_t  conn_hdl)

Read Local Time Information characteristic value from the remote GATT database.

Parameters
[in]conn_hdlConnection handle.
Returns
ble_status_t

◆ R_BLE_CTC_WriteLocalTimeInfo()

ble_status_t R_BLE_CTC_WriteLocalTimeInfo ( uint16_t  conn_hdl,
const st_ble_ctc_local_time_info_t p_value 
)

Write Local Time Information characteristic value to remote GATT database.

Parameters
[in]conn_hdlConnection handle.
[in]p_valueLocal Time Information characteristic value to write.
Returns
ble_status_t

◆ R_BLE_CTC_GetLocalTimeInfoAttrHdl()

void R_BLE_CTC_GetLocalTimeInfoAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_ctc_local_time_info_attr_hdl_t p_hdl 
)

Get Local Time Information attribute handles.

Parameters
[in]p_addrBluetooth device address for the attribute handles.
[out]p_hdlThe pointer to store the retrieved attribute handles.
Returns
ble_status_t

◆ R_BLE_CTC_ReadRefTimeInfo()

ble_status_t R_BLE_CTC_ReadRefTimeInfo ( uint16_t  conn_hdl)

Read Reference Time Information characteristic value from the remote GATT database.

Parameters
[in]conn_hdlConnection handle.
Returns
ble_status_t

◆ R_BLE_CTC_GetRefTimeInfoAttrHdl()

void R_BLE_CTC_GetRefTimeInfoAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_ctc_ref_time_info_attr_hdl_t p_hdl 
)

Get Reference Time Information attribute handles.

Parameters
[in]p_addrBluetooth device address for the attribute handles.
[out]p_hdlThe pointer to store the retrieved attribute handles.
Returns
ble_status_t

◆ R_BLE_CTC_Init()

ble_status_t R_BLE_CTC_Init ( ble_servc_app_cb_t  cb)

Initialize Current Time Service client.

Parameters
[in]cbClient callback.
Returns
ble_status_t

◆ R_BLE_CTC_ServDiscCb()

void R_BLE_CTC_ServDiscCb ( uint16_t  conn_hdl,
uint8_t  serv_idx,
uint16_t  type,
void *  p_param 
)

Current Time Service client discovery callback.

Parameters
[in]conn_hdlConnection handle
[in]serv_idxService instance index.
[in]typeService discovery event type.
[in]p_paramService discovery event parameter.
Returns
ble_status_t

◆ R_BLE_CTC_GetServAttrHdl()

void R_BLE_CTC_GetServAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_gatt_hdl_range_t p_hdl 
)

Get Current Time Service client attribute handle.

Parameters
[in]p_addrBluetooth device address for the attribute handles.
[out]p_hdlThe pointer to store the retrieved attribute handles.