0.4.1
Loading...
Searching...
No Matches
ArubaSensor.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 ArubaSensor.hpp
10/// @brief Aruba Sensor Class
11/// @author R. Lintz (r-lintz@gmx.de) (master thesis)
12/// @date 2024-01-08
13
14#pragma once
15
17
20#include <libssh/libssh.h>
21
22namespace NAV
23{
24/// Aruba Sensor Class
25class ArubaSensor : public Node
26{
27 public:
28 /// @brief Default constructor
30 /// @brief Destructor
31 ~ArubaSensor() override;
32 /// @brief Copy constructor
33 ArubaSensor(const ArubaSensor&) = delete;
34 /// @brief Move constructor
36 /// @brief Copy assignment operator
38 /// @brief Move assignment operator
40
41 /// @brief String representation of the Class Type
42 [[nodiscard]] static std::string typeStatic();
43
44 /// @brief String representation of the Class Type
45 [[nodiscard]] std::string type() const override;
46
47 /// @brief String representation of the Class Category
48 [[nodiscard]] static std::string category();
49
50 /// @brief ImGui config window which is shown on double click
51 /// @attention Don't forget to set _hasConfig to true in the constructor of the node
52 void guiConfig() override;
53
54 /// @brief Saves the node into a json object
55 [[nodiscard]] json save() const override;
56
57 /// @brief Restores the node from a json object
58 /// @param[in] j Json object with the node state
59 void restore(const json& j) override;
60
61 /// @brief Resets the node. It is guaranteed that the node is initialized when this is called.
62 bool resetNode() override;
63
64 private:
65 constexpr static size_t OUTPUT_PORT_INDEX_WIFI_OBS = 0; ///< @brief Flow (WiFiObs)
66
67 /// @brief Initialize the node
68 bool initialize() override;
69
70 /// @brief Deinitialize the node
71 void deinitialize() override;
72
73 /// @brief Function which performs the async data reading
74 /// @param[in] userData Pointer to the object
75 static void readSensorDataThread(void* userData);
76
77 /// @brief SSH channel
78 ssh_channel _channel{};
79 /// @brief SSH session
80 ssh_session _session{};
81
82 /// Timer object to handle async data requests
84
85 /// Ssh options
86
87 /// @brief Host address
88 std::string _sshHost{ "192.168.178.45" };
89 /// @brief User name
90 std::string _sshUser;
91 /// @brief User credentials
92 std::string _sshPassword;
93 /// @brief SSH encryption
94 std::string _sshHostkeys{ "ssh-rsa" };
95 /// @brief Key exchange
96 std::string _sshKeyExchange{ "ecdh-sha2-nistp256" };
97 /// @brief Public key type
98 std::string _sshPublickeyAcceptedTypes{ "ssh-rsa" };
99
100 /// @brief Output interval in ms
101 int _outputInterval{ 3000 };
102};
103
104} // namespace NAV
Starts a Periodic Timer.
Holds all Constants.
nlohmann::json json
json namespace
Node Class.
Manages a thread which calls a specified function at a specified interval.
std::string type() const override
String representation of the Class Type.
std::string _sshHost
Ssh options.
ssh_session _session
SSH session.
static constexpr size_t OUTPUT_PORT_INDEX_WIFI_OBS
Flow (WiFiObs)
CallbackTimer _timer
Timer object to handle async data requests.
ArubaSensor(ArubaSensor &&)=delete
Move constructor.
~ArubaSensor() override
Destructor.
void guiConfig() override
ImGui config window which is shown on double click.
std::string _sshPublickeyAcceptedTypes
Public key type.
ArubaSensor(const ArubaSensor &)=delete
Copy constructor.
ArubaSensor & operator=(ArubaSensor &&)=delete
Move assignment operator.
static void readSensorDataThread(void *userData)
Function which performs the async data reading.
void restore(const json &j) override
Restores the node from a json object.
void deinitialize() override
Deinitialize the node.
ArubaSensor & operator=(const ArubaSensor &)=delete
Copy assignment operator.
static std::string category()
String representation of the Class Category.
static std::string typeStatic()
String representation of the Class Type.
json save() const override
Saves the node into a json object.
std::string _sshHostkeys
SSH encryption.
std::string _sshPassword
User credentials.
ArubaSensor()
Default constructor.
std::string _sshKeyExchange
Key exchange.
ssh_channel _channel
SSH channel.
bool resetNode() override
Resets the node. It is guaranteed that the node is initialized when this is called.
int _outputInterval
Output interval in ms.
std::string _sshUser
User name.
bool initialize() override
Initialize the node.
Node(std::string name)
Constructor.
Definition Node.cpp:30