Modules | Functions
Current Time Service (CTS)
BLE Services

Current Time Service module. More...

## Modules
| Defines
| Enumerations
| Structures
| Typedefs
| Functions

## Functions
void | cts_c_data_parse (uint8_t *p_data, uint16_t length)
| Data accepts data and processing functions. More...
void | reference_time_encode (uint8_t *p_data, uint16_t length)
| Serial port data is converted into reference time. More...
void | local_time_encode (uint8_t *p_data, uint8_t length)
| Serial port data is converted into local time. More...
void | current_time_encode (uint8_t *p_data, uint16_t length)
| Serial port data is converted into current time. More...
uint8_t | local_time_universal_decode (ble_gatts_write_cfm_t *p_cfm, cts_evt_t *p_evt)
| Handle Local Time Information conversion. More...
uint8_t | current_time_universal_decode (ble_gatts_write_cfm_t *p_cfm, cts_evt_t *p_evt)
| Decode for a Current Time. More...

## Detailed Description

Current Time Service module.

The Current Time Service exposes Current Time characteristic. It optionally exposes Local Time Information characteristic and Reference Time Information characteristic.

After cts_init_t variable is intialized, the application must call cts_service_init() to add Current Time Service and Current Time, Local Time Information and Reference Time Information characteristics to the BLE Stack database according to cts_init_t::char_mask.

## Function Documentation

## ◆ cts_c_data_parse()

void cts_c_data_parse | ( | uint8_t * | p_data,
|  | uint16_t | length
| ) |  |

Data accepts data and processing functions.

Parameters

  [in] | p_data | Serial port data.
  [in] | length | Data length.

## ◆ current_time_encode()

void current_time_encode | ( | uint8_t * | p_data,
|  | uint16_t | length
| ) |  |

Serial port data is converted into current time.

Parameters

  [in] | p_data | Serial port data.
  [in] | length | Data length.

## ◆ current_time_universal_decode()

uint8_t current_time_universal_decode | ( | ble_gatts_write_cfm_t * | p_cfm,
|  | cts_evt_t * | p_evt
| ) |  |

Decode for a Current Time.

Parameters

  [in] | p_cfm | Pointer to GATT write attribute result description.
  [in] | p_evt | Pointer to CTS event.

Returns
  Result of data lenth.

## ◆ local_time_encode()

void local_time_encode | ( | uint8_t * | p_data,
|  | uint8_t | length
| ) |  |

Serial port data is converted into local time.

Parameters

  [in] | p_data | Serial port data.
  [in] | length | Data length.

## ◆ local_time_universal_decode()

uint8_t local_time_universal_decode | ( | ble_gatts_write_cfm_t * | p_cfm,
|  | cts_evt_t * | p_evt
| ) |  |

Handle Local Time Information conversion.

Parameters

  [in] | p_cfm | Pointer to GATT write attribute result description.
  [in] | p_evt | Pointer to CTS event.

Returns
  Result of data lenth.

## ◆ reference_time_encode()

void reference_time_encode | ( | uint8_t * | p_data,
|  | uint16_t | length
| ) |  |

Serial port data is converted into reference time.

Parameters

  [in] | p_data | Serial port data.
  [in] | length | Data length.