Persistence module for the Scene Setup Server model related states

nRF5 SDK for Mesh v5.0.0

This module provides APIs for handling persistence of the Scene Setup Server model related states. More...

Macros

#define SCENE_NUMBER_EID_START   (MESH_APP_MODEL_SCENE_SERVER_ID_START)
 
#define SCENE_NUMBER_EID   MESH_CONFIG_ENTRY_ID(MESH_OPT_MODEL_FILE_ID, SCENE_NUMBER_EID_START)
 Scene Number state entry ID.
 

Functions

uint32_t scene_mc_store (uint8_t handle, uint16_t scene_number, uint8_t *p_scene_index)
 Store internal Scene Number variable. More...
 
uint32_t scene_mc_recall (uint8_t handle, uint16_t scene_number, uint8_t *p_scene_index)
 Recall internal Scene Number variable. More...
 
uint32_t scene_mc_scene_number_get (uint8_t handle, uint8_t scene_index, uint16_t *p_scene_number)
 Get the scene number at specified scene index. More...
 
uint32_t scene_mc_delete (uint8_t handle, uint16_t scene_number, uint8_t *p_scene_index)
 Delete internal Scene Number variable. More...
 
uint32_t scene_mc_open (uint8_t *p_handle)
 Create an instance of the Scene Setup Server model states and return the corresponding handle. More...
 
void scene_mc_clear (void)
 Clear all stored data and reset state contexts to default values.
 
void scene_mc_init (void)
 Initialize the Scene Setup Server persistent memory.
 

Detailed Description

This module provides APIs for handling persistence of the Scene Setup Server model related states.

Function Documentation

◆ scene_mc_store()

uint32_t scene_mc_store ( uint8_t  handle,
uint16_t  scene_number,
uint8_t *  p_scene_index 
)

Store internal Scene Number variable.

Parameters
[in]handleHandle to access internal state instances.
[in]scene_numberScene number to store for corresponding handle.
[out]p_scene_indexAn index to identify an instance of a state variable.
Return values
NRF_SUCCESSThe entry value was successfully copied into p_value.
NRF_ERROR_NULLA parameter is NULL.
NRF_ERROR_NOT_FOUNDThe given index is unknown.
NRF_ERROR_INVALID_STATEThe given index is known, but has no data associated with it.

◆ scene_mc_recall()

uint32_t scene_mc_recall ( uint8_t  handle,
uint16_t  scene_number,
uint8_t *  p_scene_index 
)

Recall internal Scene Number variable.

Parameters
[in]handleHandle to access internal state instances.
[in]scene_numberScene number to recall for corresponding handle.
[out]p_scene_indexAn index to identify an instance of a state variable.
Return values
NRF_SUCCESSThe entry value was successfully copied into p_value.
NRF_ERROR_NULLA parameter is NULL.
NRF_ERROR_NOT_FOUNDThe given index is unknown.

◆ scene_mc_scene_number_get()

uint32_t scene_mc_scene_number_get ( uint8_t  handle,
uint8_t  scene_index,
uint16_t *  p_scene_number 
)

Get the scene number at specified scene index.

The scene register entries are indexed from 0 to SCENE_REGISTER_ARRAY_SIZE - 1 for each handle.

Parameters
[in]handleHandle to access internal state instances.
[in]scene_indexA scene index to retrive.
[out]p_scene_numberPointer to store the value of the scene number at given scene index. If no scene number exist at that index SCENE_NUMBER_NO_SCENE will be provided.
Return values
NRF_SUCCESSThe scene number was successfully copied into p_scene_number.
NRF_ERROR_NULLA parameter is NULL.
NRF_ERROR_NOT_FOUNDThe given index or handle is unknown.

◆ scene_mc_delete()

uint32_t scene_mc_delete ( uint8_t  handle,
uint16_t  scene_number,
uint8_t *  p_scene_index 
)

Delete internal Scene Number variable.

Parameters
[in]handleHandle to access internal state instances.
[in]scene_numberScene Number to delete for corresponding handle.
[out]p_scene_indexAn index to identify an instance of a state variable.
Return values
NRF_SUCCESSThe value was successfully set.
NRF_ERROR_NULLA parameter is NULL.
NRF_ERROR_NOT_FOUNDThe given index is unknown.
NRF_ERROR_INVALID_DATAThe value is invalid.

◆ scene_mc_open()

uint32_t scene_mc_open ( uint8_t *  p_handle)

Create an instance of the Scene Setup Server model states and return the corresponding handle.

Parameters
[out]p_handlePointer to a buffer to copy the handle into to access internal state instance.
Return values
NRF_SUCCESSThe new instance is successfully created.
NRF_ERROR_NULLA parameter is NULL.
NRF_ERROR_RESOURCESNo more instances can be created. In that case, increase value of SCENE_SETUP_SERVER_INSTANCES_MAX.