Bluetooth Mesh Time Server Model#

Bluetooth Mesh Time Server Model.

This class provides the commands and messages to interface with the Time Server model

Modules#

sl_btmesh_evt_time_server_time_updated

sl_btmesh_evt_time_server_time_zone_offset_updated

sl_btmesh_evt_time_server_tai_utc_delta_updated

sl_btmesh_evt_time_server_time_role_updated

Functions#

sl_status_t
sl_btmesh_time_server_init(uint16_t elem_index)
sl_status_t
sl_btmesh_time_server_deinit(uint16_t elem_index)
sl_status_t
sl_btmesh_time_server_get_time(uint16_t elem_index, uint64_t *tai_seconds, uint8_t *subsecond, uint8_t *uncertainty, uint8_t *time_authority, int16_t *time_zone_offset, int32_t *tai_utc_delta)
sl_status_t
sl_btmesh_time_server_set_time(uint16_t elem_index, uint64_t tai_seconds, uint8_t subsecond, uint8_t uncertainty, uint8_t time_authority, int16_t time_zone_offset, int32_t tai_utc_delta)
sl_status_t
sl_btmesh_time_server_get_time_zone_offset_new(uint16_t elem_index, int16_t *new_offset, uint64_t *tai_of_zone_change)
sl_status_t
sl_btmesh_time_server_set_time_zone_offset_new(uint16_t elem_index, int16_t new_offset, uint64_t tai_of_zone_change)
sl_status_t
sl_btmesh_time_server_get_tai_utc_delta_new(uint16_t elem_index, int32_t *new_delta, uint64_t *tai_of_delta_change)
sl_status_t
sl_btmesh_time_server_set_tai_utc_delta_new(uint16_t elem_index, int32_t new_delta, uint64_t tai_of_delta_change)
sl_status_t
sl_btmesh_time_server_get_time_role(uint16_t elem_index, uint8_t *time_role)
sl_status_t
sl_btmesh_time_server_set_time_role(uint16_t elem_index, uint8_t time_role)
sl_status_t
sl_btmesh_time_server_get_datetime(uint16_t elem_index, uint16_t *year, uint8_t *month, uint8_t *day, uint8_t *hour, uint8_t *min, uint8_t *sec, uint16_t *ms, int16_t *timezone, uint8_t *day_of_week)
sl_status_t
sl_btmesh_time_server_publish(uint16_t elem_index)
sl_status_t
sl_btmesh_time_server_status(uint16_t destination_address, uint16_t elem_index, uint16_t appkey_index)

Macros#

Function Documentation#

sl_btmesh_time_server_init#

sl_status_t sl_btmesh_time_server_init (uint16_t elem_index)
Parameters
[in]elem_index

Server model element index

Initializes the Time Server model

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 16263 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_time_server_deinit#

sl_status_t sl_btmesh_time_server_deinit (uint16_t elem_index)
Parameters
[in]elem_index

Server model element index

Deinitialize the Time Server model

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 16274 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_time_server_get_time#

sl_status_t sl_btmesh_time_server_get_time (uint16_t elem_index, uint64_t * tai_seconds, uint8_t * subsecond, uint8_t * uncertainty, uint8_t * time_authority, int16_t * time_zone_offset, int32_t * tai_utc_delta)
Parameters
[in]elem_index

Server model element index

[out]tai_seconds

The current TAI time in seconds

[out]subsecond

The sub-second time in units of 1/256th second

[out]uncertainty

The estimated uncertainty in 10 millisecond steps

[out]time_authority

0 = No Time Authority, 1 = Time Authority

[out]time_zone_offset

Current local time zone offset. Range is -64 to 191, representing -16 to 47.75 hours.

[out]tai_utc_delta

Current difference between TAI and UTC in seconds. Range is -255 to 32512.

Get the current time from Time Server

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 16293 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_time_server_set_time#

sl_status_t sl_btmesh_time_server_set_time (uint16_t elem_index, uint64_t tai_seconds, uint8_t subsecond, uint8_t uncertainty, uint8_t time_authority, int16_t time_zone_offset, int32_t tai_utc_delta)
Parameters
[in]elem_index

Server model element index

[in]tai_seconds

The current TAI time in seconds

[in]subsecond

The sub-second time in units of 1/256th second

[in]uncertainty

The estimated uncertainty in 10 millisecond steps

[in]time_authority

0 = No Time Authority, 1 = Time Authority

[in]time_zone_offset

