RA Flexible Software Package Documentation  Release v5.2.0

 
BLE Mesh Network Sensor Server (rm_mesh_sensor_srv)

Functions

fsp_err_t RM_MESH_SENSOR_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_SENSOR_SRV_Close (rm_ble_mesh_model_server_ctrl_t *const p_ctrl)
 
fsp_err_t RM_MESH_SENSOR_SRV_StateUpdate (rm_ble_mesh_model_server_ctrl_t *const p_ctrl, rm_ble_mesh_access_server_state_t const *const p_state)
 
fsp_err_t RM_MESH_SENSOR_SRV_SetupServerStateUpdate (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 Sensor Server module supports the following devices.

Configuration

Build Time Configurations for rm_mesh_sensor_srv

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

ConfigurationOptionsDefaultDescription

Configurations for Networking > BLE Mesh Network modules > BLE Mesh Model Sensor Server (rm_mesh_sensor_srv)

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

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

Data Structures

struct  rm_mesh_sensor_srv_descriptor_info_t
 
struct  rm_mesh_sensor_srv_settings_info_t
 
struct  rm_mesh_sensor_srv_setting_info_t
 
struct  rm_mesh_sensor_srv_cadence_info_t
 
struct  rm_mesh_sensor_srv_data_info_t
 
struct  rm_mesh_sensor_srv_series_column_info_t
 
struct  rm_mesh_sensor_srv_instance_ctrl_t
 

Data Structure Documentation

◆ rm_mesh_sensor_srv_descriptor_info_t

struct rm_mesh_sensor_srv_descriptor_info_t

Sensor Descriptor state represents the attributes describing the sensor data

Data Fields
uint16_t sensor_property_id

Sensor Property ID field is a 2-octet value referencing a device property that describes the meaning and the format of data reported by a sensor

uint16_t sensor_positive_tolerance

Sensor Positive Tolerance field is a 12-bit value representing the magnitude of a possible positive error associated with the measurements that the sensor is reporting

uint16_t sensor_negative_tolerance

Sensor Negative Tolerance field is a 12-bit value representing the magnitude of a possible negative error associated with the measurements that the sensor is reporting

uint8_t sensor_sampling_function

Sensor Sampling Function field specifies the averaging operation or type of sampling function applied to the measured value

uint8_t sensor_measurement_period

Sensor Measurement Period field specifies a uint8 value n that represents the averaging time span, accumulation time, or measurement period in seconds over which the measurement is taken

uint8_t sensor_update_interval

measurement reported by a sensor is internally refreshed at the frequency indicated in the Sensor Update Interval field

uint8_t status

Status - used in response to indicate if other fields to be included

◆ rm_mesh_sensor_srv_settings_info_t

struct rm_mesh_sensor_srv_settings_info_t

Sensor Settings state controls parameters of a sensor

Data Fields
uint16_t sensor_property_id

Property ID of a sensor

uint16_t * setting_property_ids

Property ID of a setting within a sensor

uint16_t setting_property_ids_count

◆ rm_mesh_sensor_srv_setting_info_t

struct rm_mesh_sensor_srv_setting_info_t

Sensor Setting state controls parameters of a sensor

Data Fields
uint16_t sensor_property_id

Property ID of a sensor

uint16_t sensor_setting_property_id

Property ID of a setting within a sensor

uint8_t sensor_setting_access

Read/Write access rights for the setting

uint8_t * sensor_setting_raw

Raw value of a setting within a sensor

uint16_t sensor_setting_raw_len
uint8_t status

◆ rm_mesh_sensor_srv_cadence_info_t

struct rm_mesh_sensor_srv_cadence_info_t

Sensor Cadence state controls the cadence of sensor reports

Data Fields
uint16_t sensor_property_id

Property ID of a sensor

uint8_t fast_cadence_period_divisor

Divisor for the Publish Period

uint8_t status_trigger_type

Defines the unit and format of the Status Trigger Delta fields

uint8_t * status_trigger_delta_down

Delta down value that triggers a status message

uint16_t status_trigger_delta_down_len
uint8_t * status_trigger_delta_up

Delta up value that triggers a status message

uint16_t status_trigger_delta_up_len
uint8_t status_min_interval

Minimum interval between two consecutive Status messages APPLICATION NOTE: The Current Sensor Server Model implementation does not inherantly check for the time interval between two consecutive status messages. The application layer which manages the data for the Sensor Server Model holds the responsibility for interleaving consecutive status messages with the configured Minimum time interval for statuses.

uint8_t * fast_cadence_low

Low value for the fast cadence range

uint16_t fast_cadence_low_len
uint8_t * fast_cadence_high

High value for the fast cadence range

uint16_t fast_cadence_high_len
uint8_t status

Status - used in response path

◆ rm_mesh_sensor_srv_data_info_t

struct rm_mesh_sensor_srv_data_info_t

The Sensor Data state is a sequence of one or more pairs of Sensor Property ID and Raw Value fields, with each Raw Value field size and representation defined by the characteristics referenced by the Sensor Property ID

Data Fields
uint16_t property_id_1

ID of the 1st device property of the sensor

uint8_t * raw_value_1

Raw Value field with a size and representation defined by the 1st device property

uint16_t raw_value_1_len
uint16_t property_id_2

ID of the 2nd device property of the sensor

uint8_t * raw_value_2

Raw Value field with a size and representation defined by the 2nd device property

uint16_t raw_value_2_len
uint16_t property_id_n

ID of the nth device property of the sensor

uint8_t * raw_value_n

Raw Value field with a size and representation defined by the nth device property

uint16_t raw_value_n_len
uint8_t status

Status - used in response path

◆ rm_mesh_sensor_srv_series_column_info_t

struct rm_mesh_sensor_srv_series_column_info_t

Values measured by sensors may be organized as arrays (and represented as series of columns, such as histograms

Data Fields
uint16_t sensor_property_id

Property describing the data series of the sensor

uint8_t * sensor_raw_value_x

Raw value representing the left corner of a column on the X axis

uint16_t sensor_raw_value_x_len
uint8_t * sensor_column_width

Raw value representing the width of the column

uint16_t sensor_column_width_len
uint8_t * sensor_raw_value_y

Raw value representing the height of the column on the Y axis

uint16_t sensor_raw_value_y_len
uint8_t status

Status - used in response path

◆ rm_mesh_sensor_srv_instance_ctrl_t

struct rm_mesh_sensor_srv_instance_ctrl_t

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

Function Documentation

◆ RM_MESH_SENSOR_SRV_Open()

fsp_err_t RM_MESH_SENSOR_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 Sensor Server model and to initialize Sensor_Setup Server model. This is to initialize Sensor Server model and to register with Access layer. And this is to initialize Sensor_Setup Server model and to register with Access layer.

Implements rm_ble_mesh_model_server_api_t::open.

Example:

/* Open the module. */
err = RM_MESH_SENSOR_SRV_Open(&g_mesh_sensor_srv0_ctrl, &g_mesh_sensor_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_SENSOR_SRV_Close()

fsp_err_t RM_MESH_SENSOR_SRV_Close ( rm_ble_mesh_model_server_ctrl_t *const  p_ctrl)

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

Implements rm_ble_mesh_model_server_api_t::close.

Example:

/* Close the module. */
err = RM_MESH_SENSOR_SRV_Close(&g_mesh_sensor_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_SENSOR_SRV_StateUpdate()

fsp_err_t RM_MESH_SENSOR_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_SENSOR_SRV_StateUpdate(&g_mesh_sensor_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.

◆ RM_MESH_SENSOR_SRV_SetupServerStateUpdate()

fsp_err_t RM_MESH_SENSOR_SRV_SetupServerStateUpdate ( 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.

Parameters
[in]p_ctrlrm_mesh_sensor_srv control block.
[in]p_stateTo send reply for a request or to inform change in state.
Return values
FSP_SUCCESSOperation succeeded.
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.