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 Server module. More...
#include "meshx_common.h"
#include "meshx_light_server.h"
#include "meshx_control_task.h"
#include "interface/ble_mesh/meshx_ble_mesh_cmn.h"
Go to the source code of this file.
Typedefs | |
typedef meshx_model_interface_t | meshx_ctl_setup_server_model_t |
Structure representing the MeshX CTL (Color Temperature Lightness) Setup Server Model. | |
typedef meshx_model_interface_t | meshx_ctl_server_model_t |
Structure representing the MeshX CTL (Color Temperature Lightness) server model. | |
Functions | |
meshx_err_t | meshx_light_ctl_server_create (meshx_ctl_server_model_t **p_model, meshx_ptr_t p_sig_model) |
Create and initialize a new CTL server model instance. | |
meshx_err_t | meshx_light_ctl_server_delete (meshx_ctl_server_model_t **p_model) |
Delete the CTL server model instance. | |
meshx_err_t | meshx_light_ctl_srv_state_restore (meshx_ctl_server_model_t *p_model, meshx_light_ctl_srv_state_t ctl_state) |
Restore the CTL state for the generic server model. | |
meshx_err_t | meshx_light_ctl_server_init (void) |
Initialize the CTL server model. | |
meshx_err_t | meshx_get_ctl_setup_srv_model (meshx_ptr_t p_model) |
Retrieves the CTL (Color Temperature Lightness) Setup Server model instance. | |
meshx_err_t | meshx_light_ctl_srv_status_send (meshx_model_t *p_model, meshx_ctx_t *ctx, int16_t delta_uv, uint16_t lightness, uint16_t temperature) |
Send the Light CTL status message. | |
meshx_err_t | meshx_light_ctl_srv_send_pack_create (meshx_ptr_t p_model, uint16_t element_id, uint16_t net_idx, uint16_t app_idx, uint16_t pub_addr, meshx_light_ctl_srv_state_t ctl_state, meshx_lighting_server_cb_param_t *light_srv_send) |
Create a Light CTL Server send message packet. | |
Header file for the Light CTL Server module.
Copyright © 2024 - 2025 MeshX
This file contains the function declarations and necessary includes for initializing and managing the Light CTL Server in the BLE mesh network.
Definition in file meshx_light_ctl_srv.h.
Structure representing the MeshX CTL (Color Temperature Lightness) server model.
This structure encapsulates pointers to the CTL server SIG model, publication structures, and generic server structures used in the MeshX lighting control server implementation.
Definition at line 37 of file meshx_light_ctl_srv.h.
Structure representing the MeshX CTL (Color Temperature Lightness) Setup Server Model.
This structure encapsulates pointers to the SIG model, publication structures, and generic server structures required for the CTL setup server functionality.
Definition at line 29 of file meshx_light_ctl_srv.h.
meshx_err_t meshx_get_ctl_setup_srv_model | ( | meshx_ptr_t | p_model | ) |
Retrieves the CTL (Color Temperature Lightness) Setup Server model instance.
This function is used to obtain a reference or handle to the CTL Setup Server model, which is responsible for managing color temperature and lightness control in a mesh network.
[in] | p_model | Pointer to the model structure or context. |
Definition at line 289 of file meshx_light_ctl_srv.c.
meshx_err_t meshx_light_ctl_server_create | ( | meshx_ctl_server_model_t ** | p_model, |
meshx_ptr_t | p_sig_model ) |
Create and initialize a new CTL server model instance.
This function allocates memory for a new CTL server model and initializes it using the platform-specific creation function. It ensures that the model is properly set up for handling Generic OnOff messages in a BLE Mesh network.
[in,out] | p_model | Pointer to a pointer where the newly created CTL server model instance will be stored. |
[in,out] | p_sig_model | Pointer to a pointer where the offset of the model will be stored. |
Definition at line 357 of file meshx_light_ctl_srv.c.
meshx_err_t meshx_light_ctl_server_delete | ( | meshx_ctl_server_model_t ** | p_model | ) |
Delete the CTL server model instance.
This function deletes an instance of the CTL server model, freeing associated resources and setting the model pointer to NULL.
[in,out] | p_model | Double pointer to the CTL server model instance to be deleted. |
Definition at line 420 of file meshx_light_ctl_srv.c.
meshx_err_t meshx_light_ctl_server_init | ( | void | ) |
Initialize the CTL server model.
This function initializes the CTL server model for the BLE mesh node.
Initialize the CTL server model.
This function initializes the Light CTL (Color Temperature Light) Server model for the BLE Mesh Node. It sets up the necessary configurations and state for the Light CTL Server to operate correctly.
Definition at line 311 of file meshx_light_ctl_srv.c.
meshx_err_t meshx_light_ctl_srv_send_pack_create | ( | meshx_ptr_t | p_model, |
uint16_t | element_id, | ||
uint16_t | net_idx, | ||
uint16_t | app_idx, | ||
uint16_t | pub_addr, | ||
meshx_light_ctl_srv_state_t | ctl_state, | ||
meshx_lighting_server_cb_param_t * | light_srv_send ) |
Create a Light CTL Server send message packet.
This function creates a Light CTL Server send message packet with the provided parameters.
[in] | p_model | Pointer to the MeshX model structure. |
[in] | element_id | Element ID associated with the model. |
[in] | net_idx | Network Index for the message. |
[in] | app_idx | Application Index for the message. |
[in] | pub_addr | Publication address for the message. |
[in] | ctl_state | Current state of the Light CTL Server. |
[out] | light_srv_send | Pointer to the structure where the created message packet will be stored. |
Definition at line 536 of file meshx_light_ctl_srv.c.
meshx_err_t meshx_light_ctl_srv_state_restore | ( | meshx_ctl_server_model_t * | p_model, |
meshx_light_ctl_srv_state_t | ctl_state ) |
Restore the CTL state for the generic server model.
This function restores the CTL state of the specified server model using the provided state value. It checks for a valid model pointer before proceeding with the restoration.
p_model | Pointer to the CTL server model structure. |
ctl_state | The CTL state to be restored. |
Definition at line 459 of file meshx_light_ctl_srv.c.
meshx_err_t meshx_light_ctl_srv_status_send | ( | meshx_model_t * | p_model, |
meshx_ctx_t * | ctx, | ||
int16_t | delta_uv, | ||
uint16_t | lightness, | ||
uint16_t | temperature ) |
Send the Light CTL status message.
This function sends the Light CTL status message to the specified context.
[in] | p_model | Pointer to the MeshX model structure. |
[in] | ctx | Context structure containing the necessary parameters for sending the message. |
[in] | delta_uv | The Delta UV value to be included in the status message. |
[in] | lightness | The Lightness value to be included in the status message. |
[in] | temperature | The Temperature value to be included in the status message. |
Definition at line 486 of file meshx_light_ctl_srv.c.