trikRuntime
wpaSupplicantCommunicator.h
Go to the documentation of this file.
1 /* Copyright 2013 Roman Kurbatov, Yurii Litvinov
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License. */
14 
15 #pragma once
16 
17 #include <QtCore/QObject>
18 #include <QtCore/QScopedPointer>
19 
20 #include "declSpec.h"
21 
22 struct sockaddr_un;
23 
24 namespace trikWiFi {
25 
28 {
29  Q_OBJECT
30 
31 public:
37  WpaSupplicantCommunicator(const QString &interfaceFile, const QString &daemonFile, QObject *parent = nullptr);
38 
41 
43  int fileDescriptor();
44 
46  int attach();
47 
49  int detach();
50 
55  int request(const QString &command, QString &reply);
56 
58  bool isPending();
59 
61  int receive(QString &message);
62 
63 private:
64  int mSocket;
65  QScopedPointer<sockaddr_un> mLocal;
66  QScopedPointer<sockaddr_un> mDest;
67 };
68 
69 }
#define TRIKWIFI_EXPORT
Definition: declSpec.h:23
Definition: wpaSupplicantCommunicator.cpp:19
Allows communication with wpa_supplicant daemon.
Definition: wpaSupplicantCommunicator.h:27
Definition: controller.h:25