MeshX 0.4
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.
Loading...
Searching...
No Matches
meshx_ble_mesh_light_cli.h File Reference

Header file for BLE Mesh Light Client functionality in the MeshX framework. This file contains declarations and includes required for implementing BLE Mesh Light Client operations. More...

Go to the source code of this file.

Data Structures

struct  meshx_light_lightness_set_t
 Bluetooth Mesh Light Lightness Client Model Get and Set parameters structure. More...
struct  meshx_light_lightness_linear_set_t
struct  meshx_light_lightness_default_set_t
struct  meshx_light_lightness_range_set_t
struct  meshx_light_ctl_set_t
struct  meshx_light_ctl_temperature_set_t
struct  meshx_light_ctl_temperature_range_set_t
struct  meshx_light_ctl_default_set_t
struct  meshx_light_hsl_set_t
struct  meshx_light_hsl_hue_set_t
struct  meshx_light_hsl_saturation_set_t
struct  meshx_light_hsl_default_set_t
struct  meshx_light_hsl_range_set_t
struct  meshx_light_xyl_set_t
struct  meshx_light_xyl_default_set_t
struct  meshx_light_xyl_range_set_t
struct  meshx_light_lc_mode_set_t
struct  meshx_light_lc_om_set_t
struct  meshx_light_lc_light_onoff_set_t
struct  meshx_light_lc_property_get_t
struct  meshx_light_lc_property_set_t
union  meshx_light_client_get_state_t
 Lighting Client Model get message union. More...
union  meshx_light_client_set_state_t
 Lighting Client Model set message union. More...
struct  meshx_light_lightness_status_cb_t
 Bluetooth Mesh Light Lightness Client Model Get and Set callback parameters structure. More...
struct  meshx_light_lightness_linear_status_cb_t
struct  meshx_light_lightness_last_status_cb_t
struct  meshx_light_lightness_default_status_cb_t
struct  meshx_light_lightness_range_status_cb_t
struct  meshx_light_ctl_status_cb_t
struct  meshx_light_ctl_temperature_status_cb_t
struct  meshx_light_ctl_temperature_range_status_cb_t
struct  meshx_light_ctl_default_status_cb_t
struct  meshx_light_hsl_status_cb_t
struct  meshx_light_hsl_target_status_cb_t
struct  meshx_light_hsl_hue_status_cb_t
struct  meshx_light_hsl_saturation_status_cb_t
struct  meshx_light_hsl_default_status_cb_t
struct  meshx_light_hsl_range_status_cb_t
struct  meshx_light_xyl_status_cb_t
struct  meshx_light_xyl_target_status_cb_t
struct  meshx_light_xyl_default_status_cb_t
struct  meshx_light_xyl_range_status_cb_t
struct  meshx_light_lc_mode_status_cb_t
struct  meshx_light_lc_om_status_cb_t
struct  meshx_light_lc_light_onoff_status_cb_t
struct  meshx_light_lc_property_status_cb_t
union  meshx_gen_light_client_status_cb_t
struct  meshx_gen_light_cli_cb_param
 Callback parameters for Generic Light Client Model events. This structure is used to pass information about the received messages and their context to the application. It includes the context, model pointer, event type, and status values. The status values are encapsulated in a union to handle different types of status messages that the Generic Light Client Model can receive. Each status type corresponds to a specific operation code (opcode) defined in the BLE Mesh specification, allowing the application to handle them appropriately. More...
struct  meshx_gen_light_client_send_params
 Generic Light Client Model send parameters. More...

Typedefs

typedef control_task_msg_handle_t meshx_gen_light_client_cb_t
typedef 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 about the received messages and their context to the application. It includes the context, model pointer, event type, and status values. The status values are encapsulated in a union to handle different types of status messages that the Generic Light Client Model can receive. Each status type corresponds to a specific operation code (opcode) defined in the BLE Mesh specification, allowing the application to handle them appropriately.
typedef struct meshx_gen_light_client_send_params meshx_gen_light_client_send_params_t
 Generic Light Client Model send parameters.

Enumerations

