This module provides APIs for handling persistence of the Generic OnOff Server model related states.
More...
This module provides APIs for handling persistence of the Generic OnOff Server model related states.
◆ GENERIC_ONOFF_SERVER_STORED_WITH_SCENE_STATES
#define GENERIC_ONOFF_SERVER_STORED_WITH_SCENE_STATES |
Value:#define SCENE_REGISTER_ARRAY_SIZE
Scene Register size definitions.
#define GENERIC_ONOFF_SERVER_INSTANCES_MAX
The number of the Generic OnOff 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_ONOFF_SERVER_INSTANCES_MAX.
Definition at line 67 of file generic_onoff_mc.h.
◆ generic_onoff_mc_onoff_state_set()
uint32_t generic_onoff_mc_onoff_state_set |
( |
uint8_t |
index, |
|
|
bool |
value |
|
) |
| |
Set internal OnOff 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_onoff_mc_onoff_state_get()
uint32_t generic_onoff_mc_onoff_state_get |
( |
uint8_t |
index, |
|
|
bool * |
p_value |
|
) |
| |
Get internal OnOff 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_onoff_mc_scene_onoff_store()
uint32_t generic_onoff_mc_scene_onoff_store |
( |
uint8_t |
index, |
|
|
uint8_t |
scene_index, |
|
|
bool |
value |
|
) |
| |
Stores the given OnOff value for the specific scene index.
- 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 model. |
[in] | scene_index | A scene index for which given value is saved. |
[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_onoff_mc_scene_onoff_recall()
uint32_t generic_onoff_mc_scene_onoff_recall |
( |
uint8_t |
index, |
|
|
uint8_t |
scene_index, |
|
|
bool * |
p_value |
|
) |
| |
Restores the given OnOff value for the specific scene index.
- 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 model. |
[in] | scene_index | A scene index for which value is to be recalled. |
[in] | p_value | Pointer to a buffer to copy the value into. |
- 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_onoff_mc_open()
uint32_t generic_onoff_mc_open |
( |
uint8_t * |
p_handle | ) |
|
Create an instance of the Generic OnOff 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_ONOFF_SERVER_INSTANCES_MAX. |