19#ifndef _MESHX_MODEL_HSL_HPP_
20#define _MESHX_MODEL_HSL_HPP_
25#define MESHX_LIGHT_HSL_CLIENT_MODEL_TEMPLATE_PROTO
26#define MESHX_LIGHT_HSL_CLIENT_MODEL_TEMPLATE_PARAMS
28#define MESHX_LIGHT_HSL_SERVER_MODEL_TEMPLATE_PROTO
29#define MESHX_LIGHT_HSL_SERVER_MODEL_TEMPLATE_PARAMS
63#if CONFIG_ENABLE_LIGHT_HSL_CLIENT
68struct meshx_light_hsl_cli_el_msg
74using meshx_light_hsl_cli_el_msg_t =
struct meshx_light_hsl_cli_el_msg;
87 :
public meshXClientModel<meshXBaseLightClientModel, meshx_light_hsl_send_params_t>
103 meshx_err_t request_hsl (uint16_t lightness, uint16_t hue, uint16_t saturation, uint8_t tid);
105 meshXLightHSLClientModel(
106 meshXElementIF *parent_element =
nullptr,
108 uint16_t model_func_id = 0
110 ~meshXLightHSLClientModel() =
default;
127#if CONFIG_ENABLE_LIGHT_HSL_SERVER
140 :
public meshXServerModel<meshXBaseLightServerModel, meshx_light_hsl_send_params_t>
Base class for all client models in the mesh network.
Definition meshx_model_class.hpp:429
Interface class for MeshX elements.
Definition meshx_fwd_decl.hpp:82
meshx_err_t model_from_ble_cb(dev_struct_t *, control_task_msg_evt_t, meshx_ptr_t) override
This function is the callback for the Light HSL Server model.
Definition meshx_model_hsl.cpp:427
meshx_light_hsl_model_state_t model_state
Definition meshx_model_hsl.hpp:144
bool element_msg_prepared
Definition meshx_model_hsl.hpp:146
meshx_light_hsl_srv_el_msg_t element_msg
Definition meshx_model_hsl.hpp:145
meshx_err_t model_send(meshx_light_hsl_send_params_t *params) override
Send a packet to the MeshX stack based on the given parameters.
Definition meshx_model_hsl.cpp:387
meshx_err_t plat_model_delete(void) override
Deletes the Light HSL Server model and its associated resources.
Definition meshx_model_hsl.cpp:356
meshx_err_t request_status(uint16_t dst_addr=0)
Definition meshx_model_hsl.cpp:619
meshx_err_t element_state_change_handle(void) override
Handle state change request from element.
Definition meshx_model_hsl.cpp:573
meshx_err_t prepare_element_msg(meshx_ptr_t *msg_ptr, size_t *msg_size) override
Handle state change request from element.
Definition meshx_model_hsl.cpp:553
meshx_err_t plat_model_create(MESHX_MODEL *p_plat_model_ptr=nullptr) override
Creates and initializes a server model instance.
Definition meshx_model_hsl.cpp:319
~meshXLightHSLServerModel()=default
meshXLightHSLServerModel(meshXElementIF *parent_element=nullptr, meshx_ptr_t parent_element_state=nullptr, uint16_t model_func_id=0)
Constructor for Light HSL Server Model.
Definition meshx_model_hsl.cpp:607
meshXElementIF * parent_element
Definition meshx_model_class.hpp:42
virtual meshx_err_t element_state_change_handle(void)=0
Handle state change request from element.
virtual meshx_err_t model_from_ble_cb(dev_struct_t *dev, control_task_msg_evt_t evt, meshx_ptr_t data)=0
uint16_t model_func_id
Definition meshx_model_class.hpp:181
virtual meshx_err_t model_send(meshx_send_packet_params_t *params)=0
meshXServerModel(MESHX_MODEL *p_plat_model, uint32_t model_id, meshXElementIF *parent_element=nullptr, meshx_ptr_t parent_element_state=nullptr, uint16_t model_func_id=0)
Definition meshx_model_class.cpp:200
Header file for MeshX Light Client model declarations.
struct meshx_model meshx_model_t
struct meshx_ctx meshx_ctx_t
Structure to hold context information for BLE Mesh operations.
void * meshx_ptr_t
Definition meshx_ble_mesh_cmn_def.h:636
struct meshx_gen_light_cli_cb_param meshx_gen_light_cli_cb_param_t
Callback parameters for Generic Light Client Model events. This structure is used to pass information...
struct dev_struct dev_struct_t
Structure representing the device composition and elements.
uint32_t control_task_msg_evt_t
Type definition for control task message event.
Definition meshx_control_task.h:81
meshx_err_t
MeshX Error Codes.
Definition meshx_err.h:43
Template declarations for MeshX model wrapper classes.
struct meshx_cli_model_send_param_header meshx_cli_model_send_param_header_t
Definition meshx_model_class.hpp:417
struct meshx_srv_model_send_param_header meshx_srv_model_send_param_header_t
Definition meshx_model_class.hpp:354
struct meshx_light_hsl_model_state meshx_light_hsl_model_state_t
Definition meshx_model_hsl.hpp:48
#define MESHX_LIGHT_HSL_SERVER_MODEL_TEMPLATE_PARAMS
Definition meshx_model_hsl.hpp:29
struct meshx_light_hsl_srv_el_msg meshx_light_hsl_srv_el_msg_t
Definition meshx_model_hsl.hpp:125
struct meshx_light_hsl_send_params meshx_light_hsl_send_params_t
Definition meshx_model_hsl.hpp:61
#define MESHX_LIGHT_HSL_SERVER_MODEL_TEMPLATE_PROTO
Definition meshx_model_hsl.hpp:28
#define MESHX_LIGHT_HSL_CLIENT_MODEL_TEMPLATE_PROTO
Definition meshx_model_hsl.hpp:25
#define MESHX_LIGHT_HSL_CLIENT_MODEL_TEMPLATE_PARAMS
Definition meshx_model_hsl.hpp:26
uint8_t state
Definition meshx_serial.c:39
Structure to hold the Light HSL model state.
Definition meshx_model_hsl.hpp:35
uint16_t target_saturation
Definition meshx_model_hsl.hpp:41
uint16_t target_lightness
Definition meshx_model_hsl.hpp:39
uint16_t sat_range_min
Definition meshx_model_hsl.hpp:44
uint16_t saturation
Definition meshx_model_hsl.hpp:38
uint16_t target_hue
Definition meshx_model_hsl.hpp:40
uint16_t hue
Definition meshx_model_hsl.hpp:37
uint16_t hue_range_max
Definition meshx_model_hsl.hpp:43
uint16_t lightness
Definition meshx_model_hsl.hpp:36
uint16_t sat_range_max
Definition meshx_model_hsl.hpp:45
uint16_t hue_range_min
Definition meshx_model_hsl.hpp:42
Structure to hold the parameters for sending a Light HSL message.
Definition meshx_model_hsl.hpp:54
meshx_ctx_t * ctx
Definition meshx_model_hsl.hpp:56
meshx_model_t * model
Definition meshx_model_hsl.hpp:55
uint8_t tid
Definition meshx_model_hsl.hpp:57
meshx_light_hsl_model_state_t state
Definition meshx_model_hsl.hpp:58
Structure to hold the Light HSL Server to element message.
Definition meshx_model_hsl.hpp:120
meshx_light_hsl_model_state_t state
Definition meshx_model_hsl.hpp:122
meshx_srv_model_send_param_header_t header
Definition meshx_model_hsl.hpp:121