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_sensor_element.hpp
Go to the documentation of this file.
1/**
2 * @file meshx_sensor_element.hpp
3 * @brief Header file for the MeshX Sensor Server element.
4 */
5
6#ifndef _MESHX_SENSOR_ELEMENT_HPP_
7#define _MESHX_SENSOR_ELEMENT_HPP_
8
10#include <mutex>
11
12#if CONFIG_ENABLE_SENSOR_SERVER
13
19
21{
22 uint16_t app_id; /**< Application key ID for publication */
23 uint16_t pub_addr; /**< Publication address */
24 meshx_sensor_srv_status_t sensor_srv_state; /**< Current sensor server state */
25};
26
28{
29private:
31
32 uint8_t list_sig_models (void) override;
33 uint8_t list_ven_models (void) override;
34 const char* get_element_name(void) const override;
35
36 /**
37 * @brief Notify element of state change from child model.
38 */
39 meshx_err_t element_state_change_notify(meshx_ptr_t param, size_t param_size) override;
40
41 /**
42 * @brief Synchronize element state (Status broadcast)
43 */
44 void sync(control_task_msg_evt_t evt) override;
45
46 /**
47 * @brief Handle configuration server events
48 */
50
52 const dev_struct_t *pdev,
54 const void *params);
55
56public:
57 /**
58 * @brief Constructs a new meshXSensorElement instance.
59 */
60 explicit meshXSensorElement(uint16_t element_id);
61 ~meshXSensorElement() override = default;
62
63 meshXSensorElement (void) = delete;
64};
65
66#endif /* CONFIG_ENABLE_SENSOR_SERVER */
67
68#endif /* _MESHX_SENSOR_ELEMENT_HPP_ */
meshXElementServer()=default
void handle_config(control_task_msg_evt_t evt, const meshx_config_srv_cb_param_t *params) override
Handle configuration server events.
Definition meshx_sensor_element.cpp:183
meshXSensorElement(uint16_t element_id)
Constructs a new meshXSensorElement instance.
Definition meshx_sensor_element.cpp:23
const char * get_element_name(void) const override
Get the name of the element.
Definition meshx_sensor_element.cpp:59
meshx_err_t element_state_change_notify(meshx_ptr_t param, size_t param_size) override
Notify element of state change from child model.
Definition meshx_sensor_element.cpp:69
uint8_t list_ven_models(void) override
Lists Vendor models for Sensor Server Element (none required).
Definition meshx_sensor_element.cpp:54
~meshXSensorElement() override=default
meshXSensorElement(void)=delete
void sync(control_task_msg_evt_t evt) override
Synchronize element state (Status broadcast).
Definition meshx_sensor_element.cpp:169
uint8_t list_sig_models(void) override
Lists and initializes SIG models for Sensor Server Element.
Definition meshx_sensor_element.cpp:40
meshx_sensor_srv_el_ctx_t element_ctx
Definition meshx_sensor_element.hpp:30
static meshx_err_t s_to_ble_cb(const dev_struct_t *pdev, control_task_msg_evt_t evt, const void *params)
Definition meshx_sensor_element.cpp:109
void * meshx_ptr_t
Definition meshx_ble_mesh_cmn_def.h:636
struct meshx_config_srv_cb_param meshx_config_srv_cb_param_t
struct dev_struct dev_struct_t
Structure representing the device composition and elements.
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
meshXSensorElementComposition
Definition meshx_sensor_element.hpp:15
@ MESHX_SENSOR_ELEMENT_COMP_SENSOR_SERVER
Definition meshx_sensor_element.hpp:16
@ MESHX_SENSOR_ELEMENT_COMP_MAX
Definition meshx_sensor_element.hpp:17
Definition meshx_sensor_element.hpp:21
meshx_sensor_srv_status_t sensor_srv_state
Definition meshx_sensor_element.hpp:24
uint16_t pub_addr
Definition meshx_sensor_element.hpp:23
uint16_t app_id
Definition meshx_sensor_element.hpp:22
Definition meshx_ble_mesh_sensor_srv.h:25