| netctlgui 1.4.7 Qt library which interacts with netctl

- Main Page
- Classes
- Files

- File List
- File Members

wpasupinteract.h
Go to the documentation of this file.
1 /***************************************************************************
2 * This file is part of netctl-gui *
3 * *
4 * netctl-gui is free software: you can redistribute it and/or *
5 * modify it under the terms of the GNU General Public License as *
6 * published by the Free Software Foundation, either version 3 of the *
7 * License, or (at your option) any later version. *
8 * *
9 * netctl-gui is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with netctl-gui. If not, see http://www.gnu.org/licenses/ *
16 ***************************************************************************/
26 #ifndef WPASUPINTERACT_H
27 #define WPASUPINTERACT_H
28
29 #include <QDir>
30 #include <QMap>
31 #include <QObject>
32
33 #include "version.h"
34
35
36 class Netctl;
37 class NetctlProfile;
38
51 enum PointType {
52 None = 0,
53 TwoG,
54 FiveG,
55 TwoAndFiveG
56 };
57
78 typedef struct
79 {
80 QList<int> frequencies;
81 QStringList macs;
82 QString name;
83 QString security;
84 int signal = 0;
85 PointType type = PointType::None;
86 bool active = false;
87 bool exists = false;
88 } netctlWifiInfo;
89
93 class WpaSup : public QObject
94 {
95 Q_OBJECT
96
97 public:
111 explicit WpaSup(const bool debugCmd = false,
112 const QMap<QString, QString> settings = QMap<QString, QString>());
116 ~WpaSup();
117 // general information
123 QString existentProfile(const QString essid);
128 static QMap<QString, QString> getRecommendedConfiguration();
135 bool isProfileActive(const QString essid);
142 Q_DECL_DEPRECATED bool isProfileExists(const QString essid);
143
144 public slots:
145 // functions
150 netctlWifiInfo current();
155 QList<netctlWifiInfo> scanWifi();
161 bool startWpaSupplicant();
167 bool stopWpaSupplicant();
168
169 private:
173 Netctl *netctlCommand = nullptr;
177 NetctlProfile *netctlProfile = nullptr;
181 bool debug = false;
185 bool useSuid = true;
189 QString ctrlDir = QString(CTRL_DIR);
193 QString ctrlGroup = QString(CTRL_GROUP);
197 QString pidFile = QString(PID_FILE);
201 QString sudoCommand = QString(SUDO_PATH);
205 QString wpaCliPath = QString(WPACLI_PATH);
209 QString wpaDrivers = QString(WPA_DRIVERS);
213 QString wpaSupPath = QString(WPASUP_PATH);
214 // functions
220 QString getWpaCliOutput(const QString commandLine);
225 bool waitForProcess(const int sec);
232 bool wpaCliCall(const QString commandLine);
233 };
234
235
236 #endif /* WPASUPINTERACT_H */
TwoAndFiveG
Definition: wpasupinteract.h:55
WpaSup::stopWpaSupplicant
bool stopWpaSupplicant()
method which send TERMINATE signal to wpa_supplicant
WpaSup::current
netctlWifiInfo current()
method which returns active point information
WpaSup::scanWifi
QList< netctlWifiInfo > scanWifi()
method which scans WiFi networks
WpaSup::WpaSup
WpaSup(const bool debugCmd=false, const QMap< QString, QString > settings=QMap< QString, QString >())
WpaSup class constructor.
WpaSup::isProfileExists
Q_DECL_DEPRECATED bool isProfileExists(const QString essid)
method which checks profile existence by ESSID
netctlWifiInfo::frequencies
QList< int > frequencies
Definition: wpasupinteract.h:80
netctlWifiInfo::name
QString name
Definition: wpasupinteract.h:82
netctlWifiInfo::security
QString security
Definition: wpasupinteract.h:83
NetctlProfile
The NetctlProfile class interacts with netctl profiles.
Definition: netctlprofile.h:39
TwoG
Definition: wpasupinteract.h:53
FiveG
Definition: wpasupinteract.h:54
WpaSup::isProfileActive
bool isProfileActive(const QString essid)
method which checks profile status by ESSID
Netctl
The Netctl class interacts with netctl.
Definition: netctlinteract.h:73
PointType
PointType
WiFi point type.
Definition: wpasupinteract.h:51
WpaSup::~WpaSup
~WpaSup()
WpaSup class destructor.
WpaSup::existentProfile
QString existentProfile(const QString essid)
method which gets profile name by ESSID
None
Definition: wpasupinteract.h:52
netctlWifiInfo::macs
QStringList macs
Definition: wpasupinteract.h:81
WpaSup::startWpaSupplicant
bool startWpaSupplicant()
method which calls wpa_supplicant
WpaSup
The WpaSup class interacts with wpa_supplicant.
Definition: wpasupinteract.h:93
netctlWifiInfo
WiFi information structure.
Definition: wpasupinteract.h:78
WpaSup::getRecommendedConfiguration
static QMap< QString, QString > getRecommendedConfiguration()
method which check system configuration and return recommended values to keys