RA Flexible Software Package Documentation  Release v5.2.0

 
BLE Mesh Network Light Location Server (rm_mesh_light_lc_srv)

Functions

fsp_err_t RM_MESH_LIGHT_LC_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_LIGHT_LC_SRV_Close (rm_ble_mesh_model_server_ctrl_t *const p_ctrl)
 
fsp_err_t RM_MESH_LIGHT_LC_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_LIGHT_LC_SRV_SetTimeProperty (rm_ble_mesh_model_server_ctrl_t *const p_ctrl, rm_ble_mesh_model_server_device_property_t property, uint32_t time_in_ms)
 
fsp_err_t RM_MESH_LIGHT_LC_SRV_SetScenario (rm_ble_mesh_model_server_ctrl_t *const p_ctrl, rm_mesh_light_lc_srv_scenario_t const *const p_scenario)
 
fsp_err_t RM_MESH_LIGHT_LC_SRV_GetCurrentScenario (rm_ble_mesh_model_server_ctrl_t *const p_ctrl, rm_mesh_light_lc_srv_scenario_t *const p_scenario)
 
fsp_err_t RM_MESH_LIGHT_LC_SRV_ReportOccupancy (rm_ble_mesh_model_server_ctrl_t *const p_ctrl)
 
fsp_err_t RM_MESH_LIGHT_LC_SRV_ReportLightOnOff (rm_ble_mesh_model_server_ctrl_t *const p_ctrl, rm_mesh_light_lc_srv_light_state_t state)
 

Detailed Description

Overview

Target Devices

The BLE Mesh Network Light Location Server module supports the following devices.

Configuration

Build Time Configurations for rm_mesh_light_lc_srv

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

ConfigurationOptionsDefaultDescription

Configurations for Networking > BLE Mesh Network modules > BLE Mesh Model Light Lightness Controller Server (rm_mesh_light_lc_srv)

This module can be added to the Stacks tab via New Stack > Networking > BLE Mesh Network modules > BLE Mesh Model Light Lightness Controller Server (rm_mesh_light_lc_srv).

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

Data Structures

struct  rm_mesh_light_lc_srv_scenario_t
 
struct  rm_mesh_light_lc_srv_mode_info_t
 
struct  rm_mesh_light_lc_srv_om_info_t
 
struct  rm_mesh_light_lc_srv_light_onoff_info_t
 
struct  rm_mesh_light_lc_srv_property_id_info_t
 
struct  rm_mesh_light_lc_srv_property_info_t
 
struct  rm_mesh_light_lc_srv_extended_callback_args_t
 
struct  rm_mesh_light_lc_srv_instance_ctrl_t
 

Enumerations

enum  rm_ble_mesh_light_lc_srv_event_t
 
enum  rm_ble_mesh_light_lc_srv_state_t
 
enum  rm_mesh_light_lc_srv_light_state_t
 

Data Structure Documentation

◆ rm_mesh_light_lc_srv_scenario_t

struct rm_mesh_light_lc_srv_scenario_t

Light LC Server State Info

Data Fields
rm_ble_mesh_light_lc_srv_state_t state

Light LC Server Current Scenario

uint32_t remaining_time_in_ms

Remaining Time in current scenario

uint8_t occupancy_mode

Light LC Occupancy Mode Value

uint8_t mode

Light LC Mode Value

rm_mesh_light_lc_srv_light_state_t present_light_state

Current Light LC ONOFF State

rm_mesh_light_lc_srv_light_state_t target_light_state

Target Light LC ONOFF State

◆ rm_mesh_light_lc_srv_mode_info_t

struct rm_mesh_light_lc_srv_mode_info_t

Light LC Mode state

Data Fields
uint8_t present_mode

Light LC Mode state - present

uint8_t target_mode

Light LC Mode state - target

◆ rm_mesh_light_lc_srv_om_info_t

struct rm_mesh_light_lc_srv_om_info_t

Light LC Occupancy Mode state