Current local time zone offset. Range is -64 to 191, representing -16 to 47.75 hours.

[in]tai_utc_delta

Current difference between TAI and UTC in seconds. Range is -255 to 32512.

Set the current time for the element.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 16318 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_time_server_get_time_zone_offset_new#

sl_status_t sl_btmesh_time_server_get_time_zone_offset_new (uint16_t elem_index, int16_t * new_offset, uint64_t * tai_of_zone_change)
Parameters
[in]elem_index

Server model element index

[out]new_offset

Upcoming local time zone offset. Range is -64 to 191, representing -16 to 47.75 hours.

[out]tai_of_zone_change

Absolute TAI time when the Time Zone Offset will change from Current to New

Get the upcoming time zone offset from Time Server

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 16339 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_time_server_set_time_zone_offset_new#

sl_status_t sl_btmesh_time_server_set_time_zone_offset_new (uint16_t elem_index, int16_t new_offset, uint64_t tai_of_zone_change)
Parameters
[in]elem_index

Server model element index

[in]new_offset

Upcoming local time zone offset. Range is -64 to 191, representing -16 to 47.75 hours.

[in]tai_of_zone_change

Absolute TAI time when the Time Zone Offset will change from Current to New

Set the upcoming time zone offset for the element

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 16356 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_time_server_get_tai_utc_delta_new#

sl_status_t sl_btmesh_time_server_get_tai_utc_delta_new (uint16_t elem_index, int32_t * new_delta, uint64_t * tai_of_delta_change)
Parameters
[in]elem_index

Server model element index

[out]new_delta

Upcoming difference between TAI and UTC in seconds

[out]tai_of_delta_change

Absolute TAI time when the TAI-UTC Delta will change from Current to New

Get the upcoming TAI-UTC delta for the element

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 16372 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_time_server_set_tai_utc_delta_new#

sl_status_t sl_btmesh_time_server_set_tai_utc_delta_new (uint16_t elem_index, int32_t new_delta, uint64_t tai_of_delta_change)
Parameters
[in]elem_index

Server model element index

[in]new_delta

Upcoming difference between TAI and UTC in seconds. Range is -255 to 32512.

[in]tai_of_delta_change

Absolute TAI time when the TAI-UTC Delta will change from Current to New

Set the upcoming TAI-UTC delta for the element

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 16389 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_time_server_get_time_role#

sl_status_t sl_btmesh_time_server_get_time_role (uint16_t elem_index, uint8_t * time_role)
Parameters
[in]elem_index

Server model element index

[out]time_role

Time Role of the element

Get Time Role for the element

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 16403 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_time_server_set_time_role#

sl_status_t sl_btmesh_time_server_set_time_role (uint16_t elem_index, uint8_t time_role)
Parameters
[in]elem_index

Server model element index

[in]time_role

Time Role of the element. Range is 0 to 3.

  • 0 = Time Role None, The element does not participate in propagation of time information.

  • 1 = Time Role Authority, The element publishes Time Status messages but does not process received Time Status messages.

  • 2 = Time Role Relay, The element processes received and publishes Time Status messages.

  • 3 = Time Role Client, The element does not publish but processes received Time Status messages.

Set Time Role for the element

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 16424 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_time_server_get_datetime#

sl_status_t sl_btmesh_time_server_get_datetime (uint16_t elem_index, uint16_t * year, uint8_t * month, uint8_t * day, uint8_t * hour, uint8_t * min, uint8_t * sec, uint16_t * ms, int16_t * timezone, uint8_t * day_of_week)
Parameters
[in]elem_index

Server model element index

[out]year

Year

[out]month

Month

[out]day

Day

[out]hour

Hour

[out]min

Minutes

[out]sec

Seconds

[out]ms

Milliseconds

[out]timezone

Local time zone offset. Range is -64 to 191, representing -16 to 47.75 hours.

[out]day_of_week

Day of week, 0..6 represents Monday to Sunday

Return the date and time from the Time Server

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 16446 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_time_server_publish#

sl_status_t sl_btmesh_time_server_publish (uint16_t elem_index)
Parameters
[in]elem_index

Element index of the Time Server

Publish Time Status containing the current time. Permitted only for Time Server having the role of Time Authority.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 16467 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_time_server_status#

sl_status_t sl_btmesh_time_server_status (uint16_t destination_address, uint16_t elem_index, uint16_t appkey_index)
Parameters
[in]destination_address

