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#
Macros#
Function Documentation#
sl_btmesh_time_server_init#
sl_status_t sl_btmesh_time_server_init (uint16_t elem_index)
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| uint16_t | [in] | elem_index | Server model element index | 
Initializes the Time Server model
Returns
- SL_STATUS_OK if successful. Error code otherwise. 
sl_btmesh_time_server_deinit#
sl_status_t sl_btmesh_time_server_deinit (uint16_t elem_index)
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| uint16_t | [in] | elem_index | Server model element index | 
Deinitialize the Time Server model
Returns
- SL_STATUS_OK if successful. Error code otherwise. 
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)
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| uint16_t | [in] | elem_index | Server model element index | 
| uint64_t * | [out] | tai_seconds | The current TAI time in seconds | 
| uint8_t * | [out] | subsecond | The sub-second time in units of 1/256th second | 
| uint8_t * | [out] | uncertainty | The estimated uncertainty in 10 millisecond steps | 
| uint8_t * | [out] | time_authority | 0 = No Time Authority, 1 = Time Authority | 
| int16_t * | [out] | time_zone_offset | Current local time zone offset. Range is -64 to 191, representing -16 to 47.75 hours. | 
| int32_t * | [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. 
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)
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| uint16_t | [in] | elem_index | Server model element index | 
| uint64_t | [in] | tai_seconds | The current TAI time in seconds | 
| uint8_t | [in] | subsecond | The sub-second time in units of 1/256th second | 
| uint8_t | [in] | uncertainty | The estimated uncertainty in 10 millisecond steps | 
| uint8_t | [in] | time_authority | 0 = No Time Authority, 1 = Time Authority | 
| int16_t | [in] | time_zone_offset | Current local time zone offset. Range is -64 to 191, representing -16 to 47.75 hours. | 
| int32_t | [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. 
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)
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| uint16_t | [in] | elem_index | Server model element index | 
| int16_t * | [out] | new_offset | Upcoming local time zone offset. Range is -64 to 191, representing -16 to 47.75 hours. | 
| uint64_t * | [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. 
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)
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| uint16_t | [in] | elem_index | Server model element index | 
| int16_t | [in] | new_offset | Upcoming local time zone offset. Range is -64 to 191, representing -16 to 47.75 hours. | 
| uint64_t | [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. 
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)
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| uint16_t | [in] | elem_index | Server model element index | 
| int32_t * | [out] | new_delta | Upcoming difference between TAI and UTC in seconds | 
| uint64_t * | [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. 
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)
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| uint16_t | [in] | elem_index | Server model element index | 
| int32_t | [in] | new_delta | Upcoming difference between TAI and UTC in seconds. Range is -255 to 32512. | 
| uint64_t | [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. 
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)
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| uint16_t | [in] | elem_index | Server model element index | 
| uint8_t * | [out] | time_role | Time Role of the element | 
Get Time Role for the element
Returns
- SL_STATUS_OK if successful. Error code otherwise. 
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)
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| uint16_t | [in] | elem_index | Server model element index | 
| uint8_t | [in] | time_role | Time Role of the element. Range is 0 to 3. 
 | 
Set Time Role for the element
Returns
- SL_STATUS_OK if successful. Error code otherwise. 
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)
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| uint16_t | [in] | elem_index | Server model element index | 
| uint16_t * | [out] | year | Year | 
| uint8_t * | [out] | month | Month | 
| uint8_t * | [out] | day | Day | 
| uint8_t * | [out] | hour | Hour | 
| uint8_t * | [out] | min | Minutes | 
| uint8_t * | [out] | sec | Seconds | 
| uint16_t * | [out] | ms | Milliseconds | 
| int16_t * | [out] | timezone | Local time zone offset. Range is -64 to 191, representing -16 to 47.75 hours. | 
| uint8_t * | [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. 
sl_btmesh_time_server_publish#
sl_status_t sl_btmesh_time_server_publish (uint16_t elem_index)
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| uint16_t | [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. 
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)
| Type | Direction | Argument Name | Description | 
|---|---|---|---|
| uint16_t | [in] | destination_address | Destination address | 
| uint16_t | [in] | elem_index | Element index of the Time Server | 
| uint16_t | [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.