This model extends Light LC server, Light Lightness server, Generic Level server, Generic PowerOnOff Setup server, Generic PowerOnOff server, Generic OnOff server, and Generic Default Transition Time server.
More...
|
typedef void(* | light_lc_persist_state_set_cb_t) (const light_lc_setup_server_t *p_s_server, const light_lc_state_t lc_state, const void *p_set_value) |
| Callback type for storing data to the persistent memory after Set messages affecting the persistent states are received. More...
|
|
typedef void(* | light_lc_persist_state_get_cb_t) (const light_lc_setup_server_t *p_s_server, const light_lc_state_t lc_state, void *p_get_value) |
| Callback type for getting data from the persistent memory after Get messages are received. More...
|
|
typedef void(* | light_lc_actual_set_cb_t) (const light_lc_setup_server_t *p_s_server, uint16_t actual_lightness) |
| Callback type for setting the actual lightness. More...
|
|
typedef void(* | light_lc_actual_get_cb_t) (const light_lc_setup_server_t *p_s_server, uint16_t *p_actual_lightness) |
| Callback type for getting the actual lightness. More...
|
|
This model extends Light LC server, Light Lightness server, Generic Level server, Generic PowerOnOff Setup server, Generic PowerOnOff server, Generic OnOff server, and Generic Default Transition Time server.
Therefore, this model generates events for messages received by its parent model.
◆ light_lc_persist_state_set_cb_t
typedef void(* light_lc_persist_state_set_cb_t) (const light_lc_setup_server_t *p_s_server, const light_lc_state_t lc_state, const void *p_set_value) |
Callback type for storing data to the persistent memory after Set messages affecting the persistent states are received.
Mid app will call the appropriate function to set flash memory.
- Parameters
-
[in] | p_s_server | Pointer to the model structure. |
[in] | lc_state | State to be set into persistent memory |
[in] | set_value | Value to set into persistent memory |
Definition at line 85 of file light_lc_setup_server.h.
◆ light_lc_persist_state_get_cb_t
typedef void(* light_lc_persist_state_get_cb_t) (const light_lc_setup_server_t *p_s_server, const light_lc_state_t lc_state, void *p_get_value) |
Callback type for getting data from the persistent memory after Get messages are received.
Mid app will call the appropriate function to get flash memory
- Parameters
-
[in] | p_s_server | Pointer to the model structure. |
[in] | lc_state | State to be set into persistent memory. |
[out] | p_get_value | Return value from persistent memory |
Definition at line 98 of file light_lc_setup_server.h.
◆ light_lc_actual_set_cb_t
typedef void(* light_lc_actual_set_cb_t) (const light_lc_setup_server_t *p_s_server, uint16_t actual_lightness) |
Callback type for setting the actual lightness.
Mid app will call the top app (main.c) to set the actual lightness.
- Parameters
-
[in] | p_s_server | Pointer to the model structure. |
[in] | actual_lightness | Lightness level to set |
Definition at line 110 of file light_lc_setup_server.h.
◆ light_lc_actual_get_cb_t
typedef void(* light_lc_actual_get_cb_t) (const light_lc_setup_server_t *p_s_server, uint16_t *p_actual_lightness) |
Callback type for getting the actual lightness.
Mid app will call the top app (main.c) to get the actual lightness.
- Parameters
-
[in] | p_s_server | Pointer to the model structure. |
[in] | p_actual_lightness | Lightness level to get. |
Definition at line 121 of file light_lc_setup_server.h.
◆ light_lc_server_mode_status_publish()
Publishes unsolicited Status message.
This API can be used to send unsolicited messages to report updated state value as a result of local action.
- Parameters
-
[in] | p_server | Status server context pointer. |
[in] | p_params | Message parameters. |
- Return values
-
NRF_SUCCESS | If the message is published successfully. |
NRF_ERROR_NULL | If NULL pointer given to function. |
NRF_ERROR_NO_MEM | No memory available to send the message at this point. |
NRF_ERROR_INVALID_LENGTH | Invalid data length(s) supplied. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
◆ light_lc_server_occ_mode_status_publish()
Publishes unsolicited Status message.
This API can be used to send unsolicited messages to report updated state value as a result of local action.
- Parameters
-
[in] | p_server | Status server context pointer. |
[in] | p_params | Message parameters. |
- Return values
-
NRF_SUCCESS | If the message is published successfully. |
NRF_ERROR_NULL | If NULL pointer given to function. |
NRF_ERROR_NO_MEM | No memory available to send the message at this point. |
NRF_ERROR_INVALID_LENGTH | Invalid data length(s) supplied. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
◆ light_lc_server_light_onoff_status_publish()
Publishes unsolicited Status message.
This API can be used to send unsolicited messages to report updated state value as a result of local action.
- Parameters
-
[in] | p_server | Status server context pointer. |
[in] | p_params | Message parameters. |
- Return values
-
NRF_SUCCESS | If the message is published successfully. |
NRF_ERROR_NULL | If NULL pointer given to function. |
NRF_ERROR_NO_MEM | No memory available to send the message at this point. |
NRF_ERROR_INVALID_LENGTH | Invalid data length(s) supplied. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
◆ light_lc_setup_server_init()
uint32_t light_lc_setup_server_init |
( |
light_lc_setup_server_t * |
p_s_server, |
|
|
uint8_t |
element_index |
|
) |
| |
Initializes Light LC Setup server.
- Note
- The server handles the model allocation and adding.
- Parameters
-
[in] | p_s_server | Light LC Setup Server context pointer. |
[in] | element_index | Element index to add the model to. |
- Return values
-
NRF_SUCCESS | If the model is initialized successfully. |
NRF_ERROR_NULL | NULL pointer given to function. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied. |
NRF_ERROR_INVALID_STATE | Invalid state to perform operation. |
NRF_ERROR_NO_MEM | No memory available to send the message at this point. |
NRF_ERROR_FORBIDDEN | Device has been provisioned and changes to model subscription list are not allowed. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
NRF_ERROR_RESOURCES | No more Light LC Setup server instance can be allocated. Increase LIGHT_LC_SETUP_SERVER_INSTANCES_MAX. |
◆ light_lc_setup_server_property_status_publish()
Publishes unsolicited Status message.
This API can be used to send unsolicited messages to report updated state value as a result of local action.
- Parameters
-
[in] | p_s_server | Status server context pointer. |
[in] | p_params | Message parameters. |
- Return values
-
NRF_SUCCESS | If the message is published successfully. |
NRF_ERROR_NULL | NULL pointer given to function. |
NRF_ERROR_NO_MEM | No memory available to send the message at this point. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
NRF_ERROR_INVALID_STATE | Invalid state to perform operation. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |
NRF_ERROR_INVALID_LENGTH | Attempted to send message larger than LIGHT_LC_PROPERTY_BUF_SIZE. |
◆ light_lc_setup_server_ponoff_binding_setup()
uint32_t light_lc_setup_server_ponoff_binding_setup |
( |
light_lc_setup_server_t * |
p_s_server, |
|
|
uint8_t |
onpowerup, |
|
|
bool * |
p_lc_control |
|
) |
| |
Function to do the OnPowerup binding.
This is called by main.c when the mesh is initialized and stable. Note that this function must be called from the same IRQ level that is specified for the mesh stack (see mesh_stack_init() API).
- Parameters
-
[in] | p_s_server | Status server context pointer. |
[in] | onpowerup | Saved value of onpowerup (read from flash) |
[out] | p_lc_control | Returns false if the LC server is not controlling the light, or true if the LC server is controlling the light. |
- Return values
-
NRF_SUCCESS | If the binding is setup successfully. |
NRF_ERROR_NULL | NULL pointer given to function. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied. |
NRF_ERROR_INVALID_STATE | Invalid state to perform operation. |
NRF_ERROR_NO_MEM | No memory available to send the message at this point. |
NRF_ERROR_NOT_FOUND | Access handle invalid. |