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.
Loading...
Searching...
No Matches
meshx_root_element.hpp
Go to the documentation of this file.
1/**
2 * @file meshx_root_element.hpp
3 * @brief MeshX Root Element class definition
4 * This file contains the meshXRootElement class which represents the root element
5 * in the MeshX BLE mesh network.
6 *
7 * @author Pranjal Chanda
8 * @date 2024-2025
9 * @copyright Copyright 2024 - 2025 MeshX
10 */
11
12#ifndef __MESHX_ROOT_ELEMENT_HPP__
13#define __MESHX_ROOT_ELEMENT_HPP__
14
16
17#define MESHX_ROOT_ELEMENT_TEMPLATE_PROTO
18#define MESHX_ROOT_ELEMENT_TEMPLATE_PARAMS
19
20#define MESHX_ROOT_DEPENDENCY_RESOLVER_TEMPLATE_PROTO template <typename ModelT>
21#define MESHX_ROOT_DEPENDENCY_RESOLVER_TEMPLATE_PARAMS <ModelT>
22
23/*********************************************************************************
24 * meshXRootElement
25 *********************************************************************************/
31
32/**
33 * @class meshXRootElement
34 * @brief Derived class for the root element
35 */
38{
39private:
40 uint8_t list_sig_models() override;
41 uint8_t list_ven_models() override;
42 const char* get_element_name(void) const override;
43 meshx_err_t element_state_change_notify(meshx_ptr_t param, size_t param_size) override;
44
45 void sync(control_task_msg_evt_t evt) override;
47
49 void add_sig_model_if_present(uint16_t trigger_model_id, const char* log_name);
50
51public:
52 /**
53 * @brief Constructs a new meshXRootElement instance.
54 *
55 * The meshXRootElement represents the primary element in the MeshX BLE mesh network.
56 * It automatically initializes and configures all required SIG models for the root element,
57 * including the Configuration Server model and other essential models.
58 *
59 * The constructor follows these steps:
60 * 1. Creates the root element with the predefined index
61 * 2. Determines the number of required SIG models
62 * 3. Allocates memory for the SIG models
63 * 4. Adds all required SIG models to the element
64 */
66};
67
68#endif /* __MESHX_ROOT_ELEMENT_HPP__ */
meshXElementServer()=default
meshx_err_t element_state_change_notify(meshx_ptr_t param, size_t param_size) override
Handle model callback from child models.
Definition meshx_root_element.cpp:108
const char * get_element_name(void) const override
Get the name of the element.
Definition meshx_root_element.cpp:72
void sync(control_task_msg_evt_t evt) override
Synchronize element state (Status broadcast or GET request).
Definition meshx_root_element.cpp:124
meshXRootElement()
Constructs a new meshXRootElement instance.
Definition meshx_root_element.cpp:32
void handle_config(control_task_msg_evt_t evt, const meshx_config_srv_cb_param_t *params) override
Handle configuration server events (AppKey bind, Publication, etc.).
Definition meshx_root_element.cpp:129
uint8_t list_sig_models() override
Lists and initializes SIG models for Root Element.
Definition meshx_root_element.cpp:48
void add_sig_model_if_present(uint16_t trigger_model_id, const char *log_name)
Definition meshx_root_element.cpp:78
uint8_t list_ven_models() override
Lists and creates all required Vendor models for the element.
Definition meshx_root_element.cpp:68
void * meshx_ptr_t
Definition meshx_ble_mesh_cmn_def.h:636
struct meshx_config_srv_cb_param meshx_config_srv_cb_param_t
uint32_t control_task_msg_evt_t
Type definition for control task message event.
Definition meshx_control_task.h:81
MeshX Element class and interface declaration This file contains the meshXElement class and its inter...
meshx_err_t
MeshX Error Codes.
Definition meshx_err.h:43
#define MESHX_ROOT_ELEMENT_TEMPLATE_PARAMS
Definition meshx_root_element.hpp:18
#define MESHX_ROOT_DEPENDENCY_RESOLVER_TEMPLATE_PROTO
Definition meshx_root_element.hpp:20
#define MESHX_ROOT_ELEMENT_TEMPLATE_PROTO
Definition meshx_root_element.hpp:17
meshxRootElementComposition
Definition meshx_root_element.hpp:27
@ MESHX_ROOT_ELEMENT_COMP_MAX
Definition meshx_root_element.hpp:29
@ MESHX_ROOT_ELEMENT_COMP_CONFIG_SERVER
Definition meshx_root_element.hpp:28