|
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.
|
#include <meshx_cwww_element.hpp>
Public Member Functions | |
| meshXCWWWClientElement (uint16_t element_idx) | |
| Constructs a new meshXCWWWClientElement instance. The meshXCWWWClientElement represents a CWWW client element in the MeshX BLE mesh network. It automatically initializes and configures all required SIG models for the CWWW element. The CWWW element combines Generic OnOff and Light CTL client models. | |
| meshXCWWWClientElement ()=delete | |
| uint8_t | get_onoff () |
| meshx_light_ctl_model_state_t & | get_ctl () |
| meshx_cwww_cli_el_ctx_t & | get_ctx () |
| Public Member Functions inherited from meshXElementClient | |
| meshXElementClient ()=default | |
| meshXElementClient (uint16_t element_idx, uint8_t no_of_sig_models=0, uint8_t no_of_ven_models=0) | |
| Public Member Functions inherited from meshXElement< meshx_cli_model_send_param_header_t > | |
| void | set_element_type (meshxElementType_t type) |
| meshxElementType_t | get_element_type (void) const final |
| Get the element type. | |
| void | set_element_variant (meshx_element_type_t variant) |
| meshx_element_type_t | get_element_variant (void) const final |
| Get the element variant. | |
| void | set_no_of_sig_models (uint8_t cnt) |
| uint8_t | get_no_of_sig_models (void) const final |
| Get the number of SIG models supported by the element. | |
| void | set_no_of_ven_models (uint8_t cnt) |
| uint8_t | get_no_of_ven_models (void) const final |
| Get the number of Vendor models supported by the element. | |
| std::vector< std::unique_ptr< meshXModelIF > > & | get_sig_models (void) final |
| Get the SIG models vector. | |
| std::vector< std::unique_ptr< meshXModelIF > > & | get_ven_models (void) final |
| Get the Vendor models vector. | |
| const char * | get_element_name (void) const override |
| Get the name of the element. | |
| void | register_element_ctx (meshx_ptr_t ctx, size_t ctx_size) |
| Register element context structure. | |
| meshx_ptr_t | get_element_ctx (void) const override |
| Get the element context structure. | |
| size_t | get_element_ctx_size (void) const override |
| Get the size of the element context structure. | |
| meshx_err_t | sig_plat_model_array_allocate (void) |
| Allocate memory for SIG model platform array. | |
| meshx_err_t | ven_plat_model_array_allocate (void) |
| Allocate memory for Vendor model platform array. | |
| std::vector< uint8_t > & | get_sig_model_array (void) |
| Get the SIG model array. | |
| std::vector< uint8_t > & | get_ven_model_array (void) |
| Get the Vendor model array. | |
| meshx_err_t | add_sig_model (ConstructorsArgs &&... args) |
| Add a SIG model to the element. | |
| meshx_err_t | add_ven_model (ConstructorsArgs &&... args) |
| Add a Vendor model to the element. | |
| uint8_t | get_sig_model_count (void) const |
| Get the number of SIG models currently added to the element. | |
| uint8_t | get_ven_model_count (void) const |
| Get the number of Vendor models currently added to the element. | |
| meshx_err_t | add_sig_models (void) |
| Add multiple SIG models to the element. | |
| meshx_err_t | add_ven_models (void) |
| Add multiple Vendor models to the element. | |
| meshx_err_t | add_models (void) |
| Add both SIG and Vendor models to the element. | |
| MESHX_MODEL * | get_sig_plat_model_array (void) |
| Get the platform model array for SIG models. | |
| MESHX_MODEL * | get_ven_plat_model_array (void) |
| Get the platform model array for Vendor models. | |
| meshXElement (void) | |
| Default constructor for meshXElement. | |
| meshx_err_t | initialize (void) override |
| Initialize the element. | |
| meshx_err_t | reset (void) override |
| Reset the element. | |
| bool | is_initialized (void) const override |
| Check if the element is initialized. | |
| meshx_err_t | restore_nvs_context (void) override |
| Restore the element's context from NVS. | |
| bool | has_model (uint16_t model_id) const override |
| Check if the element contains a specific model by ID. | |
| void | on_baked (uint16_t index) override |
| Called when the composition is baked to update the element's index. | |
| ~meshXElement () override | |
| Public Member Functions inherited from meshXElementIF | |
| void | set_element_idx (uint16_t idx) |
| uint16_t | get_element_idx (void) const |
| meshXElementIF ()=delete | |
| meshXElementIF (uint16_t element_idx) | |
| virtual | ~meshXElementIF ()=default |
Private Member Functions | |
| uint8_t | list_sig_models () override |
| Lists and creates all required SIG models for the element. | |
| uint8_t | list_ven_models () override |
| Lists Vendor models for CWWW Client Element (none required). | |
| const char * | get_element_name (void) const override |
| Get the name of the element. | |
| meshx_err_t | element_state_change_notify (meshx_ptr_t param, size_t param_size) override |
| Notify element of state change from child model. | |
| void | sync (control_task_msg_evt_t evt) override |
| Synchronize element state (GET requests). | |
| void | handle_config (control_task_msg_evt_t evt, const meshx_config_srv_cb_param_t *params) override |
| Handle configuration server events. | |
Static Private Member Functions | |
| static meshx_err_t | s_to_ble_cb (const dev_struct_t *pdev, control_task_msg_evt_t evt, const void *params) |
Private Attributes | |
| meshx_cwww_cli_el_ctx_t | element_ctx |
Additional Inherited Members | |
| Static Public Member Functions inherited from meshXElement< meshx_cli_model_send_param_header_t > | |
| static meshx_err_t | static_prov_srv_cb (const dev_struct_t *pdev, control_task_msg_evt_t evt, const void *params) |
| Global static provisioning callback for Server elements. | |
| static meshx_err_t | static_prov_cli_cb (const dev_struct_t *pdev, control_task_msg_evt_t evt, const void *params) |
| Global static provisioning callback for Client elements. | |
| static meshx_err_t | static_config_cb (const dev_struct_t *pdev, control_task_msg_evt_t evt, const meshx_config_srv_cb_param_t *params) |
| Global static configuration callback. | |
| static void | register_global_callbacks (void) |
| Register the global callbacks with the provisioning server. | |
|
explicit |
Constructs a new meshXCWWWClientElement instance. The meshXCWWWClientElement represents a CWWW client element in the MeshX BLE mesh network. It automatically initializes and configures all required SIG models for the CWWW element. The CWWW element combines Generic OnOff and Light CTL client models.
| element_idx | The index of the element within the node. |
|
delete |
|
overrideprivatevirtual |
Notify element of state change from child model.
Discriminates ONOFF vs CTL via header->model.model_id. Updates element_ctx and notifies app.
Reimplemented from meshXElement< meshx_cli_model_send_param_header_t >.
|
inline |
|
inline |
|
overrideprivatevirtual |
Get the name of the element.
Implements meshXElementIF.
|
inline |
|
overrideprivatevirtual |
Handle configuration server events.
Implements meshXElementIF.
|
overrideprivatevirtual |
Lists and creates all required SIG models for the element.
This function is responsible for creating and populating the sig_models vector with all essential SIG models that the element must have.
The function can be extended to include additional models based on configuration flags or specific requirements.
Reimplemented from meshXElement< meshx_cli_model_send_param_header_t >.
|
overrideprivatevirtual |
Lists Vendor models for CWWW Client Element (none required).
Reimplemented from meshXElement< meshx_cli_model_send_param_header_t >.
|
staticprivate |
|
overrideprivatevirtual |
Synchronize element state (GET requests).
Implements meshXElementIF.
|
private |