RA Flexible Software Package Documentation  Release v5.2.0

 
BLE Mesh Network Time Server (rm_mesh_time_srv)

Functions

fsp_err_t RM_MESH_TIME_SRV_Open (rm_ble_mesh_model_server_ctrl_t *const p_ctrl, rm_ble_mesh_model_server_cfg_t const *const p_cfg)
 
fsp_err_t RM_MESH_TIME_SRV_Close (rm_ble_mesh_model_server_ctrl_t *const p_ctrl)
 
fsp_err_t RM_MESH_TIME_SRV_StateUpdate (rm_ble_mesh_model_server_ctrl_t *const p_ctrl, rm_ble_mesh_access_server_state_t const *const p_state)
 

Detailed Description

Overview

Target Devices

The BLE Mesh Network Time Server module supports the following devices.

Configuration

Build Time Configurations for rm_mesh_time_srv

The following build time configurations are defined in fsp_cfg/rm_mesh_time_srv_cfg.h:

ConfigurationOptionsDefaultDescription

Configurations for Networking > BLE Mesh Network modules > BLE Mesh Model Time Server (rm_mesh_time_srv)

This module can be added to the Stacks tab via New Stack > Networking > BLE Mesh Network modules > BLE Mesh Model Time Server (rm_mesh_time_srv).

ConfigurationOptionsDefaultDescription
Interrupts
Callback Provided when Timeout OccursName Must Be a Valid C SymbolNULL Callback provided when mesh time server ISR occurs
Callback Provided when an Timeout ISR OccursName Must Be a Valid C SymbolNULL Callback provided when mesh time server timeout ISR occurs
NameName Must Be a Valid C Symbolg_rm_mesh_time_srv0 Module name.

Data Structures

struct  rm_mesh_time_srv_info_t
 
struct  rm_mesh_time_srv_zone_info_t
 
struct  rm_mesh_time_srv_tai_utc_delta_info_t
 
struct  rm_mesh_time_srv_role_info_t
 
struct  rm_mesh_time_srv_instance_ctrl_t
 

Data Structure Documentation

◆ rm_mesh_time_srv_info_t

struct rm_mesh_time_srv_info_t

Mesh defines times based on International Atomic Time (TAI). The base representation of times is the number of seconds after 00:00:00 TAI on 2000-01-01 (that is, 1999-12-31T23:59:28 UTC)

Data Fields
uint8_t tai_seconds[5]

Current TAI time in seconds since the epoch.

uint8_t subsecond

The sub-second time in units of 1/256s.

uint8_t uncertainty

Estimated uncertainty in 10-millisecond steps.

uint8_t time_authority

0 = No Time Authority. The element does not have a trusted OOB source of time, such as GPS or NTP. 1 = Time Authority. The element has a trusted OOB source of time, such as GPS or NTP or a battery-backed, properly initialized RTC.

uint16_t tai_utc_delta

Current difference between TAI and UTC in seconds

uint8_t time_zone_offset

The local time zone offset in 15-minute increments

◆ rm_mesh_time_srv_zone_info_t

struct rm_mesh_time_srv_zone_info_t

Time Zone

Data Fields
uint8_t time_zone_offset_current

Current local time zone offset. Meaningful only in 'Time Zone Status' response.

uint8_t time_zone_offset_new

Upcoming local time zone offset.

uint8_t tai_of_zone_change[5]

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

◆ rm_mesh_time_srv_tai_utc_delta_info_t

struct rm_mesh_time_srv_tai_utc_delta_info_t

TAI-UTC Delta

Data Fields
uint16_t tai_utc_delta_current

Current difference between TAI and UTC in seconds. Meaningful only in 'TAI-UTC Delta Status' response.

uint16_t tai_utc_delta_new

Upcoming difference between TAI and UTC in seconds.

uint8_t padding

Always 0b0. Other values are Prohibited.

uint8_t tai_of_delta_change[5]

TAI Seconds time of the upcoming TAI-UTC Delta change

◆ rm_mesh_time_srv_role_info_t

struct rm_mesh_time_srv_role_info_t

The Time Role state of an element

Data Fields
uint8_t role

Time Role

◆ rm_mesh_time_srv_instance_ctrl_t

struct rm_mesh_time_srv_instance_ctrl_t

BLE mesh time instance control block. DO NOT INITIALIZE. Initialization occurs when RM_MESH_TIME_SRV_Open() is called.

Function Documentation

◆ RM_MESH_TIME_SRV_Open()

fsp_err_t RM_MESH_TIME_SRV_Open ( rm_ble_mesh_model_server_ctrl_t *const  p_ctrl,
rm_ble_mesh_model_server_cfg_t const *const  p_cfg 
)

API to initialize Time Server model. This is to initialize Time Server model and to register with Access layer.

Implements rm_ble_mesh_model_server_api_t::open.

Example:

/* Open the module. */
err = RM_MESH_TIME_SRV_Open(&g_mesh_time_srv0_ctrl, &g_mesh_time_srv0_cfg);
Return values
FSP_SUCCESSModel opened successfully.
FSP_ERR_ASSERTIONPointer to control block or configuration structure is NULL.
FSP_ERR_ALREADY_OPENModel is already open.
FSP_ERR_NOT_FOUNDThe number of models has exceeded the limit.
FSP_ERR_ABORTEDModel initialization is failed.

◆ RM_MESH_TIME_SRV_Close()

fsp_err_t RM_MESH_TIME_SRV_Close ( rm_ble_mesh_model_server_ctrl_t *const  p_ctrl)

API to terminate Time Server model. This is to terminate Time Server model and to register with Access layer.

Implements rm_ble_mesh_model_server_api_t::close.

Example:

/* Close the module. */
err = RM_MESH_TIME_SRV_Close(&g_mesh_time_srv0_ctrl);
Return values
FSP_SUCCESSModel successfully closed.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_NOT_OPENModel is not open.

◆ RM_MESH_TIME_SRV_StateUpdate()

fsp_err_t RM_MESH_TIME_SRV_StateUpdate ( rm_ble_mesh_model_server_ctrl_t *const  p_ctrl,
rm_ble_mesh_access_server_state_t const *const  p_state 
)

API to send reply or to update state change. This is to send reply for a request or to inform change in state.

Implements rm_ble_mesh_model_server_api_t::stateUpdate.

Example:

/* Update server status. */
err = RM_MESH_TIME_SRV_StateUpdate(&g_mesh_time_srv0_ctrl, &state);
Return values
FSP_SUCCESSUpdated server status successfully.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_state is NULL.
FSP_ERR_NOT_OPENModel is not open.
FSP_ERR_INVALID_ARGUMENTInput parameter is invalid.
FSP_ERR_APPROXIMATIONLower layer is invalid state.
FSP_ERR_NOT_FOUNDInput parameter is not found.
FSP_ERR_INVALID_ADDRESSInvalid source address.
FSP_ERR_OUT_OF_MEMORYMemory allocation is failed.
FSP_ERR_OVERFLOWTX queue is full.
FSP_ERR_UNDERFLOWTX queue is empty.
FSP_ERR_ABORTEDOperation is failed.