|
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.
|
Implementation of meshXBaseServerModel for Light BLE mesh models. More...
#include <meshx_base_model_light.hpp>
Public Member Functions | |
| meshx_err_t | plat_model_init (void) override |
| Initialization function for the Light Server model. | |
| meshx_err_t | validate_server_status_opcode (uint16_t opcode) override |
| Validate a light server status opcode. | |
| meshx_err_t | server_state_restore (meshx_light_server_restore_params_t *param) override |
| Restores the state of the Light Server model. | |
| meshx_err_t | plat_send_msg (meshx_light_server_send_params_t *params) override |
| Sends a status message for the Light Server model. | |
| meshXBaseLightServerModel (uint32_t model_id, meshx_ptr_t p_plat_model, const control_msg_cb &from_ble_cb) | |
| Constructor for the meshXBaseLightServerModel class. | |
| meshXBaseLightServerModel ()=delete | |
| ~meshXBaseLightServerModel () final=default | |
| Public Member Functions inherited from meshXBaseServerModel< meshXBaseLightServerModel, meshx_light_server_send_params_t, meshx_light_server_restore_params_t, meshx_lighting_server_cb_param_t > | |
| meshXBaseServerModel ()=delete | |
| virtual | ~meshXBaseServerModel ()=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_light_server_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. | |
Implementation of meshXBaseServerModel for Light BLE mesh models.
This class provides a concrete implementation of the template-based meshXBaseServerModel specifically designed for Light BLE mesh server models. It inherits all the template benefits including type safety, static callback dispatching, and enhanced debugging while providing Light-specific functionality.
Key Features:
Supported Operations:
| meshXBaseLightServerModel::meshXBaseLightServerModel | ( | uint32_t | model_id, |
| meshx_ptr_t | p_plat_model, | ||
| const control_msg_cb & | from_ble_cb ) |
Constructor for the meshXBaseLightServerModel class.
| [in] | model_id | The unique identifier for the Light Server model. |
| [in] | p_plat_model | Pointer to the platform-specific model structure. |
| [in] | from_ble_cb | Callback function for handling incoming BLE messages. |
|
delete |
|
finaldefault |
|
overridevirtual |
Initialization function for the Light Server model.
This function is responsible for initializing the Light Server model. It checks if the model has been initialized before, and if not, it calls the platform specific initialization function.
Implements meshXBaseModel< meshx_light_server_send_params_t >.
|
overridevirtual |
Sends a status message for the Light Server model.
This function sends a status message for the Light Server model to the BLE Mesh network. It checks if the provided model and context are valid, and if the opcode is within the range of supported Light Server opcodes.
| [in] | params | Pointer to the Light Server sending params |
Implements meshXBaseModel< meshx_light_server_send_params_t >.
|
overridevirtual |
Restores the state of the Light Server model.
This function restores the state of the Light Server model using the provided restore parameters. It validates the model ID and state type before calling the platform-specific function to set the server state.
| [in] | param | Pointer to the structure containing the restore parameters. |
|
overridevirtual |
Validate a light server status opcode.
This function determines whether the provided opcode corresponds to a status message in the Light Server group in the MeshX protocol.
| [in] | opcode | The opcode to validate. |