This module provides APIs for handling persistence of the Generic Level Server model related states.
More...
This module provides APIs for handling persistence of the Generic Level Server model related states.
◆ GENERIC_LEVEL_SERVER_STORED_WITH_SCENE_STATES
#define GENERIC_LEVEL_SERVER_STORED_WITH_SCENE_STATES |
Value:#define SCENE_REGISTER_ARRAY_SIZE
Scene Register size definitions.
#define GENERIC_LEVEL_SERVER_INSTANCES_MAX
The number of the Generic Level Server (independent, root only) instances used by the application...
Number of entry instances required to store the current state and state for each scene.
- Note
- If SCENE_SETUP_SERVER_INSTANCES_MAX is equal to 0, then this is equal to GENERIC_LEVEL_SERVER_INSTANCES_MAX.
Definition at line 66 of file generic_level_mc.h.
◆ generic_level_mc_level_state_set()
uint32_t generic_level_mc_level_state_set |
( |
uint8_t |
index, |
|
|
int16_t |
value |
|
) |
| |
Set internal Level state variable.
- Parameters
-
[in] | index | An index to identify an instance of a state variable. |
[in] | value | Value to set. |
- Return values
-
NRF_SUCCESS | The value was successfully set. |
NRF_ERROR_NOT_FOUND | The given index is unknown. |
NRF_ERROR_INVALID_DATA | The value is invalid. |
◆ generic_level_mc_level_state_get()
uint32_t generic_level_mc_level_state_get |
( |
uint8_t |
index, |
|
|
int16_t * |
p_value |
|
) |
| |
Get internal Level state variable.
- Parameters
-
[in] | index | An index to identify an instance of a state variable. |
[out] | p_value | Pointer to a buffer to copy the value into. Cannot be NULL. |
- 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. |
◆ generic_level_mc_scene_level_store()
uint32_t generic_level_mc_scene_level_store |
( |
uint8_t |
index, |
|
|
uint8_t |
scene_index, |
|
|
int16_t |
value |
|
) |
| |
Store internal Scene Level state variable.
- Note
- Available only if SCENE_SETUP_SERVER_INSTANCES_MAX is equal or larger than 1.
- Parameters
-
[in] | index | An index to identify an instance of a state variable. |
[in] | scene_index | The scene index to idenitfy the scene of a state variable. |
[in] | value | Value to store. |
- Return values
-
NRF_SUCCESS | The value was successfully set. |
NRF_ERROR_NOT_FOUND | The given index is unknown. |
NRF_ERROR_INVALID_DATA | The value is invalid. |
◆ generic_level_mc_scene_level_recall()
uint32_t generic_level_mc_scene_level_recall |
( |
uint8_t |
index, |
|
|
uint8_t |
scene_index, |
|
|
int16_t * |
p_value |
|
) |
| |
Recall internal Scene Level state variable.
- Note
- Available only if SCENE_SETUP_SERVER_INSTANCES_MAX is equal or larger than 1.
- Parameters
-
[in] | index | An index to identify an instance of a state variable. |
[in] | scene_index | The scene index to idenitfy the scene of a state variable. |
[out] | p_value | Pointer to a buffer to copy the value into. Cannot be NULL. |
- 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. |
◆ generic_level_mc_open()
uint32_t generic_level_mc_open |
( |
uint8_t * |
p_handle | ) |
|
Create an instance of the Generic Level 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 GENERIC_LEVEL_SERVER_INSTANCES_MAX. |