NDEVR
API Documentation
QTWifiManager.h
1
32#pragma once
33#include "DLLInfo.h"
34#if NDEVR_MANAGED_WIFI
35#include "Base/Headers/BaseValues.hpp"
36#include "Base/Headers/String.h"
37#include <QObject>
38#ifndef Q_OS_WIN
39 class QNetworkInformation;
40#endif
41namespace NDEVR
42{
46 struct WifiNetwork
47 {
48 String ssid;
49 uint01 signal_strength;
50#ifdef Q_OS_WIN
51 std::shared_ptr<void> win_interface;
52 std::shared_ptr<void> win_bss;
53#else
54 QString identifier;
55#endif
56 bool is_connected = false;
57 bool is_locked = false;
58 bool has_profile = false;
64 bool operator!=(const WifiNetwork& network) const
65 {
66 return ssid != network.ssid;
67 }
68 };
69
73 struct WifiParams
74 {
75 WifiNetwork network;
76 String password;
77 };
78
85 class NDEVR_NETWORK_API QTWifiManager : public QObject
86 {
87 Q_OBJECT
88 protected:
93 QTWifiManager(QObject* parent = nullptr);
94 public:
95 virtual ~QTWifiManager();
96
101 bool isSupported() const;
106 bool isConnected() const;
107
112 static bool IsSupported();
117 static bool IsConnected();
122 static QTWifiManager& get();
127 uint01 strongestWifiSignal();
128 public slots:
132 void scanRequest();
137 void connectRequest(WifiParams& params);
142 void disconnectRequest(WifiParams& params);
143 signals:
144 void scanFinished(Buffer<WifiNetwork> networks);
145 void scanRequestFailed();
146 void connectRequestFailed(QString failure_message);
147 void connected();
148
149 private:
150 void* m_hClient = nullptr;
154 void getAvailableNetworks();
155
156 protected:
157 static QTWifiManager* s_global_instance;
158 Buffer<WifiNetwork> m_last_wifis;
159#ifndef Q_OS_WIN
160 QNetworkInformation* m_manager;
161#endif
162 };
163
164}
165#endif
The primary namespace for the NDEVR SDK.
constexpr bool operator!=(const Vector< t_dims, t_type > &vec_a, const Vector< t_dims, t_type > &vec_b)
Inequality operator.
Definition Vector.hpp:673
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...