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 16341 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16352 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16371 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16396 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16417 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16434 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16450 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16467 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16481 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16502 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16524 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16545 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16559 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16184 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16185 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16186 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16187 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16188 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16189 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16190 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16191 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16192 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16193 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16194 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16195 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16196 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16197 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16198 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16199 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16200 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16201 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16202 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16203 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16204 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16205 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16206 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16207 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16208 of file /mnt/raid/workspaces/ws.cynwT2I6w/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 16209 of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/mesh_app/inc/sl_btmesh_api.h