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 Generic Light Client model for BLE Mesh. This file contains the initialization, resource management, and message handling logic for the Generic Light Client model in the MeshX platform. More...
Go to the source code of this file.
Macros | |
#define | MESHX_CLIENT_INIT_MAGIC_NO 0x3728 |
Functions | |
static void | esp_ble_mesh_light_client_cb (MESHX_GEN_LIGHT_CLI_CB_EVT event, MESHX_GEN_LIGHT_CLI_CB_PARAM *param) |
Callback function for BLE Mesh Light Client events. | |
meshx_err_t | meshx_plat_gen_light_client_init (void) |
Initialize the Generic Light Client Model. This function sets up the necessary parameters and resources for the Generic Light Client Model to operate correctly. | |
meshx_err_t | meshx_plat_light_ctl_client_create (meshx_ptr_t p_model, meshx_ptr_t *p_pub, meshx_ptr_t *p_light_ctl_cli) |
Creates and initializes a Light CTL (Color Temperature Light) client model instance. | |
meshx_err_t | meshx_plat_light_client_delete (meshx_ptr_t *p_pub, meshx_ptr_t *p_cli) |
Deletes the Light client instance and its associated publication context. | |
meshx_err_t | meshx_plat_light_client_send_msg (meshx_ptr_t p_model, meshx_light_client_set_state_t *p_set, uint16_t opcode, uint16_t addr, uint16_t net_idx, uint16_t app_idx, bool is_get_opcode) |
Sends a Light Client message over BLE Mesh. | |
Variables | |
static uint16_t | meshx_client_init = 0 |
static const char * | client_state_str [] |
Mapping of BLE Mesh client state events to string representations. | |
Implementation of the Generic Light Client model for BLE Mesh. This file contains the initialization, resource management, and message handling logic for the Generic Light Client model in the MeshX platform.
Copyright (c) 2024 - 2025 MeshX
The Generic Light Client model is responsible for sending requests and receiving responses related to the light state of devices in a BLE Mesh network. It manages the client instance, publication context, and interacts with the MeshX BLE Mesh stack.
Definition in file esp_gen_light_cli_model.c.
#define MESHX_CLIENT_INIT_MAGIC_NO 0x3728 |
Definition at line 27 of file esp_gen_light_cli_model.c.
|
static |
Callback function for BLE Mesh Light Client events.
This function is invoked to handle events related to the Generic Light Client model in the BLE Mesh stack. It processes various client events and their associated parameters.
event | The event type received by the Light Client. |
param | Pointer to the structure containing event-specific parameters. |
Definition at line 63 of file esp_gen_light_cli_model.c.
meshx_err_t meshx_plat_gen_light_client_init | ( | void | ) |
Initialize the Generic Light Client Model. This function sets up the necessary parameters and resources for the Generic Light Client Model to operate correctly.
Definition at line 114 of file esp_gen_light_cli_model.c.
meshx_err_t meshx_plat_light_client_delete | ( | meshx_ptr_t * | p_pub, |
meshx_ptr_t * | p_cli ) |
Deletes the Light client instance and its associated publication context.
This function is responsible for cleaning up and freeing resources associated with the Light client model, including its publication context.
[in] | p_pub | Pointer to the publication context to be deleted. |
[in] | p_cli | Pointer to the client instance to be deleted. |
Definition at line 168 of file esp_gen_light_cli_model.c.
meshx_err_t meshx_plat_light_client_send_msg | ( | meshx_ptr_t | p_model, |
meshx_light_client_set_state_t * | p_set, | ||
uint16_t | opcode, | ||
uint16_t | addr, | ||
uint16_t | net_idx, | ||
uint16_t | app_idx, | ||
bool | is_get_opcode ) |
Sends a Light Client message over BLE Mesh.
This function constructs and sends a Light Client message using the specified model, set state parameters, opcode, destination address, network index, and application index.
[in] | p_model | Pointer to the BLE Mesh model instance. |
[in] | p_set | Pointer to the structure containing the light client set state parameters. |
[in] | opcode | Opcode of the message to be sent. |
[in] | addr | Destination address for the message. |
[in] | net_idx | Network index to be used for sending the message. |
[in] | app_idx | Application index to be used for sending the message. |
[in] | is_get_opcode | Indicates whether the opcode is a GET type (true) or SET type (false). |
Definition at line 195 of file esp_gen_light_cli_model.c.
meshx_err_t meshx_plat_light_ctl_client_create | ( | meshx_ptr_t | p_model, |
meshx_ptr_t * | p_pub, | ||
meshx_ptr_t * | p_light_ctl_cli ) |
Creates and initializes a Light CTL (Color Temperature Light) client model instance.
This function sets up the Light CTL client model for use in the BLE Mesh network. It associates the client model with the provided model pointer and optionally sets up publication and client context pointers.
[in] | p_model | Pointer to the mesh model structure to associate with the Light CTL client. |
[out] | p_pub | Pointer to a publication context pointer to be initialized (can be NULL if not used). |
[out] | p_light_ctl_cli | Pointer to a Light CTL client context pointer to be initialized. |
Definition at line 144 of file esp_gen_light_cli_model.c.
|
static |
Mapping of BLE Mesh client state events to string representations.
Definition at line 37 of file esp_gen_light_cli_model.c.
|
static |
Definition at line 32 of file esp_gen_light_cli_model.c.