This module provides APIs for handling persistence of the Scene Setup Server model related states.
More...
|
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.
|
|
This module provides APIs for handling persistence of the Scene Setup Server model related states.
◆ 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] | handle | Handle to access internal state instances. |
[in] | scene_number | Scene number to store for corresponding handle. |
[out] | p_scene_index | An index to identify an instance of a state variable. |
- Return values
-
NRF_SUCCESS | The entry value was successfully copied into p_value . |
NRF_ERROR_NULL | A parameter is NULL. |
NRF_ERROR_NOT_FOUND | The given index is unknown. |
NRF_ERROR_INVALID_STATE | The 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] | handle | Handle to access internal state instances. |
[in] | scene_number | Scene number to recall for corresponding handle. |
[out] | p_scene_index | An index to identify an instance of a state variable. |
- Return values
-
NRF_SUCCESS | The entry value was successfully copied into p_value . |
NRF_ERROR_NULL | A parameter is NULL. |
NRF_ERROR_NOT_FOUND | The 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] | handle | Handle to access internal state instances. |
[in] | scene_index | A scene index to retrive. |
[out] | p_scene_number | Pointer 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_SUCCESS | The scene number was successfully copied into p_scene_number . |
NRF_ERROR_NULL | A parameter is NULL. |
NRF_ERROR_NOT_FOUND | The 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] | handle | Handle to access internal state instances. |
[in] | scene_number | Scene Number to delete for corresponding handle. |
[out] | p_scene_index | An index to identify an instance of a state variable. |
- Return values
-
NRF_SUCCESS | The value was successfully set. |
NRF_ERROR_NULL | A parameter is NULL. |
NRF_ERROR_NOT_FOUND | The given index is unknown. |
NRF_ERROR_INVALID_DATA | The 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_handle | Pointer to a buffer to copy the handle into to access internal state instance. |
- Return values
-
NRF_SUCCESS | The new instance is successfully created. |
NRF_ERROR_NULL | A parameter is NULL. |
NRF_ERROR_RESOURCES | No more instances can be created. In that case, increase value of SCENE_SETUP_SERVER_INSTANCES_MAX. |