19#define MESHX_CLIENT_INIT_MAGIC_NO 0x4309
21#if CONFIG_ENABLE_LIGHT_CLIENT
373 err = reg_cb->
cb(pdev, model_id, param);
425 if (!params || !params->
model || !params->
state)
438 .addr = params->
addr,
439 .model = params->
model,
#define MESHX_MODEL_ID_LIGHT_CTL_CLI
#define MESHX_MODEL_OP_LIGHT_XYL_SET_UNACK
#define MESHX_MODEL_OP_LIGHT_LC_PROPERTY_GET
#define MESHX_MODEL_OP_LIGHT_LC_OM_GET
#define MESHX_MODEL_OP_LIGHT_LIGHTNESS_SET_UNACK
#define MESHX_MODEL_ID_LIGHT_XYL_CLI
#define MESHX_MODEL_ID_LIGHT_LC_CLI
#define MESHX_MODEL_ID_LIGHT_HSL_CLI
#define MESHX_MODEL_OP_LIGHT_LC_LIGHT_ONOFF_SET_UNACK
#define MESHX_MODEL_OP_LIGHT_LC_MODE_SET_UNACK
#define MESHX_MODEL_OP_LIGHT_LC_MODE_GET
#define MESHX_ADDR_UNASSIGNED
#define MESHX_MODEL_OP_LIGHT_HSL_SET_UNACK
#define MESHX_MODEL_OP_LIGHT_HSL_GET
#define MESHX_MODEL_OP_LIGHT_XYL_GET
#define MESHX_ADDR_IS_UNICAST(_addr)
#define MESHX_MODEL_OP_LIGHT_CTL_SET_UNACK
#define MESHX_MODEL_OP_LIGHT_LC_PROPERTY_SET_UNACK
#define MESHX_MODEL_ID_LIGHT_LIGHTNESS_CLI
#define MESHX_MODEL_OP_LIGHT_CTL_GET
#define MESHX_MODEL_OP_LIGHT_LC_OM_SET_UNACK
#define MESHX_MODEL_OP_LIGHT_LC_LIGHT_ONOFF_GET
#define MESHX_MODEL_OP_LIGHT_LIGHTNESS_GET
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.
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...
control_task_msg_handle_t meshx_gen_light_client_cb_t
@ MESHX_GEN_LIGHT_CLI_TIMEOUT
meshx_err_t meshx_plat_gen_light_client_init(void)
Initialize the Generic Light Client Model. This function sets up the necessary parameters and resourc...
struct dev_struct dev_struct_t
Structure representing the device composition and elements.
uint32_t control_task_msg_evt_t
Type definition for control task message event.
meshx_err_t(* control_task_msg_handle_t)(dev_struct_t *pdev, control_task_msg_evt_t evt, void *params)
Function pointer type for control task message handler.
@ CONTROL_TASK_MSG_CODE_FRM_BLE
meshx_err_t control_task_msg_subscribe(control_task_msg_code_t msg_code, control_task_msg_evt_t evt_bmap, control_task_msg_handle_t callback)
Subscribe to a control task message.
meshx_err_t
MeshX Error Codes.
#define MESHX_CLIENT_INIT_MAGIC_NO
meshx_gen_cli_cb_reg_node_t * cli_cb_reg_head
static meshx_err_t meshx_handle_txcm_msg(dev_struct_t *pdev, control_task_msg_evt_t evt, meshx_gen_cli_resend_ctx *param)
Handles a control task message for a generic client model.
static meshx_err_t meshx_gen_client_txcm_fn_model_send(meshx_gen_client_msg_ctx_t *msg_param, size_t msg_param_len)
Transmit callback handler for sending Generic Client model messages.
meshx_err_t meshx_gen_light_send_msg(const meshx_gen_light_client_send_params_t *params)
Send a message using the generic client model.
static struct @222321174163026111123260040104160030310301145143 g_meshx_gen_light_client_ctrl
meshx_err_t meshx_gen_light_client_from_ble_reg_cb(uint16_t model_id, meshx_gen_light_client_cb_t cb)
Registers a callback function for getting Generic Light Client messages from BLE.
static meshx_err_t meshx_is_gen_light_cli_model(uint32_t model_id)
Checks if the given model ID corresponds to a Generic Light Client model.
static meshx_err_t meshx_gen_light_cli_handle_ack(uint16_t src_addr)
Handles ack request for generic light client messages.
struct meshx_gen_light_cli_cb_reg meshx_gen_light_cli_cb_reg_t
struct meshx_gen_light_cli_cb_reg_node meshx_gen_light_cli_cb_reg_node_t
static meshx_err_t meshx_is_gen_light_cli_get_opcode(uint32_t opcode)
Checks if the given model ID corresponds to a Generic Light Client GET opcode.
static meshx_err_t meshx_gen_client_txcm_fn_model_send(meshx_gen_light_client_msg_ctx_t *params, size_t msg_param_len)
Send a message using the generic client model.
static meshx_err_t meshx_handle_txcm_msg(dev_struct_t *pdev, control_task_msg_evt_t evt, meshx_gen_light_cli_resend_ctx *param)
Handles TXCM message for generic light client.
uint16_t meshx_client_init
static meshx_err_t meshx_is_unack_opcode(uint32_t opcode)
Checks if the given opcode corresponds to an unacknowledged (unack) message in the Generic Light Clie...
static meshx_err_t meshx_gen_light_cli_cb_reg_add(meshx_gen_light_cli_cb_reg_t reg)
Adds a new callback registration to the linked list of registered callbacks.
static meshx_err_t meshx_gen_light_cli_handle_resend(uint16_t model_id, const meshx_gen_light_cli_cb_param_t *param)
Handles resend request for generic light client messages.
static meshx_err_t meshx_handle_gen_light_msg(dev_struct_t *pdev, control_task_msg_evt_t model_id, meshx_gen_light_cli_cb_param_t *param)
Handle the Generic Light Client messages.
struct meshx_gen_light_client_msg_ctx meshx_gen_light_client_msg_ctx_t
meshx_err_t meshx_gen_light_cli_init(void)
Initialize the meshxuction generic client.
Implementation of the MeshX generic light client model for BLE mesh nodes. This file contains functio...
struct meshx_gen_light_client_send_params meshx_gen_light_client_send_params_t
Generic Light Client Model send parameters. This structure is used to pass parameters to the Generic ...
#define MESHX_LOGE(module_id, format,...)
#define MESHX_LOGD(module_id, format,...)
MeshX Tx Control Module This header file contains the definitions and function prototypes for the Mes...
meshx_err_t meshx_txcm_request_send(meshx_txcm_sig_t request_type, uint16_t dest_addr, meshx_cptr_t msg_param, uint16_t msg_param_len, meshx_txcm_fn_model_send_t send_fn)
Sends a request to the Tx Control module.
control_task_msg_handle_t meshx_txcm_cb_t
meshx_txcm_sig_t
Enumeration of signal types for the Tx Control Module.
@ MESHX_TXCM_SIG_ENQ_SEND
@ MESHX_TXCM_SIG_DIRECT_SEND
meshx_err_t(* meshx_txcm_fn_model_send_t)(meshx_cptr_t msg_param, size_t msg_param_len)
Function pointer the Model client layer needs to provide for the msg to be sent for both MESHX_TXCM_S...
meshx_err_t meshx_txcm_event_cb_reg(meshx_txcm_cb_t event_cb)
Registers a callback function for handling Tx Control module events.
meshx_gen_light_cli_evt_t evt
Structure containing a node in the linked list of registered callbacks.
struct meshx_gen_light_cli_cb_reg_node * next
meshx_gen_light_cli_cb_reg_t reg
Structure containing the model ID and callback function for generic client model registrations.
meshx_gen_light_client_cb_t cb
Structure containing the model ID and parameter for generic client model message re-sending.
meshx_gen_light_cli_cb_param_t param
Structure containing the message context for generic client model messages.
meshx_light_client_set_state_t state
meshx_light_client_set_state_t * state
Lighting Client Model set message union.