Qt 4.8
qnativewifiengine.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the plugins of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include "qnativewifiengine.h"
43 #include "platformdefs.h"
44 #include "../qnetworksession_impl.h"
45 
46 #include <QtNetwork/private/qnetworkconfiguration_p.h>
47 
48 #include <QtCore/qstringlist.h>
49 #include <QtCore/qcoreapplication.h>
50 
51 #include <QtCore/qdebug.h>
52 
53 #ifndef QT_NO_BEARERMANAGEMENT
54 
56 
67 
69 {
70  Q_UNUSED(d);
71 
73  switch (data->NotificationCode) {
79  break;
80  default:
81 #ifdef BEARER_MANAGEMENT_DEBUG
82  qDebug() << "wlan acm notification" << (int)data->NotificationCode;
83 #endif
84  break;
85  }
86  } else {
87 #ifdef BEARER_MANAGEMENT_DEBUG
88  qDebug() << "wlan notification source" << (int)data->NotificationSource << "code" << (int)data->NotificationCode;
89 #endif
90  }
91 }
92 
94 : QBearerEngineImpl(parent), handle(INVALID_HANDLE_VALUE)
95 {
96  connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), this, SLOT(closeHandle()));
97 }
98 
100 {
101  closeHandle();
102 }
103 
105 {
106  QMutexLocker locker(&mutex);
107 
108  if (!available()) {
109  locker.unlock();
111  return;
112  }
113 
114  // enumerate interfaces
115  WLAN_INTERFACE_INFO_LIST *interfaceList;
116  DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList);
117  if (result != ERROR_SUCCESS) {
118 #ifdef BEARER_MANAGEMENT_DEBUG
119  qDebug("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result);
120 #endif
121 
122  locker.unlock();
124 
125  return;
126  }
127 
128  QStringList previous = accessPointConfigurations.keys();
129 
130  for (unsigned int i = 0; i < interfaceList->dwNumberOfItems; ++i) {
131  const WLAN_INTERFACE_INFO &interface = interfaceList->InterfaceInfo[i];
132 
133  WLAN_AVAILABLE_NETWORK_LIST *networkList;
134  result = local_WlanGetAvailableNetworkList(handle, &interface.InterfaceGuid,
135  3, 0, &networkList);
136  if (result != ERROR_SUCCESS) {
137 #ifdef BEARER_MANAGEMENT_DEBUG
138  qDebug("%s: WlanGetAvailableNetworkList failed with error %ld\n",
139  __FUNCTION__, result);
140 #endif
141  continue;
142  }
143 
144  QStringList seenNetworks;
145 
146  for (unsigned int j = 0; j < networkList->dwNumberOfItems; ++j) {
147  WLAN_AVAILABLE_NETWORK &network = networkList->Network[j];
148 
149  QString networkName;
150 
151  if (network.strProfileName[0] != 0) {
152  networkName = QString::fromWCharArray(network.strProfileName);
153  } else {
154  networkName = QByteArray(reinterpret_cast<char *>(network.dot11Ssid.ucSSID),
155  network.dot11Ssid.uSSIDLength);
156  }
157 
158  const QString id = QString::number(qHash(QLatin1String("WLAN:") + networkName));
159 
160  previous.removeAll(id);
161 
162  QNetworkConfiguration::StateFlags state = QNetworkConfiguration::Undefined;
163 
166 
167  if (network.strProfileName[0] != 0) {
168  if (network.bNetworkConnectable) {
171  else
173  } else {
175  }
176  }
177 
178  if (seenNetworks.contains(networkName))
179  continue;
180  else
181  seenNetworks.append(networkName);
182 
183  if (accessPointConfigurations.contains(id)) {
185 
186  bool changed = false;
187 
188  ptr->mutex.lock();
189 
190  if (!ptr->isValid) {
191  ptr->isValid = true;
192  changed = true;
193  }
194 
195  if (ptr->name != networkName) {
196  ptr->name = networkName;
197  changed = true;
198  }
199 
200  if (ptr->state != state) {
201  ptr->state = state;
202  changed = true;
203  }
204 
205  ptr->mutex.unlock();
206 
207  if (changed) {
208  locker.unlock();
210  locker.relock();
211  }
212  } else {
214 
215  ptr->name = networkName;
216  ptr->isValid = true;
217  ptr->id = id;
218  ptr->state = state;
221 
222  accessPointConfigurations.insert(id, ptr);
223 
224  locker.unlock();
226  locker.relock();
227  }
228  }
229 
230  local_WlanFreeMemory(networkList);
231  }
232 
233  local_WlanFreeMemory(interfaceList);
234 
235  while (!previous.isEmpty()) {
237  accessPointConfigurations.take(previous.takeFirst());
238 
239  locker.unlock();
241  locker.relock();
242  }
243 
244  locker.unlock();
246 }
247 
249 {
250  QMutexLocker locker(&mutex);
251 
252  if (!available())
253  return QString();
254 
255  // enumerate interfaces
256  WLAN_INTERFACE_INFO_LIST *interfaceList;
257  DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList);
258  if (result != ERROR_SUCCESS) {
259 #ifdef BEARER_MANAGEMENT_DEBUG
260  qDebug("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result);
261 #endif
262  return QString();
263  }
264 
265  for (unsigned int i = 0; i < interfaceList->dwNumberOfItems; ++i) {
266  const WLAN_INTERFACE_INFO &interface = interfaceList->InterfaceInfo[i];
267 
268  DWORD dataSize;
269  WLAN_CONNECTION_ATTRIBUTES *connectionAttributes;
270  result = local_WlanQueryInterface(handle, &interface.InterfaceGuid,
272  reinterpret_cast<PVOID *>(&connectionAttributes), 0);
273  if (result != ERROR_SUCCESS) {
274 #ifdef BEARER_MANAGEMENT_DEBUG
275  if (result != ERROR_INVALID_STATE)
276  qDebug("%s: WlanQueryInterface failed with error %ld\n", __FUNCTION__, result);
277 #endif
278 
279  continue;
280  }
281 
282  if (qHash(QLatin1String("WLAN:") +
283  QString::fromWCharArray(connectionAttributes->strProfileName)) == id.toUInt()) {
284  QString guid("{%1-%2-%3-%4%5-%6%7%8%9%10%11}");
285 
286  guid = guid.arg(interface.InterfaceGuid.Data1, 8, 16, QChar('0'));
287  guid = guid.arg(interface.InterfaceGuid.Data2, 4, 16, QChar('0'));
288  guid = guid.arg(interface.InterfaceGuid.Data3, 4, 16, QChar('0'));
289  for (int i = 0; i < 8; ++i)
290  guid = guid.arg(interface.InterfaceGuid.Data4[i], 2, 16, QChar('0'));
291 
292  local_WlanFreeMemory(connectionAttributes);
293  local_WlanFreeMemory(interfaceList);
294 
295  return guid.toUpper();
296  }
297 
298  local_WlanFreeMemory(connectionAttributes);
299  }
300 
301  local_WlanFreeMemory(interfaceList);
302 
303  return QString();
304 }
305 
307 {
308  QMutexLocker locker(&mutex);
309 
310  if (!available())
311  return false;
312 
313  // enumerate interfaces
314  WLAN_INTERFACE_INFO_LIST *interfaceList;
315  DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList);
316  if (result != ERROR_SUCCESS) {
317 #ifdef BEARER_MANAGEMENT_DEBUG
318  qDebug("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result);
319 #endif
320  return false;
321  }
322 
323  for (unsigned int i = 0; i < interfaceList->dwNumberOfItems; ++i) {
324  const WLAN_INTERFACE_INFO &interface = interfaceList->InterfaceInfo[i];
325 
326  WLAN_AVAILABLE_NETWORK_LIST *networkList;
327  result = local_WlanGetAvailableNetworkList(handle, &interface.InterfaceGuid,
328  3, 0, &networkList);
329  if (result != ERROR_SUCCESS) {
330 #ifdef BEARER_MANAGEMENT_DEBUG
331  qDebug("%s: WlanGetAvailableNetworkList failed with error %ld\n",
332  __FUNCTION__, result);
333 #endif
334  continue;
335  }
336 
337  for (unsigned int j = 0; j < networkList->dwNumberOfItems; ++j) {
338  WLAN_AVAILABLE_NETWORK &network = networkList->Network[j];
339 
340  QString networkName;
341 
342  if (network.strProfileName[0] != 0) {
343  networkName = QString::fromWCharArray(network.strProfileName);
344  } else {
345  networkName = QByteArray(reinterpret_cast<char *>(network.dot11Ssid.ucSSID),
346  network.dot11Ssid.uSSIDLength);
347  }
348 
349  if (qHash(QLatin1String("WLAN:") + networkName) == id.toUInt()) {
350  local_WlanFreeMemory(networkList);
351  local_WlanFreeMemory(interfaceList);
352  return true;
353  }
354  }
355 
356  local_WlanFreeMemory(networkList);
357  }
358 
359  local_WlanFreeMemory(interfaceList);
360 
361  return false;
362 }
363 
365 {
366  QMutexLocker locker(&mutex);
367 
368  if (!available()) {
369  locker.unlock();
371  return;
372  }
373 
374  WLAN_INTERFACE_INFO_LIST *interfaceList;
375  DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList);
376  if (result != ERROR_SUCCESS) {
377 #ifdef BEARER_MANAGEMENT_DEBUG
378  qDebug("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result);
379 #endif
380  locker.unlock();
382  return;
383  }
384 
385  QString profile;
386 
387  for (unsigned int i = 0; i < interfaceList->dwNumberOfItems; ++i) {
388  const WLAN_INTERFACE_INFO &interface = interfaceList->InterfaceInfo[i];
389 
390  WLAN_AVAILABLE_NETWORK_LIST *networkList;
391  result = local_WlanGetAvailableNetworkList(handle, &interface.InterfaceGuid,
392  3, 0, &networkList);
393  if (result != ERROR_SUCCESS) {
394 #ifdef BEARER_MANAGEMENT_DEBUG
395  qDebug("%s: WlanGetAvailableNetworkList failed with error %ld\n",
396  __FUNCTION__, result);
397 #endif
398  continue;
399  }
400 
401  for (unsigned int j = 0; j < networkList->dwNumberOfItems; ++j) {
402  WLAN_AVAILABLE_NETWORK &network = networkList->Network[j];
403 
404  profile = QString::fromWCharArray(network.strProfileName);
405 
406  if (qHash(QLatin1String("WLAN:") + profile) == id.toUInt())
407  break;
408  else
409  profile.clear();
410  }
411 
412  local_WlanFreeMemory(networkList);
413 
414  if (!profile.isEmpty()) {
415  WLAN_CONNECTION_PARAMETERS parameters;
417  parameters.strProfile = reinterpret_cast<LPCWSTR>(profile.utf16());
418  parameters.pDot11Ssid = 0;
419  parameters.pDesiredBssidList = 0;
420  parameters.dot11BssType = dot11_BSS_type_any;
421  parameters.dwFlags = 0;
422 
423  DWORD result = local_WlanConnect(handle, &interface.InterfaceGuid, &parameters, 0);
424  if (result != ERROR_SUCCESS) {
425 #ifdef BEARER_MANAGEMENT_DEBUG
426  qDebug("%s: WlanConnect failed with error %ld\n", __FUNCTION__, result);
427 #endif
428  locker.unlock();
430  locker.relock();
431  break;
432  }
433 
434  break;
435  }
436  }
437 
438  local_WlanFreeMemory(interfaceList);
439 
440  if (profile.isEmpty()) {
441  locker.unlock();
443  }
444 }
445 
447 {
448  QMutexLocker locker(&mutex);
449 
450  if (!available()) {
451  locker.unlock();
453  return;
454  }
455 
456  QString interface = getInterfaceFromId(id);
457 
458  if (interface.isEmpty()) {
459  locker.unlock();
461  return;
462  }
463 
464  QStringList split = interface.mid(1, interface.length() - 2).split('-');
465 
466  GUID guid;
467  guid.Data1 = split.at(0).toUInt(0, 16);
468  guid.Data2 = split.at(1).toUShort(0, 16);
469  guid.Data3 = split.at(2).toUShort(0, 16);
470  guid.Data4[0] = split.at(3).left(2).toUShort(0, 16);
471  guid.Data4[1] = split.at(3).right(2).toUShort(0, 16);
472  for (int i = 0; i < 6; ++i)
473  guid.Data4[i + 2] = split.at(4).mid(i*2, 2).toUShort(0, 16);
474 
475  DWORD result = local_WlanDisconnect(handle, &guid, 0);
476  if (result != ERROR_SUCCESS) {
477 #ifdef BEARER_MANAGEMENT_DEBUG
478  qDebug("%s: WlanDisconnect failed with error %ld\n", __FUNCTION__, result);
479 #endif
480  locker.unlock();
482  return;
483  }
484 }
485 
487 {
488  scanComplete();
489 }
490 
492 {
493  QMutexLocker locker(&mutex);
494 
495  if (!available()) {
496  locker.unlock();
498  return;
499  }
500 
501  // enumerate interfaces
502  WLAN_INTERFACE_INFO_LIST *interfaceList;
503  DWORD result = local_WlanEnumInterfaces(handle, 0, &interfaceList);
504  if (result != ERROR_SUCCESS) {
505 #ifdef BEARER_MANAGEMENT_DEBUG
506  qDebug("%s: WlanEnumInterfaces failed with error %ld\n", __FUNCTION__, result);
507 #endif
508 
509  locker.unlock();
511 
512  return;
513  }
514 
515  bool requested = false;
516  for (unsigned int i = 0; i < interfaceList->dwNumberOfItems; ++i) {
517  result = local_WlanScan(handle, &interfaceList->InterfaceInfo[i].InterfaceGuid, 0, 0, 0);
518  if (result != ERROR_SUCCESS) {
519 #ifdef BEARER_MANAGEMENT_DEBUG
520  qDebug("%s: WlanScan failed with error %ld\n", __FUNCTION__, result);
521 #endif
522  } else {
523  requested = true;
524  }
525  }
526 
527  local_WlanFreeMemory(interfaceList);
528 
529  if (!requested) {
530  locker.unlock();
532  }
533 }
534 
536 {
537  QMutexLocker locker(&mutex);
538 
540 
541  if (!ptr)
543 
544  if (!ptr->isValid) {
548  } else if ((ptr->state & QNetworkConfiguration::Discovered) ==
553  } else if ((ptr->state & QNetworkConfiguration::Undefined) ==
556  }
557 
559 }
560 
561 QNetworkConfigurationManager::Capabilities QNativeWifiEngine::capabilities() const
562 {
565 }
566 
568 {
569  return new QNetworkSessionPrivateImpl;
570 }
571 
573 {
575 }
576 
578 {
579  if (handle != INVALID_HANDLE_VALUE)
580  return true;
581 
582  DWORD clientVersion;
583 
584  DWORD result = local_WlanOpenHandle(1, 0, &clientVersion, &handle);
585  if (result != ERROR_SUCCESS) {
586 #ifdef BEARER_MANAGEMENT_DEBUG
587  if (result != ERROR_SERVICE_NOT_ACTIVE)
588  qDebug("%s: WlanOpenHandle failed with error %ld\n", __FUNCTION__, result);
589 #endif
590 
591  return false;
592  }
593 
596  this, 0, 0);
597 #ifdef BEARER_MANAGEMENT_DEBUG
598  if (result != ERROR_SUCCESS)
599  qDebug("%s: WlanRegisterNotification failed with error %ld\n", __FUNCTION__, result);
600 #endif
601 
602  return handle != INVALID_HANDLE_VALUE;
603 }
604 
606 {
607  if (handle != INVALID_HANDLE_VALUE) {
609  handle = INVALID_HANDLE_VALUE;
610  }
611 }
612 
614 {
615  // On Windows XP SP2 and SP3 only connection and disconnection notifications are available.
616  // We need to poll for changes in available wireless networks.
617  return true;
618 }
619 
621 
622 #endif // QT_NO_BEARERMANAGEMENT
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qstring.cpp:6448
static QString fromWCharArray(const wchar_t *, int size=-1)
Returns a copy of the string, where the encoding of string depends on the size of wchar...
Definition: qstring.cpp:1019
QNativeWifiEngine(QObject *parent=0)
bool requiresPolling() const
double d
Definition: qnumeric_p.h:62
uint qHash(const QProcEnvKey &key)
Definition: qprocess_p.h:96
bool hasIdentifier(const QString &id)
DOT11_BSS_TYPE dot11BssType
Definition: platformdefs.h:227
Q_INVOKABLE void requestUpdate()
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
void lock()
Locks the mutex.
Definition: qmutex.cpp:151
WlanRegisterNotificationProto local_WlanRegisterNotification
#define WLAN_AVAILABLE_NETWORK_CONNECTED
Definition: platformdefs.h:54
WlanDisconnectProto local_WlanDisconnect
DOT11_BSSID_LIST * pDesiredBssidList
Definition: platformdefs.h:226
DWORD(WINAPI * WlanQueryInterfaceProto)(HANDLE hClientHandle, const GUID *pInterfaceGuid, WLAN_INTF_OPCODE OpCode, PVOID pReserved, PDWORD pdwDataSize, PVOID *ppData, WLAN_OPCODE_VALUE_TYPE *pWlanOpcodeValueType)
Definition: platformdefs.h:303
Definition: quuid.h:52
WCHAR strProfileName[WLAN_MAX_NAME_LENGTH]
Definition: platformdefs.h:156
void disconnectFromId(const QString &id)
ulong Data1
Definition: quuid.h:54
ushort toUShort(bool *ok=0, int base=10) const
Returns the string converted to an unsigned short using base base, which is 10 by default and must be...
Definition: qstring.cpp:6180
QNetworkConfiguration::StateFlags state
QNetworkSession::State sessionStateForId(const QString &id)
void configurationChanged(QNetworkConfigurationPrivatePointer config)
WLAN_CONNECTION_MODE wlanConnectionMode
Definition: platformdefs.h:223
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
QString toUpper() const Q_REQUIRED_RESULT
Returns an uppercase copy of the string.
Definition: qstring.cpp:5483
#define SLOT(a)
Definition: qobjectdefs.h:226
WlanOpenHandleProto local_WlanOpenHandle
void unlock()
Unlocks this mutex locker.
Definition: qmutex.h:117
void updateCompleted()
DWORD(WINAPI * WlanCloseHandleProto)(HANDLE hClientHandle, PVOID pReserved)
Definition: platformdefs.h:314
WlanQueryInterfaceProto local_WlanQueryInterface
WlanConnectProto local_WlanConnect
QNetworkSessionPrivate * createSessionBackend()
State
This enum describes the connectivity state of the session.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
VOID(WINAPI * WlanFreeMemoryProto)(PVOID pMemory)
Definition: platformdefs.h:313
#define WLAN_AVAILABLE_NETWORK_HAS_PROFILE
Definition: platformdefs.h:55
DWORD(WINAPI * WlanOpenHandleProto)(DWORD dwClientVersion, PVOID pReserved, PDWORD pdwNegotiatedVersion, PHANDLE phClientHandle)
Definition: platformdefs.h:292
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
UCHAR ucSSID[DOT11_SSID_MAX_LENGTH]
Definition: platformdefs.h:93
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
QNetworkConfiguration::BearerType bearerType
void(WINAPI * WLAN_NOTIFICATION_CALLBACK)(WLAN_NOTIFICATION_DATA *, PVOID)
Definition: platformdefs.h:289
WCHAR strProfileName[WLAN_MAX_NAME_LENGTH]
Definition: platformdefs.h:284
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
void relock()
Relocks an unlocked mutex locker.
Definition: qmutex.h:125
Q_CORE_EXPORT void qDebug(const char *,...)
DWORD(WINAPI * WlanConnectProto)(HANDLE hClientHandle, const GUID *pInterfaceGuid, const WLAN_CONNECTION_PARAMETERS *pConnectionParameters, PVOID pReserved)
Definition: platformdefs.h:306
#define SIGNAL(a)
Definition: qobjectdefs.h:227
WlanCloseHandleProto local_WlanCloseHandle
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
WlanGetAvailableNetworkListProto local_WlanGetAvailableNetworkList
QHash< QString, QNetworkConfigurationPrivatePointer > accessPointConfigurations
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
Definition: qstring.cpp:3664
DWORD(WINAPI * WlanGetAvailableNetworkListProto)(HANDLE hClientHandle, const GUID *pInterfaceGuid, DWORD dwFlags, PVOID pReserved, WLAN_AVAILABLE_NETWORK_LIST **ppAvailableNetworkList)
Definition: platformdefs.h:300
T takeFirst()
Removes the first item in the list and returns it.
Definition: qlist.h:489
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Definition: qobject.cpp:2580
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
#define emit
Definition: qobjectdefs.h:76
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
WLAN_INTERFACE_INFO InterfaceInfo[1]
Definition: platformdefs.h:88
void configurationAdded(QNetworkConfigurationPrivatePointer config)
void connectToId(const QString &id)
QNetworkConfigurationManager::Capabilities capabilities() const
static const char * data(const QByteArray &arr)
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
Definition: qstringlist.h:172
static void split(QT_FT_Vector *b)
QString right(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n rightmost characters of the string.
Definition: qstring.cpp:3682
const T * ptr(const T &t)
void unlock()
Unlocks the mutex.
Definition: qmutex.cpp:296
void qNotificationCallback(WLAN_NOTIFICATION_DATA *data, QNativeWifiEngine *d)
DWORD(WINAPI * WlanEnumInterfacesProto)(HANDLE hClientHandle, PVOID pReserved, WLAN_INTERFACE_INFO_LIST **ppInterfaceList)
Definition: platformdefs.h:298
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
Definition: qstring.cpp:3706
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
Definition: qmutex.h:101
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
Definition: qstring.cpp:7186
QExplicitlySharedDataPointer< QNetworkConfigurationPrivate > QNetworkConfigurationPrivatePointer
static QCoreApplication * instance()
Returns a pointer to the application&#39;s QCoreApplication (or QApplication) instance.
void clear()
Clears the contents of the string and makes it empty.
Definition: qstring.h:723
QNetworkConfiguration::Type type
#define WLAN_NOTIFICATION_SOURCE_ALL
Definition: platformdefs.h:53
uchar Data4[8]
Definition: quuid.h:57
void configurationRemoved(QNetworkConfigurationPrivatePointer config)
uint toUInt(bool *ok=0, int base=10) const
Returns the string converted to an unsigned int using base base, which is 10 by default and must be b...
Definition: qstring.cpp:6120
ushort Data3
Definition: quuid.h:56
Q_INVOKABLE void initialize()
ULONG uSSIDLength
Definition: platformdefs.h:92
QNetworkConfigurationPrivatePointer defaultConfiguration()
static bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType, QGenericReturnArgument ret, QGenericArgument val0=QGenericArgument(0), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument(), QGenericArgument val4=QGenericArgument(), QGenericArgument val5=QGenericArgument(), QGenericArgument val6=QGenericArgument(), QGenericArgument val7=QGenericArgument(), QGenericArgument val8=QGenericArgument(), QGenericArgument val9=QGenericArgument())
Invokes the member (a signal or a slot name) on the object obj.
DWORD(WINAPI * WlanScanProto)(HANDLE hClientHandle, const GUID *pInterfaceGuid, const DOT11_SSID *pDot11Ssid, const WLAN_RAW_DATA *pIeData, PVOID pReserved)
Definition: platformdefs.h:311
void connectionError(const QString &id, QBearerEngineImpl::ConnectionError error)
QString getInterfaceFromId(const QString &id)
WlanFreeMemoryProto local_WlanFreeMemory
DWORD(WINAPI * WlanRegisterNotificationProto)(HANDLE hClientHandle, DWORD dwNotifSource, BOOL bIgnoreDuplicate, WLAN_NOTIFICATION_CALLBACK funcCallback, PVOID pCallbackContext, PVOID pReserved, PDWORD pdwPrevNotifSource)
Definition: platformdefs.h:294
DWORD(WINAPI * WlanDisconnectProto)(HANDLE hClientHandle, const GUID *pInterfaceGuid, PVOID pReserved)
Definition: platformdefs.h:309
WlanScanProto local_WlanScan
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
ushort Data2
Definition: quuid.h:55
WlanEnumInterfacesProto local_WlanEnumInterfaces
#define WLAN_NOTIFICATION_SOURCE_ACM
Definition: platformdefs.h:52
const ushort * utf16() const
Returns the QString as a &#39;\0\&#39;-terminated array of unsigned shorts.
Definition: qstring.cpp:5290
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
Definition: qlist.h:770