Time models

The Time models allow network-wide time and date synchronization with a granularity of 3.9 ms (1/256th second), and provide services for converting timestamps to and from time zone adjusted UTC time (Coordinated Universal Time). The time is measured based on the International Atomic Time (TAI).

The Time models also feature their own common types, listed below. For types common to all models, see Bluetooth Mesh models.

Common types

This section lists the types common to the Time mesh models.

Header file: include/bluetooth/mesh/time.h
group bt_mesh_time

API for the Time models.

Enums

enum bt_mesh_time_role

Time Role states

Values:

enumerator BT_MESH_TIME_NONE

Does not participate in propagation of time information.

enumerator BT_MESH_TIME_AUTHORITY

Publishes Time Status messages but does not process received Time Status messages.

enumerator BT_MESH_TIME_RELAY

Processes received and publishes Time Status messages.

enumerator BT_MESH_TIME_CLIENT

Does not publish but processes received Time Status messages.

struct bt_mesh_time_tai
#include <time.h>

TAI time.

Public Members

uint64_t sec

Seconds

uint64_t subsec

1/256th seconds

struct bt_mesh_time_status
#include <time.h>

Parameters for the Time Status message.

Public Members

struct bt_mesh_time_tai tai

TAI time.

uint64_t uncertainty

Accumulated uncertainty of the Mesh Timestamp in milliseconds.

int16_t tai_utc_delta

Current TAI-UTC Delta (leap seconds).

int16_t time_zone_offset

Current zone offset in 15-minute increments.

bool is_authority

Reliable TAI source flag.

struct bt_mesh_time_zone_change
#include <time.h>

Time zone change.

Public Members

int16_t new_offset

New zone offset in 15-minute increments.

uint64_t timestamp

TAI update point for Time Zone Offset.

struct bt_mesh_time_zone_status
#include <time.h>

Parameters for the Time Zone Status message.

Public Members

int16_t current_offset

Current zone offset in 15-minute increments.

struct bt_mesh_time_zone_change time_zone_change

New zone update context

struct bt_mesh_time_tai_utc_change
#include <time.h>

Time UTC Delta change.

Public Members

int16_t delta_new

New TAI-UTC Delta (leap seconds).

uint64_t timestamp

TAI update point for TAI-UTC Delta.

struct bt_mesh_time_tai_utc_delta_status
#include <time.h>

Parameters for the Time Zone UTC delta Status message.

Public Members

int16_t delta_current

Current TAI-UTC Delta (leap seconds).

struct bt_mesh_time_tai_utc_change tai_utc_change

New TAI-UTC update context