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.
Loading...
Searching...
No Matches
meshx_light_cwww_client_element.h
Go to the documentation of this file.
1
9
10#ifndef __CWWW_CLIENT_ELEMENT_H__
11#define __CWWW_CLIENT_ELEMENT_H__
12
13#include "meshx_common.h"
14#include "meshx_control_task.h"
15#include "meshx_onoff_client.h"
17
18#if CONFIG_LIGHT_CWWW_CLIENT_COUNT > 0
23#define CWWW_CLI_MODEL_SIG_CNT CWWW_CLI_SIG_ID_MAX // No of SIG models in a cwww model element
24
29#define CWWW_CLI_MODEL_VEN_CNT 0 // No of VEN models in a cwww model element
30
35#define CWWW_CLI_MSG_SET 0
36
41#define CWWW_CLI_MSG_GET 1
42
47#define CWWW_CLI_MSG_ACK 1
48
53#define CWWW_CLI_MSG_NO_ACK 0
54
55#define CWWW_ARG_BMAP_ONOFF_SET MESHX_BIT(0)
56#define CWWW_ARG_BMAP_LIGHTNESS_SET MESHX_BIT(1)
57#define CWWW_ARG_BMAP_TEMPERATURE_SET MESHX_BIT(2)
58#define CWWW_ARG_BMAP_DELTA_UV_SET MESHX_BIT(3)
59#define CWWW_ARG_BMAP_TEMPERATURE_RANGE_SET_MIN MESHX_BIT(4)
60#define CWWW_ARG_BMAP_TEMPERATURE_RANGE_SET_MAX MESHX_BIT(5)
61
66#define CWWW_ARG_BMAP_TEMPERATURE_RANGE_SET (CWWW_ARG_BMAP_TEMPERATURE_RANGE_SET_MIN | CWWW_ARG_BMAP_TEMPERATURE_RANGE_SET_MAX)
67
72#define CWWW_ARG_BMAP_CTL_SET (CWWW_ARG_BMAP_LIGHTNESS_SET | CWWW_ARG_BMAP_TEMPERATURE_SET | CWWW_ARG_BMAP_DELTA_UV_SET)
73
78#define CWWW_ARG_BMAP_ALL (CWWW_ARG_BMAP_ONOFF_SET | CWWW_ARG_BMAP_CTL_SET | CWWW_ARG_BMAP_TEMPERATURE_RANGE_SET)
79
89
93typedef struct cwww_cli_ctx
94{
95 uint8_t tid;
96 meshx_on_off_cli_state_t state;
97 meshx_on_off_cli_state_t prev_state;
100 uint16_t app_id;
101 uint16_t pub_addr;
103
107typedef struct cwww_client_msg
108{
109 uint8_t ack;
110 uint8_t set_get;
111 uint8_t arg_bmap;
112 uint16_t element_id;
113 uint16_t temperature;
114 uint16_t lightness;
115 uint16_t delta_uv;
116 uint16_t temp_range_max;
117 uint16_t temp_range_min;
119
131
142
152meshx_err_t meshx_cwww_el_get_state(uint16_t element_id, cwww_cli_sig_id_t model_id);
153
162meshx_err_t create_cwww_client_elements(dev_struct_t *pdev, uint16_t element_cnt);
163
164#endif /* CONFIG_LIGHT_CWWW_CLIENT_COUNT > 0 */
165#endif /* __CWWW_CLIENT_ELEMENT_H__ */
Common application definitions and includes for BLE Mesh Node.
struct dev_struct dev_struct_t
Structure representing the device composition and elements.
struct meshx_model_interface meshx_model_interface_t
Header file for the control task in the BLE mesh node application.
meshx_err_t
MeshX Error Codes.
Definition meshx_err.h:39
Header file for the Light CTL (Color Temperature Light) Client model.
struct meshx_ctl_el_state meshx_ctl_el_state_t
Structure to hold arguments for sending Light CTL messages.
struct cwww_client_msg meshx_cwww_client_msg_t
Structure to hold the cwww client message sent from APP layer.
struct cwww_client_element_ctrl meshx_cwww_client_elements_ctrl_t
Structure to hold the cwww client elements.
meshx_err_t create_cwww_client_elements(dev_struct_t *pdev, uint16_t element_cnt)
Create Dynamic CW-WW Model Elements.
struct cwww_client_element meshx_cwww_client_elements_t
Structure to hold the cwww client element.
cwww_cli_sig_id_t
Enumeration of CW-WW SIG model IDs.
#define CWWW_CLI_MODEL_SIG_CNT
Number of SIG models in a CW-WW model element.
meshx_err_t meshx_cwww_el_get_state(uint16_t element_id, cwww_cli_sig_id_t model_id)
Retrieves the current state of the CW/WW (Cool White/Warm White) light element for the specified elem...
struct cwww_cli_ctx meshx_cwww_client_model_ctx_t
Structure to hold the context of the cwww client.
Header file for the On/Off client model in BLE mesh.
#define MESHX_MODEL
Structure to hold the context of the cwww client.
meshx_on_off_cli_state_t state
meshx_ctl_el_state_t prev_ctl_state
meshx_ctl_el_state_t ctl_state
meshx_on_off_cli_state_t prev_state
Structure to hold the cwww client elements.
meshx_cwww_client_elements_t * el_list
Structure to hold the cwww client element.
meshx_model_interface_t * ctl_cli_model
meshx_model_interface_t * onoff_cli_model
MESHX_MODEL cwww_cli_sig_model_list[CWWW_CLI_MODEL_SIG_CNT]
meshx_cwww_client_model_ctx_t * cwww_cli_ctx
Structure to hold the cwww client message sent from APP layer.