469{
471 uint16_t el_id =
UT_GET_ARG(0, uint16_t, argv);
472
474
476 el_id, MESHX_ELEMENT_TYPE_LIGHT_CWWW_CLIENT);
477 if (!el) {
480 }
481
486 }
487
488 if (cmd_id == 0x01 || cmd_id == 0x02) {
490 msg.
ack = (uint8_t)(cmd_id == 0x01 ? 1 : 0);
492 msg.
on_off = ctx.gen_on_off_state.next_on_off;
495
499 }
500 else if (cmd_id == 0x04 || cmd_id == 0x05) {
503 msg.
ack = (cmd_id == 0x04);
506
510
514 }
515 else if (cmd_id == 0x06 || cmd_id == 0x07) {
518 msg.
ack = (cmd_id == 0x06);
523 msg.
delta_uv = ctx.light_ctl_state.delta_uv;
524
528 }
529 else if (cmd_id == 0x08 || cmd_id == 0x09) {
532 msg.
ack = (cmd_id == 0x08);
536 msg.
lightness = ctx.light_ctl_state.lightness;
537 msg.
delta_uv = ctx.light_ctl_state.delta_uv;
538
542 }
543 else if (cmd_id == 0x0A || cmd_id == 0x0B) {
546 msg.
ack = (cmd_id == 0x0A);
550 msg.
lightness = ctx.light_ctl_state.lightness;
552
556 }
558}
#define MESHX_GEN_ON_OFF_CLI_MSG_SET
Definition ble_mesh/elements/inc/meshx_relay_msg_defs.h:26
struct meshx_gen_on_off_cli_msg meshx_gen_on_off_cli_msg_t
Standard Relay Client Message structure (shared between C element and C++ model).
Definition meshx_cwww_element.hpp:139
meshx_cwww_cli_el_ctx_t & get_ctx()
Definition meshx_cwww_element.hpp:184
T * find_and_cast(uint16_t element_idx, meshx_element_type_t expected_variant)
Find and cast an element instance.
Definition meshx_element_registry.hpp:84
static meshXElementRegistry & get_instance()
Definition meshx_element_registry.hpp:33
#define MESHX_ADDR_UNASSIGNED
Definition meshx_ble_mesh_cmn_def.h:30
CONTROL_TASK_MSG_EVT_TO_BLE_SET_CTL
Definition meshx_control_task.h:110
@ CONTROL_TASK_MSG_CODE_TO_BLE
Definition meshx_control_task.h:67
CONTROL_TASK_MSG_EVT_TO_BLE_SET_ON_OFF
Definition meshx_control_task.h:109
meshx_err_t control_task_msg_publish(control_task_msg_code_t msg_code, control_task_msg_evt_t msg_evt, const void *msg_evt_params, size_t sizeof_msg_evt_params)
Publish a control task message.
Definition meshx_control_task.c:84
struct meshx_light_ctl_cli_msg meshx_light_ctl_cli_msg_t
@ MESHX_INVALID_ARG
Definition meshx_err.h:46
@ MESHX_FAIL
Definition meshx_err.h:45
@ MESHX_NOT_FOUND
Definition meshx_err.h:50
#define MESHX_LOGW(module_id, format,...)
Definition meshx_log.h:120
#define MESHX_LOGI(module_id, format,...)
Definition meshx_log.h:126
#define MESHX_LOGE(module_id, format,...)
Definition meshx_log.h:114
uint8_t set_get
Definition ble_mesh/elements/inc/meshx_relay_msg_defs.h:21
uint16_t element_id
Definition ble_mesh/elements/inc/meshx_relay_msg_defs.h:23
uint8_t reserved
Definition ble_mesh/elements/inc/meshx_relay_msg_defs.h:22
uint8_t on_off
Definition ble_mesh/elements/inc/variants/meshx_relay_msg_defs.h:22
uint8_t ack
Definition ble_mesh/elements/inc/meshx_relay_msg_defs.h:20
uint16_t temperature
Definition meshx_cwww_element.cpp:49
uint16_t lightness
Definition meshx_cwww_element.cpp:48
int16_t delta_uv
Definition meshx_cwww_element.cpp:50
bool ack
Definition meshx_cwww_element.cpp:46
uint8_t set_get
Definition meshx_cwww_element.cpp:47
uint16_t element_id
Definition meshx_cwww_element.cpp:45
#define UT_GET_ARG(_x, _type, _argv)
Macro to extract an argument from the argument list.
Definition unit_test.h:31