This model is defined as a top level model in the SDK to enable implementation of the tunable white light.
More...
|
typedef void(* | light_ctl_state_set_cb_t) (const light_ctl_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, const light_ctl_set_params_t *p_in, const model_transition_t *p_in_transition, light_ctl_status_params_t *p_out) |
| Callback type for the Light CTL Set/Set Unacknowledged message. More...
|
|
typedef void(* | light_ctl_state_get_cb_t) (const light_ctl_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, light_ctl_status_params_t *p_out) |
| Callback type for the Light CTL Get message. More...
|
|
typedef void(* | light_ctl_state_temperature32_set_cb_t) (const light_ctl_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, const light_ctl_temperature_set_params_t *p_in, const model_transition_t *p_in_transition, light_ctl_temperature_status_params_t *p_out) |
| Callback type for the Light CTL Temperature Set/Set Unacknowledged message. More...
|
|
typedef void(* | light_ctl_state_temperature32_get_cb_t) (const light_ctl_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, light_ctl_temperature_status_params_t *p_out) |
| Callback type for Light CTL Temperature Get message. More...
|
|
typedef void(* | light_ctl_state_temperature32_range_set_cb_t) (const light_ctl_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, const light_ctl_temperature_range_set_params_t *p_in, light_ctl_temperature_range_status_params_t *p_out) |
| Callback type for the Light CTL Temperature Range Set/Set Unacknowledged message. More...
|
|
typedef void(* | light_ctl_state_temperature32_range_get_cb_t) (const light_ctl_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, light_ctl_temperature_range_status_params_t *p_out) |
| Callback type for the Light CTL Temperature Range Get message. More...
|
|
typedef void(* | light_ctl_state_default_set_cb_t) (const light_ctl_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, const light_ctl_default_set_params_t *p_in, light_ctl_default_status_params_t *p_out) |
| Callback type for the Light CTL Default Set/Set Unacknowledged message. More...
|
|
typedef void(* | light_ctl_state_default_get_cb_t) (const light_ctl_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, light_ctl_default_status_params_t *p_out) |
| Callback type for the Light CTL Default Get message. More...
|
|
typedef void(* | light_ctl_state_move_set_cb_t) (const light_ctl_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, const light_ctl_temperature_move_set_params_t *p_in, const model_transition_t *p_in_transition, light_ctl_temperature_status_params_t *p_out) |
| Callback type for the Light CTL move Set/Set Unacknowledged "message". More...
|
|
typedef void(* | light_ctl_state_delta_set_cb_t) (const light_ctl_setup_server_t *p_self, const access_message_rx_meta_t *p_meta, const light_ctl_temperature_delta_set_params_t *p_in, const model_transition_t *p_in_transition, light_ctl_temperature_status_params_t *p_out) |
| Callback type for the Light CTL delta Set/Set Unacknowledged "message". More...
|
|
This model is defined as a top level model in the SDK to enable implementation of the tunable white light.
This model implements Light CTL Server, Light CTL Temperature Server, and Generic Level Server models. This model requires an instance of Light Lightness Setup Server to be initialized seperately and provided as an input during initialization.
◆ light_ctl_state_set_cb_t
Callback type for the Light CTL Set/Set Unacknowledged message.
- Parameters
-
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[in] | p_in | Pointer to the input parameters for the user application. |
[in] | p_in_transition | Pointer to transition parameters, if present in the incoming message, otherwise set to null. |
[out] | p_out | Pointer to store the output parameters from the user application. If null, indicates that it is UNACKNOWLEDGED message and no output params are required. |
Definition at line 95 of file light_ctl_setup_server.h.
◆ light_ctl_state_get_cb_t
Callback type for the Light CTL Get message.
- Parameters
-
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[out] | p_out | Pointer to store the output parameters from the user application. |
Definition at line 108 of file light_ctl_setup_server.h.
◆ light_ctl_state_temperature32_set_cb_t
Callback type for the Light CTL Temperature Set/Set Unacknowledged message.
- Parameters
-
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[in] | p_in | Pointer to the input parameters for the user application. |
[in] | p_in_transition | Pointer to transition parameters, if present in the incoming message, otherwise set to null. |
[out] | p_out | Pointer to store the output parameters from the user application. If null, indicates that it is UNACKNOWLEDGED message and no output params are required. |
Definition at line 124 of file light_ctl_setup_server.h.
◆ light_ctl_state_temperature32_get_cb_t
Callback type for Light CTL Temperature Get message.
- Parameters
-
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[out] | p_out | Pointer to store the output parameters from the user application. |
Definition at line 137 of file light_ctl_setup_server.h.
◆ light_ctl_state_temperature32_range_set_cb_t
Callback type for the Light CTL Temperature Range Set/Set Unacknowledged message.
- Parameters
-
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[in] | p_in | Pointer to the input parameters for the user application. |
[out] | p_out | Pointer to store the output parameters from the user application. If null, indicates that it is UNACKNOWLEDGED message and no output params are required. |
Definition at line 151 of file light_ctl_setup_server.h.
◆ light_ctl_state_temperature32_range_get_cb_t
Callback type for the Light CTL Temperature Range Get message.
- Parameters
-
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[out] | p_out | Pointer to store the output parameters from the user application. |
Definition at line 163 of file light_ctl_setup_server.h.
◆ light_ctl_state_default_set_cb_t
Callback type for the Light CTL Default Set/Set Unacknowledged message.
- Parameters
-
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[in] | p_in | Pointer to the input parameters for the user application. |
[out] | p_out | Pointer to store the output parameters from the user application. If null, indicates that it is UNACKNOWLEDGED message and no output params are required. |
Definition at line 177 of file light_ctl_setup_server.h.
◆ light_ctl_state_default_get_cb_t
Callback type for the Light CTL Default Get message.
- Parameters
-
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[out] | p_out | Pointer to store the output parameters from the user application. |
Definition at line 189 of file light_ctl_setup_server.h.
◆ light_ctl_state_move_set_cb_t
Callback type for the Light CTL move Set/Set Unacknowledged "message".
This isn't a real message, but CTL converts a level move set to this to allow the app layer to properly handle level move functionality
- Parameters
-
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[in] | p_in | Pointer to the input parameters for the user application. |
[in] | p_in_transition | Pointer to transition parameters, if present in the incoming message, otherwise set to null. |
[out] | p_out | Pointer to store the output parameters from the user application. If null, indicates that it is UNACKNOWLEDGED message and no output params are required. |
Definition at line 209 of file light_ctl_setup_server.h.
◆ light_ctl_state_delta_set_cb_t
Callback type for the Light CTL delta Set/Set Unacknowledged "message".
This isn't a real message, but CTL converts a level delta set to this to allow the app layer to properly handle level delta functionality
- Parameters
-
[in] | p_self | Pointer to the model structure. |
[in] | p_meta | Access metadata for the received message. |
[in] | p_in | Pointer to the input parameters for the user application. |
[in] | p_in_transition | Pointer to transition parameters, if present in the incoming message, otherwise set to null. |
[out] | p_out | Pointer to store the output parameters from the user application. If null, indicates that it is UNACKNOWLEDGED message and no output params are required. |
Definition at line 230 of file light_ctl_setup_server.h.
◆ light_ctl_server_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 is provided as input context. |
NRF_ERROR_NO_MEM | Not enough memory available for message publication. |
NRF_ERROR_NOT_FOUND | Invalid model handle or model not bound to element. |
NRF_ERROR_INVALID_PARAM | Model not bound to appkey, publish address not set or wrong opcode format. |
NRF_ERROR_FORBIDDEN | Failed to allocate a sequence number from network. |
NRF_ERROR_INVALID_STATE | There's already a segmented packet that is being to sent to the publish address (if force segmentation is enabled). Wait for the transmission to finish. |
◆ light_ctl_server_temperature_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 is provided as input context. |
NRF_ERROR_NO_MEM | Not enough memory available for message publication. |
NRF_ERROR_NOT_FOUND | Invalid model handle or model not bound to element. |
NRF_ERROR_INVALID_PARAM | Model not bound to appkey, publish address not set or wrong opcode format. |
NRF_ERROR_FORBIDDEN | Failed to allocate a sequence number from network. |
NRF_ERROR_INVALID_STATE | There's already a segmented packet that is being to sent to the publish address (if force segmentation is enabled). Wait for the transmission to finish. |
◆ light_ctl_server_temperature_range_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 is provided as input context. |
NRF_ERROR_NO_MEM | Not enough memory available for message publication. |
NRF_ERROR_NOT_FOUND | Invalid model handle or model not bound to element. |
NRF_ERROR_INVALID_PARAM | Model not bound to appkey, publish address not set or wrong opcode format. |
NRF_ERROR_FORBIDDEN | Failed to allocate a sequence number from network. |
NRF_ERROR_INVALID_STATE | There's already a segmented packet that is being to sent to the publish address (if force segmentation is enabled). Wait for the transmission to finish. |
◆ light_ctl_server_default_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 is provided as input context. |
NRF_ERROR_NO_MEM | Not enough memory available for message publication. |
NRF_ERROR_NOT_FOUND | Invalid model handle or model not bound to element. |
NRF_ERROR_INVALID_PARAM | Model not bound to appkey, publish address not set or wrong opcode format. |
NRF_ERROR_FORBIDDEN | Failed to allocate a sequence number from network. |
NRF_ERROR_INVALID_STATE | There's already a segmented packet that is being to sent to the publish address (if force segmentation is enabled). Wait for the transmission to finish. |
◆ light_ctl_setup_server_init()
uint32_t light_ctl_setup_server_init |
( |
light_ctl_setup_server_t * |
p_s_server, |
|
|
light_lightness_setup_server_t * |
p_ll_s_server, |
|
|
uint8_t |
element_index |
|
) |
| |
Initializes the Light CTL Setup server.
- Note
- The server handles the model allocation and adding.
- Parameters
-
[in] | p_s_server | Light CTL server context pointer. |
[in] | p_ll_s_server | Light Lightness context pointer. |
[in] | element_index | Element index to add the ctl and ctl setup server models to. |
The light lightness context pointer is used to obtain the model handles for all of the light lightness and extended models for subscription list sharing.
- Note
- This model spans two elements and the API will initialize use secondary element (Temperature element) as next higher element. This helps the third party provisioners to easily identify the Light CTL Setup Server model in its entirety.
- Return values
-
NRF_SUCCESS | If the model is initialized successfully. |
NRF_ERROR_NULL | If NULL pointer is provided as input context. |
NRF_ERROR_NO_MEM | ACCESS_MODEL_COUNT number of models already allocated or no more subscription lists available in memory pool (see ACCESS_SUBSCRIPTION_LIST_COUNT) or no more CTL Setup Server instances can be initialized (see LIGHT_CTL_SETUP_SERVER_INSTANCES_MAX). |
NRF_ERROR_FORBIDDEN | Multiple model instances per element are not allowed or changes to device composition are not allowed. Adding a new model after device is provisioned is not allowed. |
NRF_ERROR_NOT_FOUND | Invalid access element index. |
NRF_ERROR_INVALID_STATE | If module is unable to initialize the storage for CTL states. |
◆ light_ctl_ponoff_binding_setup()
uint32_t light_ctl_ponoff_binding_setup |
( |
light_ctl_setup_server_t * |
p_s_server, |
|
|
light_ctl_saved_values_t * |
p_saved_values |
|
) |
| |
Function to do the OnPowerup binding.
The caller is responsible for reading the saved state values out of flash and pass those so this function can determine what the current lightness should be set to.
- Parameters
-
- Return values
-
NRF_SUCCESS | If binding operation is performed successfully. |
NRF_ERROR_NULL | If NULL pointer is provided as input context. |
NRF_ERROR_INVALID_DATA | If OnPowerUp state value (see generic_on_powerup_values_t) is not within range. |