Data Fields
uint8_t present_mode

Light LC Occupancy Mode state - present

uint8_t target_mode

Light LC Occupancy Mode state - target

◆ rm_mesh_light_lc_srv_light_onoff_info_t

struct rm_mesh_light_lc_srv_light_onoff_info_t

Light LC Light OnOff State

Data Fields
uint8_t present_light_onoff

Light LC Light OnOff State

uint8_t target_light_onoff

Light LC Light OnOff State

uint8_t tid

TID - Used in request path

uint8_t transition_time

Transition Time - Used in request path. Used as remaining time in response path.

uint8_t delay

Delay - Used in request path

uint16_t transition_time_handle

Transition Timer Handle

◆ rm_mesh_light_lc_srv_property_id_info_t

struct rm_mesh_light_lc_srv_property_id_info_t

Property ID identifying a Light LC Property

Data Fields
uint16_t property_id

Property ID identifying a Light LC Property

◆ rm_mesh_light_lc_srv_property_info_t

struct rm_mesh_light_lc_srv_property_info_t

Light LC Property state

Data Fields
uint16_t property_id

Property ID identifying a Light LC Property

uint8_t * property_value

Raw value for the Light LC Property

uint16_t property_value_len

◆ rm_mesh_light_lc_srv_extended_callback_args_t

struct rm_mesh_light_lc_srv_extended_callback_args_t

Light LC Property state

Data Fields
rm_ble_mesh_access_model_handle_t * p_handle Access model handle.
rm_ble_mesh_light_lc_srv_event_t event_type Application events defined for Light LC Server Model.
uint8_t * p_event_data Event data.
uint16_t event_data_length Event data length.

◆ rm_mesh_light_lc_srv_instance_ctrl_t

struct rm_mesh_light_lc_srv_instance_ctrl_t

BLE mesh light lc instance control block. DO NOT INITIALIZE. Initialization occurs when RM_MESH_LIGHT_LC_SRV_Open() is called.

Enumeration Type Documentation

◆ rm_ble_mesh_light_lc_srv_event_t

Light LC light event

Enumerator
RM_MESH_LIGHT_LC_SRV_LIGHT_EVENT_OFF 

Light LC Server Event Off.

RM_MESH_LIGHT_LC_SRV_LIGHT_EVENT_STANDBY 

Light LC Server Event Standby.

RM_MESH_LIGHT_LC_SRV_LIGHT_EVENT_FADE_ON 

Light LC Server Event Fade On.

RM_MESH_LIGHT_LC_SRV_LIGHT_EVENT_RUN 

Light LC Server Event Run.

RM_MESH_LIGHT_LC_SRV_LIGHT_EVENT_FADE 

Light LC Server Event Fade.

RM_MESH_LIGHT_LC_SRV_LIGHT_EVENT_PROLONG 

Light LC Server Event Prolong.

RM_MESH_LIGHT_LC_SRV_LIGHT_EVENT_FADE_STANDBY_AUTO 

Light LC Server Event Standby Auto.

RM_MESH_LIGHT_LC_SRV_LIGHT_EVENT_FADE_STANDBY_MANUAL 

Light LC Server Event Standby Manual.

◆ rm_ble_mesh_light_lc_srv_state_t

Light LC state

Enumerator
RM_MESH_LIGHT_LC_SRV_STATE_OFF 

Light LC Server State Off.

RM_MESH_LIGHT_LC_SRV_STATE_STANDBY 

Light LC Server State Standby.

RM_MESH_LIGHT_LC_SRV_STATE_FADE_ON 

Light LC Server State Fade On.

RM_MESH_LIGHT_LC_SRV_STATE_RUN 

Light LC Server State Run.

RM_MESH_LIGHT_LC_SRV_STATE_FADE 

Light LC Server State Fade.

RM_MESH_LIGHT_LC_SRV_STATE_PROLONG 

Light LC Server State Prolong.

RM_MESH_LIGHT_LC_SRV_STATE_FADE_STANDBY_AUTO 

