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.
|
Go to the source code of this file.
Data Structures | |
struct | meshx_gen_light_cli_cb_reg |
Structure containing the model ID and callback function for generic client model registrations. More... | |
struct | meshx_gen_light_cli_resend_ctx |
Structure containing the model ID and parameter for generic client model message re-sending. More... | |
struct | meshx_gen_light_client_msg_ctx |
Structure containing the message context for generic client model messages. More... | |
struct | meshx_gen_light_cli_cb_reg_node |
Structure containing a node in the linked list of registered callbacks. More... | |
Macros | |
#define | MESHX_CLIENT_INIT_MAGIC_NO 0x4309 |
Typedefs | |
typedef struct meshx_gen_light_cli_cb_reg | meshx_gen_light_cli_cb_reg_t |
typedef struct meshx_gen_light_cli_resend_ctx | meshx_gen_light_cli_resend_ctx |
typedef struct meshx_gen_light_client_msg_ctx | meshx_gen_light_client_msg_ctx_t |
typedef struct meshx_gen_light_cli_cb_reg_node | meshx_gen_light_cli_cb_reg_node_t |
Functions | |
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_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_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_is_unack_opcode (uint32_t opcode) |
Checks if the given opcode corresponds to an unacknowledged (unack) message in the Generic Light Client model. | |
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. | |
static meshx_err_t | meshx_gen_light_cli_handle_ack (uint16_t src_addr) |
Handles ack request for generic light client messages. | |
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. | |
meshx_err_t | meshx_gen_light_cli_init (void) |
Initialize the meshxuction generic client. | |
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. | |
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. | |
Variables | ||
struct { | ||
uint16_t meshx_client_init | ||
meshx_gen_light_cli_cb_reg_node_t * cli_cb_reg_head | ||
} | g_meshx_gen_light_client_ctrl | |
#define MESHX_CLIENT_INIT_MAGIC_NO 0x4309 |
Definition at line 19 of file meshx_gen_light_cli.c.
typedef struct meshx_gen_light_cli_cb_reg_node meshx_gen_light_cli_cb_reg_node_t |
typedef struct meshx_gen_light_cli_cb_reg meshx_gen_light_cli_cb_reg_t |
typedef struct meshx_gen_light_cli_resend_ctx meshx_gen_light_cli_resend_ctx |
typedef struct meshx_gen_light_client_msg_ctx meshx_gen_light_client_msg_ctx_t |
|
static |
Send a message using the generic client model.
This function sends a message using the generic client model, allowing interaction with the BLE mesh network.
[in] | params | Pointer to the message parameters structure. |
[in] | msg_param_len | Length of the parameters structure in bytes. |
Definition at line 209 of file meshx_gen_light_cli.c.
|
static |
Adds a new callback registration to the linked list of registered callbacks.
This function allocates a new node in the linked list of registered callbacks and initializes it with the provided registration information.
[in] | reg | The structure containing the model ID and callback function to add to the linked list. |
Definition at line 94 of file meshx_gen_light_cli.c.
|
static |
Handles ack request for generic light client messages.
This function requests the TXCM module to clear the last message by sending a ACK signal with null parameters.
[in] | src_addr | The Source address of the message. |
Definition at line 285 of file meshx_gen_light_cli.c.
|
static |
Handles resend request for generic light client messages.
This function requests the TXCM module to resend the last message by sending a RESEND signal with null parameters.
Definition at line 300 of file meshx_gen_light_cli.c.
meshx_err_t meshx_gen_light_cli_init | ( | void | ) |
Initialize the meshxuction generic client.
This function sets up the necessary configurations and initializes the meshxuction generic client for the BLE mesh node.
Definition at line 397 of file meshx_gen_light_cli.c.
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.
This function associates a callback with the given model ID, allowing the server to handle events or messages related to that model.
[in] | model_id | The unique identifier of the generic server model. |
[in] | cb | The callback function to be registered for the model. |
Definition at line 472 of file meshx_gen_light_cli.c.
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.
This function sends a message using the generic client model, allowing interaction with the BLE mesh network.
[in] | params | Pointer to the message parameters. |
Definition at line 423 of file meshx_gen_light_cli.c.
|
static |
Handle the Generic Light Client messages.
This function processes the incoming messages for the Generic Light Client and performs the necessary actions based on the message event and parameters.
[in] | pdev | Pointer to the device structure containing device-specific information. |
[in] | model_id | The model ID of the received message. |
[in] | param | Pointer to the Generic Client callback parameter structure. |
Definition at line 328 of file meshx_gen_light_cli.c.
|
static |
Handles TXCM message for generic light client.
This function is called by the TXCM module to handle a message for the generic client model. It is responsible for processing the message and taking appropriate actions. The function also handles resend requests for generic client messages.
[in] | pdev | Pointer to the device structure. |
[in] | evt | Pointer to the control task message structure. |
[in] | param | Pointer to the message context structure. |
Definition at line 242 of file meshx_gen_light_cli.c.
|
static |
Checks if the given model ID corresponds to a Generic Light Client GET opcode.
This function determines whether the specified opcode is part of the set of GET
opcode | The opcode to check. |
Definition at line 116 of file meshx_gen_light_cli.c.
|
static |
Checks if the given model ID corresponds to a Generic Light Client model.
This function determines whether the specified model ID matches the Generic Light Client model supported by MeshX.
model_id | The model ID to check. |
Definition at line 143 of file meshx_gen_light_cli.c.
|
static |
Checks if the given opcode corresponds to an unacknowledged (unack) message in the Generic Light Client model.
This function determines whether the provided opcode represents a SET_UNACK operation for various Generic models in the BLE Mesh specification. It returns success if the opcode matches one of the defined unacknowledged set opcodes.
[in] | opcode | The mesh model opcode to check (uint32_t). |
Definition at line 177 of file meshx_gen_light_cli.c.
meshx_gen_light_cli_cb_reg_node_t* cli_cb_reg_head |
Pointer to the head of the linked list of registered callbacks.
Definition at line 83 of file meshx_gen_light_cli.c.
struct { ... } g_meshx_gen_light_client_ctrl |
uint16_t meshx_client_init |
Flag indicating whether the mesh client has been initialized.
Definition at line 82 of file meshx_gen_light_cli.c.