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

This is the client for the Reference Time Update Service Service. More...

Detailed Description

This is the client for the Reference Time Update Service Service.

Data Structures

struct  st_ble_rtuc_tucp_attr_hdl_t
 Time Update Control Point attribute handle value. More...
 
struct  st_ble_rtuc_tus_t
 Time Update State value structure. More...
 
struct  st_ble_rtuc_tus_attr_hdl_t
 Time Update State attribute handle value. More...
 
struct  st_ble_rtuc_evt_data_t
 Reference Time Update Service client event data. More...
 

Macros

#define BLE_RTUC_TUCP_UUID   (0x2A16)
 
#define BLE_RTUC_TUCP_LEN   (1)
 
#define BLE_RTUC_TUS_UUID   (0x2A17)
 
#define BLE_RTUC_TUS_LEN   (2)
 

Enumerations

enum  e_ble_rtuc_tucp_time_update_control_point_t {
  BLE_RTUC_TUCP_TIME_UPDATE_CONTROL_POINT_GET_REFERENCE_UPDATE = 1,
  BLE_RTUC_TUCP_TIME_UPDATE_CONTROL_POINT_CANCEL_REFERENCE_UPDATE = 2
}
 Time Update Control Point Time Update Control Point enumeration. More...
 
enum  e_ble_rtuc_tus_current_state_t {
  BLE_RTUC_TUS_CURRENT_STATE_IDLE = 0,
  BLE_RTUC_TUS_CURRENT_STATE_UPDATE_PENDING = 1
}
 Time Update State Current State enumeration. More...
 
enum  e_ble_rtuc_tus_result_t {
  BLE_RTUC_TUS_RESULT_SUCCESSFUL = 0,
  BLE_RTUC_TUS_RESULT_CANCELED = 1,
  BLE_RTUC_TUS_RESULT_NO_CONNECTION_TO_REFERENCE = 2,
  BLE_RTUC_TUS_RESULT_REFERENCE_RESPONDED_WITH_AN_ERROR = 3,
  BLE_RTUC_TUS_RESULT_TIMEOUT = 4,
  BLE_RTUC_TUS_RESULT_UPDATE_NOT_ATTEMPTED_AFTER_RESET = 5
}
 Time Update State Result enumeration. More...
 
enum  e_ble_rtuc_char_idx_t {
  BLE_RTUC_TUCP_IDX,
  BLE_RTUC_TUS_IDX
}
 Reference Time Update Service characteristic ID. More...
 
enum  e_ble_rtuc_event_t { BLE_RTUC_EVENT_TUS_READ_RSP = BLE_SERVC_ATTR_EVENT(BLE_RTUC_TUS_IDX, BLE_SERVC_READ_RSP) }
 Reference Time Update Service client event type. More...
 

Functions

void R_BLE_RTUC_GetTucpAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_rtuc_tucp_attr_hdl_t *p_hdl)
 Get Time Update Control Point attribute handles. More...
 
ble_status_t R_BLE_RTUC_ReadTus (uint16_t conn_hdl)
 Read Time Update State characteristic value from the remote GATT database. More...
 
void R_BLE_RTUC_GetTusAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_rtuc_tus_attr_hdl_t *p_hdl)
 Get Time Update State attribute handles. More...
 
ble_status_t R_BLE_RTUC_Init (ble_servc_app_cb_t cb)
 Initialize Reference Time Update Service client. More...
 
void R_BLE_RTUC_ServDiscCb (uint16_t conn_hdl, uint8_t serv_idx, uint16_t type, void *p_param)
 Reference Time Update Service client discovery callback. More...
 
void R_BLE_RTUC_GetServAttrHdl (const st_ble_dev_addr_t *p_addr, st_ble_gatt_hdl_range_t *p_hdl)
 Get Reference Time Update Service client attribute handle. More...
 
ble_status_t R_BLE_RTUC_TimeUpdate_WriteWithoutRsp (uint16_t conn_hdl, const uint8_t *p_value)
 Time Update without response characteristic value to remote GATT database. More...
 

Enumeration Type Documentation

◆ e_ble_rtuc_tucp_time_update_control_point_t

Time Update Control Point Time Update Control Point enumeration.

Enumerator
BLE_RTUC_TUCP_TIME_UPDATE_CONTROL_POINT_GET_REFERENCE_UPDATE 

Get Reference Update

BLE_RTUC_TUCP_TIME_UPDATE_CONTROL_POINT_CANCEL_REFERENCE_UPDATE 

Cancel Reference Update

◆ e_ble_rtuc_tus_current_state_t

Time Update State Current State enumeration.

Enumerator
BLE_RTUC_TUS_CURRENT_STATE_IDLE 

Idle

BLE_RTUC_TUS_CURRENT_STATE_UPDATE_PENDING 

Update Pending

◆ e_ble_rtuc_tus_result_t

Time Update State Result enumeration.

Enumerator
BLE_RTUC_TUS_RESULT_SUCCESSFUL 

Successful

BLE_RTUC_TUS_RESULT_CANCELED 

Canceled

BLE_RTUC_TUS_RESULT_NO_CONNECTION_TO_REFERENCE 

No Connection To Reference

BLE_RTUC_TUS_RESULT_REFERENCE_RESPONDED_WITH_AN_ERROR 

Reference responded with an error

BLE_RTUC_TUS_RESULT_TIMEOUT 

Timeout

BLE_RTUC_TUS_RESULT_UPDATE_NOT_ATTEMPTED_AFTER_RESET 

Update not attempted after reset

◆ e_ble_rtuc_char_idx_t

Reference Time Update Service characteristic ID.

◆ e_ble_rtuc_event_t

Reference Time Update Service client event type.

Function Documentation

◆ R_BLE_RTUC_GetTucpAttrHdl()

void R_BLE_RTUC_GetTucpAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_rtuc_tucp_attr_hdl_t p_hdl 
)

Get Time Update Control Point 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_RTUC_ReadTus()

ble_status_t R_BLE_RTUC_ReadTus ( uint16_t  conn_hdl)

Read Time Update State characteristic value from the remote GATT database.

Parameters
[in]conn_hdlConnection handle.
Returns
ble_status_t

◆ R_BLE_RTUC_GetTusAttrHdl()

void R_BLE_RTUC_GetTusAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_rtuc_tus_attr_hdl_t p_hdl 
)

Get Time Update State 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_RTUC_Init()

ble_status_t R_BLE_RTUC_Init ( ble_servc_app_cb_t  cb)

Initialize Reference Time Update Service client.

Parameters
[in]cbClient callback.
Returns
ble_status_t

◆ R_BLE_RTUC_ServDiscCb()

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

Reference Time Update 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_RTUC_GetServAttrHdl()

void R_BLE_RTUC_GetServAttrHdl ( const st_ble_dev_addr_t p_addr,
st_ble_gatt_hdl_range_t p_hdl 
)

Get Reference Time Update Service client attribute handle.

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

◆ R_BLE_RTUC_TimeUpdate_WriteWithoutRsp()

ble_status_t R_BLE_RTUC_TimeUpdate_WriteWithoutRsp ( uint16_t  conn_hdl,
const uint8_t *  p_value 
)

Time Update without response characteristic value to remote GATT database.

Parameters
[in]conn_hdl- Connection handle.
[in]p_value- Pointer to Time Update without response characteristic value to write.
Returns
ble_status_t