enum  meshx_gen_light_cli_evt_t {
  MESHX_GEN_LIGHT_CLI_EVT_GET = (1UL << (0)) ,
  MESHX_GEN_LIGHT_CLI_EVT_SET = (1UL << (1)) ,
  MESHX_GEN_LIGHT_CLI_PUBLISH = (1UL << (2)) ,
  MESHX_GEN_LIGHT_CLI_TIMEOUT = (1UL << (3)) ,
  MESHX_GEN_LIGHT_CLI_EVT_ALL
}

Functions

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.

Detailed Description

Header file for BLE Mesh Light Client functionality in the MeshX framework. This file contains declarations and includes required for implementing BLE Mesh Light Client operations.

Copyright (c) 2024 - 2025 MeshX

Author
Pranjal Chanda

Typedef Documentation

◆ meshx_gen_light_cli_cb_param_t

Callback parameters for Generic Light Client Model events. This structure is used to pass information about the received messages and their context to the application. It includes the context, model pointer, event type, and status values. The status values are encapsulated in a union to handle different types of status messages that the Generic Light Client Model can receive. Each status type corresponds to a specific operation code (opcode) defined in the BLE Mesh specification, allowing the application to handle them appropriately.

◆ meshx_gen_light_client_cb_t

◆ meshx_gen_light_client_send_params_t

Generic Light Client Model send parameters.

Enumeration Type Documentation

◆ meshx_gen_light_cli_evt_t

Enumerator
MESHX_GEN_LIGHT_CLI_EVT_GET (1UL << (0)) 
MESHX_GEN_LIGHT_CLI_EVT_SET (1UL << (1)) 
MESHX_GEN_LIGHT_CLI_PUBLISH (1UL << (2)) 
MESHX_GEN_LIGHT_CLI_TIMEOUT (1UL << (3)) 
MESHX_GEN_LIGHT_CLI_EVT_ALL ( MESHX_GEN_LIGHT_CLI_EVT_GET | MESHX_GEN_LIGHT_CLI_EVT_SET | MESHX_GEN_LIGHT_CLI_PUBLISH | MESHX_GEN_LIGHT_CLI_TIMEOUT) 
21{
#define MESHX_BIT(nr)
Definition meshx_ble_mesh_cmn_def.h:22
meshx_gen_light_cli_evt_t
Definition meshx_ble_mesh_light_cli.h:21
@ MESHX_GEN_LIGHT_CLI_PUBLISH
Definition meshx_ble_mesh_light_cli.h:24
@ MESHX_GEN_LIGHT_CLI_EVT_ALL
Definition meshx_ble_mesh_light_cli.h:26
@ MESHX_GEN_LIGHT_CLI_EVT_GET
Definition meshx_ble_mesh_light_cli.h:22
@ MESHX_GEN_LIGHT_CLI_EVT_SET
Definition meshx_ble_mesh_light_cli.h:23
@ MESHX_GEN_LIGHT_CLI_TIMEOUT
Definition meshx_ble_mesh_light_cli.h:25

Function Documentation

◆ meshx_plat_gen_light_client_init()

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.

Returns
meshx_err_t Returns MESHX_SUCCESS on successful initialization, or an appropriate error code on failure.

◆ meshx_plat_light_client_delete()

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.

Parameters
[in]p_pubPointer to the publication context to be deleted.
[in]p_cliPointer to the client instance to be deleted.
Returns
meshx_err_t Returns an error code indicating the result of the delete operation.

◆ meshx_plat_light_client_send_msg()

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.

Parameters
[in]p_modelPointer to the BLE Mesh model instance.
[in]p_setPointer to the structure containing the light client set state parameters.
[in]opcodeOpcode of the message to be sent.
[in]addrDestination address for the message.
[in]net_idxNetwork index to be used for sending the message.
[in]app_idxApplication index to be used for sending the message.
[in]is_get_opcodeIndicates whether the opcode is a GET type (true) or SET type (false).
Returns
meshx_err_t Result of the message send operation.

◆ meshx_plat_light_ctl_client_create()

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.

Parameters
[in]p_modelPointer to the mesh model structure to associate with the Light CTL client.
[out]p_pubPointer to a publication context pointer to be initialized (can be NULL if not used).
[out]p_light_ctl_cliPointer to a Light CTL client context pointer to be initialized.
Returns
meshx_err_t Returns MESHX_OK on success, or an appropriate error code on failure.