summaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorKalle Viironen <kalle.viironen@digia.com>2014-07-04 09:51:36 +0300
committerKalle Viironen <kalle.viironen@digia.com>2014-07-04 09:51:40 +0300
commita0816ae05210bdfdd149cd67938f64b151fa23c0 (patch)
tree5bfd1eb1f3513444f536052809ee2032f29f503b /src/imports
parent5cdc15a7b82b7adfd4c5cae85ffb4327593dd076 (diff)
parent64164764fdfe9ed736b7367d573c0daa026b777f (diff)
Merge commit '64164764fdfe9ed736b7367d573c0daa026b777f' into releaseQtEE_v3.1.0
* commit '64164764fdfe9ed736b7367d573c0daa026b777f': Doc: ChangeLog for 3.1.0 release Doc: Android-specific instructions for Qt Creator Kit setup Doc: Add note about crash message when closing an application Fix #ifdef for Android detection Doc: Bump version to 3.1.0 Doc: Update the Supported Platforms page Doc: Fix path for sabre install doc: add documentation for Toradex Apalis iMX6 Doc: injection to eAndroid reference devices Fix Wifi issues on Android 4.4.2 Don't hardcode interface name in getIPAddress() Doc: Update the list of supported platforms Add plugins.qmltypes for Wi-Fi library Change-Id: I73af0af038f8bf9e5f10387b558c428f7a23461c
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/wifi/plugins.qmltypes60
-rw-r--r--src/imports/wifi/qmldir1
-rw-r--r--src/imports/wifi/qwifimanager.cpp13
3 files changed, 71 insertions, 3 deletions
diff --git a/src/imports/wifi/plugins.qmltypes b/src/imports/wifi/plugins.qmltypes
new file mode 100644
index 0000000..6667fcb
--- /dev/null
+++ b/src/imports/wifi/plugins.qmltypes
@@ -0,0 +1,60 @@
+import QtQuick.tooling 1.1
+
+// This file describes the plugin-supplied types contained in the library.
+// It is used for QML tooling purposes only.
+//
+// This file was auto-generated by:
+// 'qmlplugindump -nonrelocatable Qt.labs.wifi 0.1 /system/qml/Qt/labs/wifi/'
+
+Module {
+ Component {
+ name: "QWifiGlobal"
+ prototype: "QObject"
+ exports: ["Qt.labs.wifi/Interface 0.1"]
+ exportMetaObjectRevisions: [0]
+ Method { name: "wifiSupported"; type: "bool" }
+ }
+ Component {
+ name: "QWifiManager"
+ prototype: "QObject"
+ exports: ["Qt.labs.wifi/WifiManager 0.1"]
+ exportMetaObjectRevisions: [0]
+ Enum {
+ name: "NetworkState"
+ values: {
+ "Disconnected": 0,
+ "Authenticating": 1,
+ "HandshakeFailed": 2,
+ "ObtainingIPAddress": 3,
+ "DhcpRequestFailed": 4,
+ "Connected": 5
+ }
+ }
+ Property { name: "networkState"; type: "NetworkState"; isReadonly: true }
+ Property { name: "backendReady"; type: "bool"; isReadonly: true }
+ Property { name: "scanning"; type: "bool" }
+ Property { name: "connectedSSID"; type: "string"; isReadonly: true }
+ Property { name: "networks"; type: "QWifiNetworkListModel"; isReadonly: true; isPointer: true }
+ Signal {
+ name: "scanningChanged"
+ Parameter { name: "scanning"; type: "bool" }
+ }
+ Signal {
+ name: "networkStateChanged"
+ Parameter { name: "network"; type: "QWifiNetwork"; isPointer: true }
+ }
+ Signal {
+ name: "connectedSSIDChanged"
+ Parameter { name: "ssid"; type: "string" }
+ }
+ Method { name: "start" }
+ Method { name: "stop" }
+ Method {
+ name: "connect"
+ Parameter { name: "network"; type: "QWifiNetwork"; isPointer: true }
+ Parameter { name: "passphrase"; type: "string" }
+ }
+ Method { name: "disconnect" }
+ }
+ Component { name: "QWifiNetworkListModel"; prototype: "QAbstractListModel" }
+}
diff --git a/src/imports/wifi/qmldir b/src/imports/wifi/qmldir
index 4c36784..d4f65d9 100644
--- a/src/imports/wifi/qmldir
+++ b/src/imports/wifi/qmldir
@@ -1,2 +1,3 @@
module Qt.labs.wifi
plugin qwifimodule
+typeinfo plugins.qmltypes
diff --git a/src/imports/wifi/qwifimanager.cpp b/src/imports/wifi/qwifimanager.cpp
index 65073f1..8eec3e0 100644
--- a/src/imports/wifi/qwifimanager.cpp
+++ b/src/imports/wifi/qwifimanager.cpp
@@ -618,14 +618,21 @@ QByteArray QWifiManager::call(const char *command) const
{
char data[2048];
size_t len = sizeof(data) - 1; // -1: room to add a 0-terminator
- if (q_wifi_command(m_interface.constData(), command, data, &len) < 0) {
- qWarning("QWifiManager: call failed: %s", command);
+ QByteArray cmd;
+#ifdef Q_OS_ANDROID
+#if !(Q_ANDROID_VERSION_MAJOR == 4 && Q_ANDROID_VERSION_MINOR < 4)
+ cmd.append("IFNAME=").append(m_interface).append(" ");
+#endif
+#endif
+ cmd.append(command);
+ if (q_wifi_command(m_interface.constData(), cmd.constData(), data, &len) < 0) {
+ qWarning("QWifiManager: call failed: %s", cmd.constData());
return QByteArray();
}
if (len < sizeof(data))
data[len] = 0;
QByteArray result = QByteArray::fromRawData(data, len);
- if (QT_WIFI_DEBUG) qDebug("QWifiManager::call: %s ==>\n%s", command, result.constData());
+ if (QT_WIFI_DEBUG) qDebug("QWifiManager::call: %s ==>\n%s", cmd.constData(), result.constData());
return result;
}