|
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.
|
Template specialization of meshXBaseClientModel for Generic BLE mesh models. More...
#include <meshx_base_model_generic.hpp>
Public Member Functions | |
| meshx_err_t | plat_model_init (void) override |
| Initialization function for the Generic OnOff Client model. | |
| meshx_err_t | validate_client_model_id (uint32_t model_id) override |
| Validates if the given model ID corresponds to a supported Generic Client model. | |
| meshx_err_t | plat_send_msg (meshx_gen_client_send_params_t *params) override |
| Send a message using the generic client model. | |
| meshXBaseGenericClientModel ()=delete | |
| meshXBaseGenericClientModel (uint32_t model_id, meshx_ptr_t p_plat_model, const control_msg_cb &from_ble_cb) | |
| Constructor for the meshXBaseGenericClientModel class. | |
| virtual | ~meshXBaseGenericClientModel ()=default |
| Public Member Functions inherited from meshXBaseClientModel< meshXBaseGenericClientModel, meshx_gen_client_send_params_t, meshx_gen_cli_cb_param_t > | |
| meshXBaseClientModel ()=delete | |
| ~meshXBaseClientModel ()=default | |
| meshx_err_t | from_ble_dereg_cb (void) const override |
| Deregister BLE message callback for this model. | |
| void | set_plat_model_ptr (meshx_ptr_t p_model) |
| Set the platform model pointer and update the registration list. | |
| Public Member Functions inherited from meshXBaseModel< meshx_gen_client_send_params_t > | |
| meshx_err_t | from_ble_reg_cb (void) const |
| Register BLE message callback for this model. | |
| meshx_err_t | get_status (void) const |
| Get the current status of the model. | |
| uint32_t | get_model_id (void) const |
| Get the model identifier. | |
| control_task_msg_handle_t | get_from_ble_cb (void) const |
| Get the BLE message callback function. | |
| meshXBaseModelType_t | get_model_type (void) const |
| Get the model type (server/client). | |
| void | set_status (meshx_err_t err) |
| Set the model status. | |
| void | set_model_id (uint32_t id) |
| Set the model identifier. | |
| void | set_from_ble_cb (control_task_msg_handle_t cb) |
| Set the BLE message callback function. | |
| void | set_model_type (meshXBaseModelType_t type) |
| Set the model type. | |
| meshXBaseModel (uint32_t model_id, control_task_msg_handle_t from_ble_cb, meshXBaseModelType_t model_type) | |
| Construct a new meshXBaseModel object. | |
| virtual | ~meshXBaseModel () |
| Virtual destructor for meshXBaseModel. | |
Static Public Member Functions | |
| static meshx_err_t | meshx_is_unack_opcode (uint32_t opcode) |
| Validates if a given opcode corresponds to an unacknowledged (SET_UNACK) message. | |
| static meshx_err_t | meshx_is_get_req_opcode (uint16_t opcode) |
| Checks if a given opcode is a GET request opcode. | |
| static meshx_err_t | meshx_gen_client_txcm_fn_model_send (meshx_gen_client_msg_ctx_t *msg_param, size_t msg_param_len) |
| Send a message using the generic client model. | |
Template specialization of meshXBaseClientModel for Generic BLE mesh models.
This class provides a concrete implementation of the template-based meshXBaseClientModel specifically designed for Generic BLE mesh client models. It inherits all the template benefits including type safety, static callback dispatching, and enhanced debugging while providing Generic-specific functionality.
Key Features:
Template Parameters:
Supported Operations:
|
delete |
| meshXBaseGenericClientModel::meshXBaseGenericClientModel | ( | uint32_t | model_id, |
| meshx_ptr_t | p_plat_model, | ||
| const control_msg_cb & | from_ble_cb ) |
Constructor for the meshXBaseGenericClientModel class.
| [in] | model_id | The model ID associated with the generic client model |
| [in] | p_plat_model | Pointer to the platform model instance |
| [in] | from_ble_cb | The control task message handle associated with the generic client model |
|
virtualdefault |
|
static |
Send a message using the generic client model.
This function sends a message from a Generic Client model to a specified address within the BLE Mesh network, using the provided opcode and parameters.
| [in] | msg_param | Pointer to the message parameters structure. |
| [in] | msg_param_len | Length of the message parameters structure in bytes. |
|
static |
Checks if a given opcode is a GET request opcode.
This function checks if a given opcode is a GET request opcode for the generic client model.
| [in] | opcode | Opcode to check. |
|
static |
Validates if a given opcode corresponds to an unacknowledged (SET_UNACK) message.
This function performs opcode validation to determine if the specified opcode represents a SET_UNACK operation for Generic BLE mesh models. Unacknowledged messages do not require a response from the server, making them suitable for broadcast operations and scenarios where reliability is less critical than performance.
Supported Unacknowledged Opcodes:
| [in] | opcode | The 32-bit BLE mesh model opcode to validate. |
| MESHX_SUCCESS | The opcode is a valid unacknowledged SET operation. |
| MESHX_FAIL | The opcode is not an unacknowledged SET operation. |
|
overridevirtual |
Initialization function for the Generic OnOff Client model.
This function is responsible for initializing the Generic OnOff Client model. It checks if the model has been initialized before, and if not, it registers the callback function for transaction control messages and calls the platform specific initialization function.
Implements meshXBaseModel< meshx_gen_client_send_params_t >.
|
overridevirtual |
Send a message using the generic client model.
This function sends a message from a generic client model to a specified address within the BLE Mesh network, using the provided opcode and parameters.
| [in] | params | Pointer to the structure containing the message parameters to set. |
Implements meshXBaseModel< meshx_gen_client_send_params_t >.
|
overridevirtual |
Validates if the given model ID corresponds to a supported Generic Client model.
This function performs validation of model IDs to ensure they correspond to supported Generic Client models in the MeshX BLE mesh framework. This is the Generic-specific implementation of the virtual validate_client_model_id function.
Supported Generic Client Model IDs:
| [in] | model_id | The 32-bit model ID to validate against supported Generic client models. |
| MESHX_SUCCESS | The model ID is valid and supported. |
| MESHX_FAIL | The model ID is not supported or invalid. |