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

This service defines how a client can request an update from a reference time source from a time server using the Generic Attribute Profile (GATT) More...

Detailed Description

This service defines how a client can request an update from a reference time source from a time server using the Generic Attribute Profile (GATT)

Data Structures

struct  st_ble_rtus_tus_t
 Time Update State value structure. More...
 

Enumerations

enum  e_ble_rtus_tucp_time_update_control_point_t {
  BLE_RTUS_TUCP_TIME_UPDATE_CONTROL_POINT_GET_REFERENCE_UPDATE = 1,
  BLE_RTUS_TUCP_TIME_UPDATE_CONTROL_POINT_CANCEL_REFERENCE_UPDATE = 2
}
 Time Update Control Point Time Update Control Point enumeration. More...
 
enum  e_ble_rtus_tus_current_state_t {
  BLE_RTUS_TUS_CURRENT_STATE_IDLE = 0,
  BLE_RTUS_TUS_CURRENT_STATE_UPDATE_PENDING = 1
}
 Time Update State Current State enumeration. More...
 
enum  e_ble_rtus_tus_result_t {
  BLE_RTUS_TUS_RESULT_SUCCESSFUL = 0,
  BLE_RTUS_TUS_RESULT_CANCELED = 1,
  BLE_RTUS_TUS_RESULT_NO_CONNECTION_TO_REFERENCE = 2,
  BLE_RTUS_TUS_RESULT_REFERENCE_RESPONDED_WITH_AN_ERROR = 3,
  BLE_RTUS_TUS_RESULT_TIMEOUT = 4,
  BLE_RTUS_TUS_RESULT_UPDATE_NOT_ATTEMPTED_AFTER_RESET = 5
}
 Time Update State Result enumeration. More...
 
enum  e_ble_rtus_char_idx_t {
  BLE_RTUS_TUCP_IDX,
  BLE_RTUS_TUS_IDX
}
 Reference Time Update Service characteristic Index. More...
 
enum  e_ble_rtus_event_t {
  BLE_RTUS_EVENT_TUCP_WRITE_CMD = BLE_SERVS_ATTR_EVENT(BLE_RTUS_TUCP_IDX, BLE_SERVS_WRITE_CMD),
  BLE_RTUS_EVENT_TUS_READ_REQ = BLE_SERVS_ATTR_EVENT(BLE_RTUS_TUS_IDX, BLE_SERVS_READ_REQ)
}
 Reference Time Update Service event type. More...
 

Functions

ble_status_t R_BLE_RTUS_SetTus (const st_ble_rtus_tus_t *p_value)
 Set Time Update State characteristic value to the local GATT database. More...
 
ble_status_t R_BLE_RTUS_GetTus (st_ble_rtus_tus_t *p_value)
 Get Time Update State characteristic value from the local GATT database. More...
 
ble_status_t R_BLE_RTUS_Init (ble_servs_app_cb_t cb)
 Initialize Reference Time Update Service service. More...
 

Enumeration Type Documentation

◆ e_ble_rtus_tucp_time_update_control_point_t

Time Update Control Point Time Update Control Point enumeration.

Enumerator
BLE_RTUS_TUCP_TIME_UPDATE_CONTROL_POINT_GET_REFERENCE_UPDATE 

Get Reference Update

BLE_RTUS_TUCP_TIME_UPDATE_CONTROL_POINT_CANCEL_REFERENCE_UPDATE 

Cancel Reference Update

◆ e_ble_rtus_tus_current_state_t

Time Update State Current State enumeration.

Enumerator
BLE_RTUS_TUS_CURRENT_STATE_IDLE 

Idle

BLE_RTUS_TUS_CURRENT_STATE_UPDATE_PENDING 

Update Pending

◆ e_ble_rtus_tus_result_t

Time Update State Result enumeration.

Enumerator
BLE_RTUS_TUS_RESULT_SUCCESSFUL 

Successful

BLE_RTUS_TUS_RESULT_CANCELED 

Canceled

BLE_RTUS_TUS_RESULT_NO_CONNECTION_TO_REFERENCE 

No Connection To Reference

BLE_RTUS_TUS_RESULT_REFERENCE_RESPONDED_WITH_AN_ERROR 

Reference responded with an error

BLE_RTUS_TUS_RESULT_TIMEOUT 

Timeout

BLE_RTUS_TUS_RESULT_UPDATE_NOT_ATTEMPTED_AFTER_RESET 

Update not attempted after reset

◆ e_ble_rtus_char_idx_t

Reference Time Update Service characteristic Index.

◆ e_ble_rtus_event_t

Reference Time Update Service event type.

Function Documentation

◆ R_BLE_RTUS_SetTus()

ble_status_t R_BLE_RTUS_SetTus ( const st_ble_rtus_tus_t p_value)

Set Time Update State characteristic value to the local GATT database.

Parameters
[in]p_valueCharacteristic value to set.
Returns
ble_status_t

◆ R_BLE_RTUS_GetTus()

ble_status_t R_BLE_RTUS_GetTus ( st_ble_rtus_tus_t p_value)

Get Time Update State characteristic value from the local GATT database.

Parameters
[in]p_valueOutput location for the acquired descriptor value.
Returns
ble_status_t

◆ R_BLE_RTUS_Init()

ble_status_t R_BLE_RTUS_Init ( ble_servs_app_cb_t  cb)

Initialize Reference Time Update Service service.

Parameters
[in]cbService callback.
Returns
ble_status_t