0.4.1
Loading...
Searching...
No Matches
EspressifSensor.hpp
Go to the documentation of this file.
1// This file is part of INSTINCT, the INS Toolkit for Integrated
2// Navigation Concepts and Training by the Institute of Navigation of
3// the University of Stuttgart, Germany.
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9/// @file EspressifSensor.hpp
10/// @brief Espressif Sensor Class
11/// @author R. Lintz (r-lintz@gmx.de) (master thesis)
12/// @author T. Topp (topp@ins.uni-stuttgart.de)
13/// @date 2024-01-08
14
15#pragma once
16
20
21namespace NAV
22{
23/// Espressif Sensor Class
24class EspressifSensor : public Node, public UartSensor
25{
26 public:
27 /// @brief Default constructor
29 /// @brief Destructor
30 ~EspressifSensor() override;
31 /// @brief Copy constructor
33 /// @brief Move constructor
35 /// @brief Copy assignment operator
37 /// @brief Move assignment operator
39
40 /// @brief String representation of the Class Type
41 [[nodiscard]] static std::string typeStatic();
42
43 /// @brief String representation of the Class Type
44 [[nodiscard]] std::string type() const override;
45
46 /// @brief String representation of the Class Category
47 [[nodiscard]] static std::string category();
48
49 /// @brief ImGui config window which is shown on double click
50 /// @attention Don't forget to set _hasConfig to true in the constructor of the node
51 void guiConfig() override;
52
53 /// @brief Saves the node into a json object
54 [[nodiscard]] json save() const override;
55
56 /// @brief Restores the node from a json object
57 /// @param[in] j Json object with the node state
58 void restore(const json& j) override;
59
60 /// @brief Resets the node. It is guaranteed that the node is initialized when this is called.
61 bool resetNode() override;
62
63 private:
64 constexpr static size_t OUTPUT_PORT_INDEX_WIFI_OBS = 0; ///< @brief Flow (EspressifObs)
65
66 /// @brief Initialize the node
67 bool initialize() override;
68
69 /// @brief Deinitialize the node
70 void deinitialize() override;
71
72 /// @brief Callback handler for notifications of new asynchronous data packets received
73 /// @param[in, out] userData Pointer to the data we supplied when we called registerAsyncPacketReceivedHandler
74 /// @param[in] p Encapsulation of the data packet. At this state, it has already been validated and identified as an asynchronous data message
75 /// @param[in] index Advanced usage item and can be safely ignored for now
76 static void binaryAsyncMessageReceived(void* userData, uart::protocol::Packet& p, size_t index);
77
78 /// Sensor Object
80};
81
82} // namespace NAV
Class to read out Espressif Sensors.
nlohmann::json json
json namespace
Node Class.
Abstract Uart Sensor Class.
void guiConfig() override
ImGui config window which is shown on double click.
bool resetNode() override
Resets the node. It is guaranteed that the node is initialized when this is called.
EspressifSensor()
Default constructor.
static std::string typeStatic()
String representation of the Class Type.
vendor::espressif::EspressifUartSensor _sensor
Sensor Object.
std::string type() const override
String representation of the Class Type.
void restore(const json &j) override
Restores the node from a json object.
void deinitialize() override
Deinitialize the node.
~EspressifSensor() override
Destructor.
static constexpr size_t OUTPUT_PORT_INDEX_WIFI_OBS
Flow (EspressifObs)
static std::string category()
String representation of the Class Category.
EspressifSensor(EspressifSensor &&)=delete
Move constructor.
json save() const override
Saves the node into a json object.
EspressifSensor & operator=(const EspressifSensor &)=delete
Copy assignment operator.
static void binaryAsyncMessageReceived(void *userData, uart::protocol::Packet &p, size_t index)
Callback handler for notifications of new asynchronous data packets received.
EspressifSensor(const EspressifSensor &)=delete
Copy constructor.
bool initialize() override
Initialize the node.
EspressifSensor & operator=(EspressifSensor &&)=delete
Move assignment operator.
Node(std::string name)
Constructor.
Definition Node.cpp:30
UartSensor(const UartSensor &)=delete
Copy constructor.
Class to read out Espressif Sensors.