|
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.
|
Interface class for MeshX elements. More...
#include <meshx_fwd_decl.hpp>
Public Member Functions | |
| virtual meshx_err_t | on_model_cb (meshx_ptr_t param, size_t param_size)=0 |
| Handle model callback from child models. | |
| void | set_element_idx (uint16_t idx) |
| uint16_t | get_element_idx (void) const |
| virtual void | on_baked (uint16_t index)=0 |
| Called when the composition is baked to update the element's index. | |
| virtual meshxElementType_t | get_element_type (void) const =0 |
| Get the element type. | |
| virtual meshx_element_type_t | get_element_variant (void) const =0 |
| Get the element variant. | |
| virtual uint8_t | get_no_of_sig_models (void) const =0 |
| Get the number of SIG models supported by the element. | |
| virtual uint8_t | get_no_of_ven_models (void) const =0 |
| Get the number of Vendor models supported by the element. | |
| virtual uint8_t | list_sig_models (void)=0 |
| Lists and creates all required SIG models for the element. | |
| virtual uint8_t | list_ven_models (void)=0 |
| Lists and creates all required Vendor models for the element. | |
| virtual std::vector< std::unique_ptr< meshXModelIF > > & | get_sig_models (void)=0 |
| Get the SIG models vector. | |
| virtual std::vector< std::unique_ptr< meshXModelIF > > & | get_ven_models (void)=0 |
| Get the Vendor models vector. | |
| virtual meshx_err_t | initialize (void)=0 |
| Initialize the element. | |
| virtual meshx_err_t | reset (void)=0 |
| Reset the element. | |
| virtual bool | is_initialized (void) const =0 |
| Check if the element is initialized. | |
| virtual meshx_err_t | restore_nvs_context (void)=0 |
| Restore the element's context from NVS. | |
| virtual bool | has_model (uint16_t model_id) const =0 |
| Check if the element contains a specific model by ID. | |
| virtual meshx_ptr_t | get_element_ctx (void) const =0 |
| Get the element context structure. | |
| virtual size_t | get_element_ctx_size (void) const =0 |
| Get the size of the element context structure. | |
| virtual void | sync (control_task_msg_evt_t evt)=0 |
| Synchronize element state (Status broadcast or GET request). | |
| virtual const char * | get_element_name (void) const =0 |
| Get the name of the element. | |
| virtual void | handle_config (control_task_msg_evt_t evt, const meshx_config_srv_cb_param_t *params)=0 |
| Handle configuration server events (AppKey bind, Publication, etc.). | |
| meshXElementIF ()=delete | |
| meshXElementIF (uint16_t element_idx) | |
| virtual | ~meshXElementIF ()=default |
Private Attributes | |
| uint16_t | element_idx |
Interface class for MeshX elements.
This is an interface class defining the base functionality for mesh elements.
|
delete |
|
inlineexplicit |
|
virtualdefault |
|
pure virtual |
Get the element context structure.
Implemented in meshXElement< meshx_model_send_param_header_t >, meshXElement< meshx_cli_model_send_param_header_t >, and meshXElement< meshx_srv_model_send_param_header_t >.
|
pure virtual |
Get the size of the element context structure.
Implemented in meshXElement< meshx_model_send_param_header_t >, meshXElement< meshx_cli_model_send_param_header_t >, and meshXElement< meshx_srv_model_send_param_header_t >.
|
inline |
|
pure virtual |
Get the name of the element.
Implemented in meshXCWWWClientElement, meshXCWWWServerElement, meshXElement< meshx_model_send_param_header_t >, meshXElement< meshx_cli_model_send_param_header_t >, meshXElement< meshx_srv_model_send_param_header_t >, meshXRelayClientElement, meshXRelayServerElement, meshXRGBServerElement, meshXRootElement, and meshXSensorElement.
|
pure virtual |
Get the element type.
Implemented in meshXElement< meshx_model_send_param_header_t >, meshXElement< meshx_cli_model_send_param_header_t >, and meshXElement< meshx_srv_model_send_param_header_t >.
|
pure virtual |
Get the element variant.
Implemented in meshXElement< meshx_model_send_param_header_t >, meshXElement< meshx_cli_model_send_param_header_t >, and meshXElement< meshx_srv_model_send_param_header_t >.
|
pure virtual |
Get the number of SIG models supported by the element.
Implemented in meshXElement< meshx_model_send_param_header_t >, meshXElement< meshx_cli_model_send_param_header_t >, and meshXElement< meshx_srv_model_send_param_header_t >.
|
pure virtual |
Get the number of Vendor models supported by the element.
Implemented in meshXElement< meshx_model_send_param_header_t >, meshXElement< meshx_cli_model_send_param_header_t >, and meshXElement< meshx_srv_model_send_param_header_t >.
|
pure virtual |
Get the SIG models vector.
Implemented in meshXElement< meshx_model_send_param_header_t >, meshXElement< meshx_cli_model_send_param_header_t >, and meshXElement< meshx_srv_model_send_param_header_t >.
|
pure virtual |
Get the Vendor models vector.
Implemented in meshXElement< meshx_model_send_param_header_t >, meshXElement< meshx_cli_model_send_param_header_t >, and meshXElement< meshx_srv_model_send_param_header_t >.
|
pure virtual |
Handle configuration server events (AppKey bind, Publication, etc.).
| evt | The configuration event code |
| params | Pointer to the configuration parameters |
Implemented in meshXCWWWClientElement, meshXCWWWServerElement, meshXRelayClientElement, meshXRelayServerElement, meshXRGBServerElement, meshXRootElement, and meshXSensorElement.
|
pure virtual |
Check if the element contains a specific model by ID.
| model_id | The model ID to check for |
Implemented in meshXElement< meshx_model_send_param_header_t >, meshXElement< meshx_cli_model_send_param_header_t >, and meshXElement< meshx_srv_model_send_param_header_t >.
|
pure virtual |
Initialize the element.
Implemented in meshXElement< meshx_model_send_param_header_t >, meshXElement< meshx_cli_model_send_param_header_t >, and meshXElement< meshx_srv_model_send_param_header_t >.
|
pure virtual |
Check if the element is initialized.
Implemented in meshXElement< meshx_model_send_param_header_t >, meshXElement< meshx_cli_model_send_param_header_t >, and meshXElement< meshx_srv_model_send_param_header_t >.
|
pure virtual |
Lists and creates all required SIG models for the element.
Implemented in meshXCWWWClientElement, meshXCWWWServerElement, meshXElement< meshx_model_send_param_header_t >, meshXElement< meshx_cli_model_send_param_header_t >, meshXElement< meshx_srv_model_send_param_header_t >, meshXRelayClientElement, meshXRelayServerElement, meshXRGBServerElement, meshXRootElement, and meshXSensorElement.
|
pure virtual |
Lists and creates all required Vendor models for the element.
Implemented in meshXCWWWClientElement, meshXCWWWServerElement, meshXElement< meshx_model_send_param_header_t >, meshXElement< meshx_cli_model_send_param_header_t >, meshXElement< meshx_srv_model_send_param_header_t >, meshXRelayClientElement, meshXRelayServerElement, meshXRGBServerElement, meshXRootElement, and meshXSensorElement.
|
pure virtual |
Called when the composition is baked to update the element's index.
| index | The final platform index of this element. |
Implemented in meshXElement< meshx_model_send_param_header_t >, meshXElement< meshx_cli_model_send_param_header_t >, and meshXElement< meshx_srv_model_send_param_header_t >.
|
pure virtual |
Handle model callback from child models.
This is a pure virtual function that must be implemented by derived classes. It is called when a model event occurs, allowing the element to handle the event.
| [in] | param | Pointer to the model event parameters. |
| [in] | param_size | Size of the parameter structure. |
Implemented in meshXElement< meshx_model_send_param_header_t >, meshXElement< meshx_cli_model_send_param_header_t >, and meshXElement< meshx_srv_model_send_param_header_t >.
|
pure virtual |
Reset the element.
Implemented in meshXElement< meshx_model_send_param_header_t >, meshXElement< meshx_cli_model_send_param_header_t >, and meshXElement< meshx_srv_model_send_param_header_t >.
|
pure virtual |
Restore the element's context from NVS.
Implemented in meshXElement< meshx_model_send_param_header_t >, meshXElement< meshx_cli_model_send_param_header_t >, and meshXElement< meshx_srv_model_send_param_header_t >.
|
inline |
|
pure virtual |
Synchronize element state (Status broadcast or GET request).
| evt | The event trigger (STACK_READY or FRESH_BOOT) |
Implemented in meshXCWWWClientElement, meshXCWWWServerElement, meshXRelayClientElement, meshXRelayServerElement, meshXRGBServerElement, meshXRootElement, and meshXSensorElement.
|
private |