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.
|
Implementation of the Light CTL Client model for ESP32 BLE Mesh. More...
Go to the source code of this file.
Macros | |
#define | LIGHT_CTL_CLIENT_INIT_MAGIC 0x8932 |
Functions | |
static meshx_err_t | meshx_ctl_state_change_notify (const meshx_gen_light_cli_cb_param_t *param, uint8_t status) |
Notifies about a change in the CTL (Color Temperature Lightness) state. | |
static meshx_err_t | meshx_handle_gen_light_msg (const dev_struct_t *pdev, control_task_msg_evt_t model_id, const meshx_gen_light_cli_cb_param_t *param) |
Handles generic light model messages for the Light CTL client. | |
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. | |
Variables | |
static uint16_t | light_ctl_client_init_flag = 0 |
Implementation of the Light CTL Client model for ESP32 BLE Mesh.
Copyright © 2024 - 2025 MeshX
This file contains the implementation of the Light CTL Client model, including initialization, callback registration, and event handling.
Definition in file meshx_light_ctl_client.c.
#define LIGHT_CTL_CLIENT_INIT_MAGIC 0x8932 |
Definition at line 16 of file meshx_light_ctl_client.c.
|
static |
Notifies about a change in the CTL (Color Temperature Lightness) state.
This function is called to notify the application or upper layers when the CTL state of a light device has changed. It provides the relevant parameters describing the new state.
[in] | param | Pointer to a structure containing the CTL state change parameters. |
[in] | status | Status code indicating the result of the notification operation. |
Definition at line 33 of file meshx_light_ctl_client.c.
|
static |
Handles generic light model messages for the Light CTL client.
This function processes incoming messages related to the generic light model and performs the necessary actions based on the message event and parameters.
[in] | pdev | Pointer to the device structure containing device-specific information. |
[in] | model_id | Identifier for the control task message event associated with the model. |
[in,out] | param | Pointer to the callback parameter structure for the generic light client. |
Definition at line 91 of file meshx_light_ctl_client.c.
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 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.
|
static |
Definition at line 20 of file meshx_light_ctl_client.c.