RA Flexible Software Package Documentation  Release v5.2.0

 
BLE Mesh Network Scene Server (rm_mesh_scene_srv)

Functions

fsp_err_t RM_MESH_SCENE_SRV_Open (rm_ble_mesh_scene_server_ctrl_t *const p_ctrl, rm_ble_mesh_scene_server_cfg_t const *const p_cfg)
 
fsp_err_t RM_MESH_SCENE_SRV_Close (rm_ble_mesh_scene_server_ctrl_t *const p_ctrl)
 
fsp_err_t RM_MESH_SCENE_SRV_StateUpdate (rm_ble_mesh_scene_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 Scene Server module supports the following devices.

Configuration

Build Time Configurations for rm_mesh_scene_srv

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

ConfigurationOptionsDefaultDescription

Configurations for Networking > BLE Mesh Network modules > BLE Mesh Model Scene Server (rm_mesh_scene_srv)

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

ConfigurationOptionsDefaultDescription
Interrupts
Callback Provided when Timeout OccursName Must Be a Valid C SymbolNULL Callback provided when mesh scene server ISR occurs
Callback Provided when an Timeout ISR OccursName Must Be a Valid C SymbolNULL Callback provided when mesh scene server timeout ISR occurs
NameName Must Be a Valid C Symbolg_rm_mesh_scene_srv0 Module name.
Model HandleInvalid Model Handle0 Select model handle.
Setup Server HandleInvalid Setup Server Handle0 Select setup server handle.

Data Structures

struct  rm_mesh_scene_srv_number_info_t
 
struct  rm_mesh_scene_srv_status_info_t
 
struct  rm_mesh_scene_srv_register_status_info_t
 
struct  rm_mesh_scene_srv_ext_tid_and_transition_info_t
 
struct  rm_mesh_scene_srv_instance_ctrl_t
 

Data Structure Documentation

◆ rm_mesh_scene_srv_number_info_t

struct rm_mesh_scene_srv_number_info_t

The state to identify a scene

Data Fields
uint16_t number

The number to identify a scene

◆ rm_mesh_scene_srv_status_info_t

struct rm_mesh_scene_srv_status_info_t

The current status of a currently active scene

Data Fields
uint8_t status_code

Status Code

uint16_t current_scene

Scene Number of a current scene.

uint16_t target_scene

Scene Number of a target scene.

uint8_t remaining_time

◆ rm_mesh_scene_srv_register_status_info_t

struct rm_mesh_scene_srv_register_status_info_t

The current status of scene register

Data Fields
uint8_t status_code

Status Code

uint16_t current_scene

Scene Number of a current scene.

uint16_t * scenes

A list of scenes stored within an element

uint16_t scenes_count

◆ rm_mesh_scene_srv_ext_tid_and_transition_info_t

struct rm_mesh_scene_srv_ext_tid_and_transition_info_t

TID and Transition is a structure which contains Transaction ID (TID) as mandatory field. Other two fields, Transition Time and Delay are optional.

TID field is a transaction identifier indicating whether the message is a new message or a retransmission of a previously sent message.

If present, the Transition Time field identifies the time that an element will take to transition to the target state from the present state.

The Delay field shall be present when the Transition Time field is present. It identifies the message execution delay, representing a time interval between receiving the message by a model and executing the associated model behaviors.

◆ rm_mesh_scene_srv_instance_ctrl_t

struct rm_mesh_scene_srv_instance_ctrl_t

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

Function Documentation

◆ RM_MESH_SCENE_SRV_Open()

fsp_err_t RM_MESH_SCENE_SRV_Open ( rm_ble_mesh_scene_server_ctrl_t *const  p_ctrl,
rm_ble_mesh_scene_server_cfg_t const *const  p_cfg 
)

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

Implements rm_ble_mesh_model_server_api_t::open.

Example:

/* Open the module. */
err = RM_MESH_SCENE_SRV_Open(&g_mesh_scene_srv0_ctrl, &g_mesh_scene_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_SCENE_SRV_Close()

fsp_err_t RM_MESH_SCENE_SRV_Close ( rm_ble_mesh_scene_server_ctrl_t *const  p_ctrl)

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

Implements rm_ble_mesh_model_server_api_t::close.

Example:

/* Close the module. */
err = RM_MESH_SCENE_SRV_Close(&g_mesh_scene_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_SCENE_SRV_StateUpdate()

fsp_err_t RM_MESH_SCENE_SRV_StateUpdate ( rm_ble_mesh_scene_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_SCENE_SRV_StateUpdate(&g_mesh_scene_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.