API Documentation
Loading...
Searching...
No Matches
QTWifiManager.h
Go to the documentation of this file.
1/**--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Widgets
28File: QTWifiManager
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#if NDEVR_MANAGED_WIFI
36#include "Base/Headers/String.h"
37#include <QObject>
38#ifndef Q_OS_WIN
39 class QNetworkInformation;
40#endif
41namespace NDEVR
42{
43 struct WifiNetwork
44 {
45 String ssid;
46 uint01 signal_strength;
47#ifdef Q_OS_WIN
48 std::shared_ptr<void> win_interface;
49 std::shared_ptr<void> win_bss;
50#else
51 QString identifier;
52#endif
53 bool is_connected = false;
54 bool is_locked = false;
55 bool has_profile = false;
56 bool operator!=(const WifiNetwork& network) const
57 {
58 return ssid != network.ssid;
59 }
60 };
61
62 struct WifiParams
63 {
64 WifiNetwork network;
65 String password;
66 };
67
68 class NDEVR_NETWORK_API QTWifiManager : public QObject
69 {
70 Q_OBJECT
71 protected:
72 QTWifiManager(QObject* parent = nullptr);
73 public:
74 virtual ~QTWifiManager();
75
76 bool isSupported() const;
77 bool isConnected() const;
78
79 static bool IsSupported();
80 static bool IsConnected();
81 static QTWifiManager& get();
82 uint01 strongestWifiSignal();
83 public slots:
84 void scanRequest();
85 void connectRequest(WifiParams& params);
86 void disconnectRequest(WifiParams& params);
87 signals:
88 void scanFinished(Buffer<WifiNetwork> networks);
89 void scanRequestFailed();
90 void connectRequestFailed(QString failure_message);
91 void connected();
92
93 private:
94 void* m_hClient = nullptr;
95 void getAvailableNetworks();
96
97 protected:
98 static QTWifiManager* s_global_instance;
99 Buffer<WifiNetwork> m_last_wifis;
100#ifndef Q_OS_WIN
101 QNetworkInformation* m_manager;
102#endif
103 };
104
105}
106#endif
#define NDEVR_NETWORK_API
Definition DLLInfo.h:74
bool operator!=(const VkVertexInputAttributeDescription &a, const VkVertexInputAttributeDescription &b)
Definition VulkanRenderObject.cpp:10
Definition ACIColor.h:37
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:93