Zephyr API Documentation 4.0.0-rc2
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
cts.h File Reference
#include <stdint.h>
#include <zephyr/posix/time.h>

Go to the source code of this file.

Data Structures

struct  bt_cts_time_format
 Current Time service data format, Please refer to specifications for more details. More...
 
struct  bt_cts_cb
 Current Time Service callback structure. More...
 

Enumerations

enum  bt_cts_update_reason {
  BT_CTS_UPDATE_REASON_UNKNOWN = 0 , BT_CTS_UPDATE_REASON_MANUAL = BIT(0) , BT_CTS_UPDATE_REASON_EXTERNAL_REF = BIT(1) , BT_CTS_UPDATE_REASON_TIME_ZONE_CHANGE = BIT(2) ,
  BT_CTS_UPDATE_REASON_DAYLIGHT_SAVING = BIT(3)
}
 CTS time update reason bits as defined in the specification. More...
 

Functions

int bt_cts_init (const struct bt_cts_cb *cb)
 This API should be called at application init.
 
int bt_cts_send_notification (enum bt_cts_update_reason reason)
 Notify all connected clients that have enabled the current time update notification.
 
int bt_cts_time_to_unix_ms (const struct bt_cts_time_format *ct_time, int64_t *unix_ms)
 Helper API to decode CTS formatted time into milliseconds since epoch.
 
int bt_cts_time_from_unix_ms (struct bt_cts_time_format *ct_time, int64_t unix_ms)
 Helper API to encode milliseconds since epoch to CTS formatted time.