MeshX 0.3
This repository provides an implementation for Bluetooth Low Energy (BLE) Mesh network nodes. The project allows you to create BLE mesh nodes that can communicate with each other, enabling the development of smart home solutions or other IoT-based applications.
|
Header file for the Light CTL (Color Temperature Light) Client model. More...
Go to the source code of this file.
Data Structures | |
struct | meshx_ctl_el_state |
Structure to hold arguments for sending Light CTL messages. More... | |
struct | meshx_ctl_cli_el_msg |
Structure to hold the On/Off Server to element message. More... | |
struct | meshx_gen_ctl_send_params |
Structure to hold the parameters for sending a Generic Ctl message. More... | |
Macros | |
#define | MESHX_LIGHT_CTL_CLI_MSG_SET 0 |
#define | MESHX_LIGHT_CTL_CLI_MSG_GET 1 |
#define | MESHX_LIGHT_CTL_CLI_MSG_ACK 1 |
#define | MESHX_LIGHT_CTL_CLI_MSG_NO_ACK 0 |
Typedefs | |
typedef struct meshx_ctl_el_state | meshx_ctl_el_state_t |
Structure to hold arguments for sending Light CTL messages. | |
typedef struct meshx_ctl_cli_el_msg | meshx_ctl_cli_el_msg_t |
Structure to hold the On/Off Server to element message. | |
typedef meshx_model_interface_t | meshx_light_ctl_client_model_t |
Structure representing the Light CTL (Color Temperature Lightness) client model in MeshX. | |
typedef struct meshx_gen_ctl_send_params | meshx_gen_ctl_send_params_t |
Structure to hold the parameters for sending a Generic Ctl message. | |
Functions | |
meshx_err_t | meshx_light_ctl_client_init () |
Initialize the Light CTL Client model. | |
meshx_err_t | meshx_light_ctl_client_create (meshx_light_ctl_client_model_t **p_model, void *p_sig_model) |
Creates and initializes a Generic Light Client model instance. | |
meshx_err_t | meshx_light_ctl_client_delete (meshx_light_ctl_client_model_t **p_model) |
Delete the Light client model instance. | |
meshx_err_t | meshx_light_ctl_client_send_msg (meshx_gen_ctl_send_params_t *params) |
Sends a Light CTL (Color Temperature Lightness) message from the Light CTL Client model. | |
meshx_err_t | meshx_light_ctl_temperature_client_send_msg (meshx_gen_ctl_send_params_t *params) |
Sends a Light CTL Temperature message from the client model. | |
meshx_err_t | meshx_light_ctl_temp_range_client_send_msg (meshx_gen_ctl_send_params_t *params) |
Sends a Light CTL Temperature Range message from the client model. | |
meshx_err_t | meshx_light_ctl_state_change_handle (const meshx_ctl_cli_el_msg_t *param, meshx_ctl_el_state_t *p_ctl_prev_state, const meshx_ctl_el_state_t *p_ctl_next_state) |
Handles state changes for the Light CTL client element. | |
Header file for the Light CTL (Color Temperature Light) Client model.
Copyright © 2024 - 2025 MeshX
This file contains the definitions and function declarations for the Light CTL Client model used in ESP32 BLE Mesh applications. The Light CTL Client model is responsible for sending messages to control the color temperature and lightness of a light.
The file includes necessary BLE Mesh headers and defines the event types, callback function types, and structures used for registering and handling Light CTL Client events.
Definition in file meshx_light_ctl_client.h.
#define MESHX_LIGHT_CTL_CLI_MSG_ACK 1 |
Definition at line 28 of file meshx_light_ctl_client.h.
#define MESHX_LIGHT_CTL_CLI_MSG_GET 1 |
Definition at line 27 of file meshx_light_ctl_client.h.
#define MESHX_LIGHT_CTL_CLI_MSG_NO_ACK 0 |
Definition at line 29 of file meshx_light_ctl_client.h.
#define MESHX_LIGHT_CTL_CLI_MSG_SET 0 |
Definition at line 26 of file meshx_light_ctl_client.h.
typedef struct meshx_ctl_cli_el_msg meshx_ctl_cli_el_msg_t |
Structure to hold the On/Off Server to element message.
typedef struct meshx_ctl_el_state meshx_ctl_el_state_t |
Structure to hold arguments for sending Light CTL messages.
typedef struct meshx_gen_ctl_send_params meshx_gen_ctl_send_params_t |
Structure to hold the parameters for sending a Generic Ctl message.
Structure representing the Light CTL (Color Temperature Lightness) client model in MeshX.
This structure holds pointers to the SIG model, publication structures, and generic structures associated with the Light CTL client functionality.
Definition at line 63 of file meshx_light_ctl_client.h.
meshx_err_t meshx_light_ctl_client_create | ( | meshx_light_ctl_client_model_t ** | p_model, |
void * | p_sig_model ) |
Creates and initializes a Generic Light Client model instance.
This function allocates and sets up a Generic Light Client model, associating it with the provided SIG model context.
[out] | p_model | Pointer to a pointer where the created model instance will be stored. |
[in] | p_sig_model | Pointer to the SIG model context to associate with the client model. |
Definition at line 157 of file meshx_light_ctl_client.c.
meshx_err_t meshx_light_ctl_client_delete | ( | meshx_light_ctl_client_model_t ** | p_model | ) |
Delete the Light client model instance.
This function deletes an instance of the Light client model, freeing associated resources and setting the model pointer to NULL.
[in,out] | p_model | Double pointer to the Light client model instance to be deleted. |
Definition at line 188 of file meshx_light_ctl_client.c.
meshx_err_t meshx_light_ctl_client_init | ( | ) |
Initialize the Light CTL Client model.
This function initializes the Light CTL Client model, setting up necessary resources and configurations.
This function initializes the Light CTL Client model by registering the Light Client callback with the BLE Mesh stack.
Definition at line 117 of file meshx_light_ctl_client.c.
meshx_err_t meshx_light_ctl_client_send_msg | ( | meshx_gen_ctl_send_params_t * | params | ) |
Sends a Light CTL (Color Temperature Lightness) message from the Light CTL Client model.
This function constructs and sends a Light CTL message to a specified destination address using the provided network and application indices. The message contains the desired lightness, temperature, and a transaction identifier (TID).
[in] | params | Pointer to a structure containing the message parameters. |
Definition at line 217 of file meshx_light_ctl_client.c.
meshx_err_t meshx_light_ctl_state_change_handle | ( | const meshx_ctl_cli_el_msg_t * | param, |
meshx_ctl_el_state_t * | p_ctl_prev_state, | ||
const meshx_ctl_el_state_t * | p_ctl_next_state ) |
Handles state changes for the Light CTL client element.
This function processes state change events for the Light CTL client element.
[in] | param | Pointer to the message structure containing the state change parameters. |
[in,out] | p_ctl_prev_state | Pointer to the previous state structure. |
[in,out] | p_ctl_next_state | Pointer to the next state structure (currently unused). |
Definition at line 357 of file meshx_light_ctl_client.c.
meshx_err_t meshx_light_ctl_temp_range_client_send_msg | ( | meshx_gen_ctl_send_params_t * | params | ) |
Sends a Light CTL Temperature Range message from the client model.
This function constructs and sends a Light CTL Temperature Range message to a specified address using the provided network and application indices. It allows the client to set or get the temperature range of a lighting element in a mesh network.
[in] | params | Pointer to a structure containing the message parameters. |
Definition at line 312 of file meshx_light_ctl_client.c.
meshx_err_t meshx_light_ctl_temperature_client_send_msg | ( | meshx_gen_ctl_send_params_t * | params | ) |
Sends a Light CTL Temperature message from the client model.
This function constructs and sends a Light CTL Temperature message to a specified address using the provided network and application indices. It allows the client to control the color temperature and delta UV of a lighting element in a mesh network.
[in] | params | Pointer to a structure containing the message parameters. |
Definition at line 264 of file meshx_light_ctl_client.c.