|
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_sensor_element.hpp>
Public Member Functions | |
| meshXSensorElement (uint16_t element_id) | |
| Constructs a new meshXSensorElement instance. | |
| ~meshXSensorElement () override=default | |
| meshXSensorElement (void)=delete | |
| Public Member Functions inherited from meshXElementServer | |
| meshXElementServer ()=default | |
| meshXElementServer (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_srv_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. | |
| 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 (void) override |
| Lists and initializes SIG models for Sensor Server Element. | |
| uint8_t | list_ven_models (void) override |
| Lists Vendor models for Sensor Server 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 (Status broadcast). | |
| 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_sensor_srv_el_ctx_t | element_ctx |
Additional Inherited Members | |
| Static Public Member Functions inherited from meshXElement< meshx_srv_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 meshXSensorElement instance.
|
overridedefault |
|
delete |
|
overrideprivatevirtual |
Notify element of state change from child model.
Overrides base class stub. Updates element_ctx, saves to NVS, and dispatches app notification via meshx_send_msg_to_app().
Reimplemented from meshXElement< meshx_srv_model_send_param_header_t >.
|
overrideprivatevirtual |
Get the name of the element.
Reimplemented from meshXElement< meshx_srv_model_send_param_header_t >.
|
overrideprivatevirtual |
Handle configuration server events.
Implements meshXElementIF.
|
overrideprivatevirtual |
Lists and initializes SIG models for Sensor Server Element.
Reimplemented from meshXElement< meshx_srv_model_send_param_header_t >.
|
overrideprivatevirtual |
Lists Vendor models for Sensor Server Element (none required).
Reimplemented from meshXElement< meshx_srv_model_send_param_header_t >.
|
staticprivate |
|
overrideprivatevirtual |
Synchronize element state (Status broadcast).
Implements meshXElementIF.
|
private |