Destination address

[in]elem_index

Element index of the Time Server

[in]appkey_index

The application key index to use

Send a Time Status message containing the current time as an unsolicited message. Permitted only for Time Server having the role of Time Authority.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 16481 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

Macro Definition Documentation#

sl_btmesh_cmd_time_server_init_id#

#define sl_btmesh_cmd_time_server_init_id
Value:
0x00520028

Definition at line 16106 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_time_server_deinit_id#

#define sl_btmesh_cmd_time_server_deinit_id
Value:
0x01520028

Definition at line 16107 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_time_server_get_time_id#

#define sl_btmesh_cmd_time_server_get_time_id
Value:
0x02520028

Definition at line 16108 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_time_server_set_time_id#

#define sl_btmesh_cmd_time_server_set_time_id
Value:
0x03520028

Definition at line 16109 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_time_server_get_time_zone_offset_new_id#

#define sl_btmesh_cmd_time_server_get_time_zone_offset_new_id
Value:
0x04520028

Definition at line 16110 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_time_server_set_time_zone_offset_new_id#

#define sl_btmesh_cmd_time_server_set_time_zone_offset_new_id
Value:
0x05520028

Definition at line 16111 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_time_server_get_tai_utc_delta_new_id#

#define sl_btmesh_cmd_time_server_get_tai_utc_delta_new_id
Value:
0x06520028

Definition at line 16112 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_time_server_set_tai_utc_delta_new_id#

#define sl_btmesh_cmd_time_server_set_tai_utc_delta_new_id
Value:
0x07520028

Definition at line 16113 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_time_server_get_time_role_id#

#define sl_btmesh_cmd_time_server_get_time_role_id
Value:
0x08520028

Definition at line 16114 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_time_server_set_time_role_id#

#define sl_btmesh_cmd_time_server_set_time_role_id
Value:
0x09520028

Definition at line 16115 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_time_server_get_datetime_id#

#define sl_btmesh_cmd_time_server_get_datetime_id
Value:
0x0a520028

Definition at line 16116 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_time_server_publish_id#

#define sl_btmesh_cmd_time_server_publish_id
Value:
0x0b520028

Definition at line 16117 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_cmd_time_server_status_id#

#define sl_btmesh_cmd_time_server_status_id
Value:
0x0c520028

Definition at line 16118 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_time_server_init_id#

#define sl_btmesh_rsp_time_server_init_id
Value:
0x00520028

Definition at line 16119 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_time_server_deinit_id#

#define sl_btmesh_rsp_time_server_deinit_id
Value:
0x01520028

Definition at line 16120 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_time_server_get_time_id#

#define sl_btmesh_rsp_time_server_get_time_id
Value:
0x02520028

Definition at line 16121 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_time_server_set_time_id#

#define sl_btmesh_rsp_time_server_set_time_id
Value:
0x03520028

Definition at line 16122 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_time_server_get_time_zone_offset_new_id#

#define sl_btmesh_rsp_time_server_get_time_zone_offset_new_id
Value:
0x04520028

Definition at line 16123 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_time_server_set_time_zone_offset_new_id#

#define sl_btmesh_rsp_time_server_set_time_zone_offset_new_id
Value:
0x05520028

Definition at line 16124 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_time_server_get_tai_utc_delta_new_id#

#define sl_btmesh_rsp_time_server_get_tai_utc_delta_new_id
Value:
0x06520028

Definition at line 16125 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_time_server_set_tai_utc_delta_new_id#

#define sl_btmesh_rsp_time_server_set_tai_utc_delta_new_id
Value:
0x07520028

Definition at line 16126 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_time_server_get_time_role_id#

#define sl_btmesh_rsp_time_server_get_time_role_id
Value:
0x08520028

Definition at line 16127 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_time_server_set_time_role_id#

#define sl_btmesh_rsp_time_server_set_time_role_id
Value:
0x09520028

Definition at line 16128 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_time_server_get_datetime_id#

#define sl_btmesh_rsp_time_server_get_datetime_id
Value:
0x0a520028

Definition at line 16129 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_time_server_publish_id#

#define sl_btmesh_rsp_time_server_publish_id
Value:
0x0b520028

Definition at line 16130 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h

sl_btmesh_rsp_time_server_status_id#

#define sl_btmesh_rsp_time_server_status_id
Value:
0x0c520028

Definition at line 16131 of file /mnt/raid/workspaces/ws.wDIAeKYhQ/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h