Light LC Server State Standby Auto.

RM_MESH_LIGHT_LC_SRV_STATE_FADE_STANDBY_MANUAL 

Light LC Server State Standby Manual.

◆ rm_mesh_light_lc_srv_light_state_t

Light LC light state

Enumerator
RM_MESH_LIGHT_LC_SRV_LIGHT_STATE_OFF 

Light state Off.

RM_MESH_LIGHT_LC_SRV_LIGHT_STATE_ON 

Light state ON.

Function Documentation

◆ RM_MESH_LIGHT_LC_SRV_Open()

fsp_err_t RM_MESH_LIGHT_LC_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 Light_Lc Server model. This is to initialize Light_Lc Server model and to register with Access layer.

Implements rm_ble_mesh_model_server_api_t::open.

Example:

/* Open the module. */
err = RM_MESH_LIGHT_LC_SRV_Open(&g_mesh_light_lc_srv0_ctrl, &g_mesh_light_lc_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_LIGHT_LC_SRV_Close()

fsp_err_t RM_MESH_LIGHT_LC_SRV_Close ( rm_ble_mesh_model_server_ctrl_t *const  p_ctrl)

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

Implements rm_ble_mesh_model_server_api_t::close.

Example:

/* Close the module. */
err = RM_MESH_LIGHT_LC_SRV_Close(&g_mesh_light_lc_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_LIGHT_LC_SRV_StateUpdate()

fsp_err_t RM_MESH_LIGHT_LC_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_LIGHT_LC_SRV_StateUpdate(&g_mesh_light_lc_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_LIGHT_LC_SRV_SetTimeProperty()

fsp_err_t RM_MESH_LIGHT_LC_SRV_SetTimeProperty ( rm_ble_mesh_model_server_ctrl_t *const  p_ctrl,
rm_ble_mesh_model_server_device_property_t  property,
uint32_t  time_in_ms 
)

API to set Light LC Sever Specific Time Properties. This is to update the Light LC Module with any Light Control Time Properties values. Typically these LC Time properties will be needed to be updated or informed to the Light LC Module during Power-Up, Scene Recall/Restore related scenario or when ever the Local application desires to enforce an update in these device properties values. Currently this interface handles only Time related Device Properties of Light LC Module like: RM_BLE_MESH_MODEL_SERVER_DEVICE_PROPERTY_LIGHT_CONTROL_TIME_OCCUPANCY_DELAY RM_BLE_MESH_MODEL_SERVER_DEVICE_PROPERTY_LIGHT_CONTROL_TIME_FADE_ON RM_BLE_MESH_MODEL_SERVER_DEVICE_PROPERTY_LIGHT_CONTROL_TIME_RUN_ON RM_BLE_MESH_MODEL_SERVER_DEVICE_PROPERTY_LIGHT_CONTROL_TIME_FADE RM_BLE_MESH_MODEL_SERVER_DEVICE_PROPERTY_LIGHT_CONTROL_TIME_PROLONG RM_BLE_MESH_MODEL_SERVER_DEVICE_PROPERTY_LIGHT_CONTROL_TIME_FADE_STANDBY_AUTO RM_BLE_MESH_MODEL_SERVER_DEVICE_PROPERTY_LIGHT_CONTROL_TIME_FADE_STANDBY_MANUAL

Parameters
[in]p_ctrlPointer to control structure.
[in]propertyLC Server Device Property ID
[in]time_in_msRelated Device Property Value time in milliseconds

Example:

/* Set Light LC Sever Specific Time Properties. */
err = RM_MESH_LIGHT_LC_SRV_SetTimeProperty(&g_mesh_light_lc_srv0_ctrl, property, time_in_ms);
Return values
FSP_SUCCESSSet the Light Control Time Properties values successfully.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_NOT_OPENModel is not open.
FSP_ERR_INVALID_ARGUMENTInput parameter is invalid.

◆ RM_MESH_LIGHT_LC_SRV_SetScenario()

fsp_err_t RM_MESH_LIGHT_LC_SRV_SetScenario ( rm_ble_mesh_model_server_ctrl_t *const  p_ctrl,
rm_mesh_light_lc_srv_scenario_t const *const  p_scenario 
)

API to locally trigger the Light LC Server state machine from the application. This typically is used in Power-Up or Scene Recall/Restore Scenario where the Application could trigger the Light LC Server from any desired LC State.

Example:

/* Trigger to Recall/Restore the scenario. */
err = RM_MESH_LIGHT_LC_SRV_SetScenario(&g_mesh_light_lc_srv0_ctrl, &scenario);
Parameters
[in]p_ctrlPointer to control structure.
[in]p_scenarioPointer to rm_mesh_light_lc_srv_scenario_t where Light LC Server State Informations are present
Return values
FSP_SUCCESSUpdated scenario successfully.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_scenario is NULL.
FSP_ERR_NOT_OPENModel is not open.
FSP_ERR_INVALID_ARGUMENTInput parameter is invalid.

◆ RM_MESH_LIGHT_LC_SRV_GetCurrentScenario()

fsp_err_t RM_MESH_LIGHT_LC_SRV_GetCurrentScenario ( rm_ble_mesh_model_server_ctrl_t *const  p_ctrl,
rm_mesh_light_lc_srv_scenario_t *const  p_scenario 
)

API to fetch the Light LC Server state machine related information from the Light LC Server Module. This typically is used in Power-Up or Scene Recall/Restore Scenario where the Application uses this to fetch and persistently store the Light LC State related details.

Example:

/* Fetch the current scenario. */
err = RM_MESH_LIGHT_LC_SRV_GetCurrentScenario(&g_mesh_light_lc_srv0_ctrl, &scenario);
Parameters
[in]p_ctrlPointer to control structure.
[out]p_scenarioPointer to rm_mesh_light_lc_srv_scenario_t where Light LC Server State Informations are present
Return values
FSP_SUCCESSFetch information successfully.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_INVALID_POINTERThe parameter p_scenario is NULL.
FSP_ERR_NOT_OPENModel is not open.

◆ RM_MESH_LIGHT_LC_SRV_ReportOccupancy()

fsp_err_t RM_MESH_LIGHT_LC_SRV_ReportOccupancy ( rm_ble_mesh_model_server_ctrl_t *const  p_ctrl)

API to report any occupancy to Light LC Server Model.

Example:

/* Reports any occupancy. */
err = RM_MESH_LIGHT_LC_SRV_ReportOccupancy(&g_mesh_light_lc_srv0_ctrl);
Parameters
[in]p_ctrlPointer to control structure.
Return values
FSP_SUCCESSUpdated server status successfully.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_NOT_OPENModel is not open.

◆ RM_MESH_LIGHT_LC_SRV_ReportLightOnOff()

fsp_err_t RM_MESH_LIGHT_LC_SRV_ReportLightOnOff ( rm_ble_mesh_model_server_ctrl_t *const  p_ctrl,
rm_mesh_light_lc_srv_light_state_t  state 
)

API to report any Light ON or OFF to Light LC Server Model. There could be many triggering factors to this Light related ON/OFF events from the upper layer. This API could be used for the following scenarios

  1. Manual/Physical trigger of Light ON/OFF
  2. State Binding with Generic ON/OFF
  3. Trigger of Light ON/OFF due to Ambient Light Sensor values

Example:

/* Reports any Light ON or OFF. */
err = RM_MESH_LIGHT_LC_SRV_ReportLightOnOff(&g_mesh_light_lc_srv0_ctrl, state);
Parameters
[in]p_ctrlPointer to control structure.
[in]stateDesired state value of Light LC ONOFF.
Return values
FSP_SUCCESSUpdated server status successfully.
FSP_ERR_ASSERTIONThe parameter p_ctrl is NULL.
FSP_ERR_NOT_OPENModel is not open.