summaryrefslogtreecommitdiffstats
path: root/src/wifi/qwifidevice.cpp
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@theqtcompany.com>2014-12-03 09:40:48 +0100
committerGatis Paeglis <gatis.paeglis@theqtcompany.com>2014-12-05 12:24:51 +0200
commit8d93772285f06f3e5239183a7fd8306c9d090930 (patch)
tree38525052e6497d7628214ae39a2d01705efe1505 /src/wifi/qwifidevice.cpp
parentdaa2a8fdaf6c3cd471b776ad1282b5d32549ffd0 (diff)
Wifi - c++/qml getting started guide and wifi doc update
c++ getting started guide qml getting started guide documenting qml elements documenting c++ classes Task-number: QTEE-810 Change-Id: I669d11c65e5359fc9ec863b03b8b56ce2ef1151b Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@theqtcompany.com> Reviewed-by: Kalle Viironen <kalle.viironen@theqtcompany.com>
Diffstat (limited to 'src/wifi/qwifidevice.cpp')
-rw-r--r--src/wifi/qwifidevice.cpp83
1 files changed, 32 insertions, 51 deletions
diff --git a/src/wifi/qwifidevice.cpp b/src/wifi/qwifidevice.cpp
index 4f100c4..f3eb62b 100644
--- a/src/wifi/qwifidevice.cpp
+++ b/src/wifi/qwifidevice.cpp
@@ -28,44 +28,25 @@
QT_BEGIN_NAMESPACE
/*!
- \qmltype WifiDevice
- \inqmlmodule QtWifi
- \ingroup wifi-qmltypes
- \brief Represents a physical device
-
- Use this element to query if a device is WiFi capable before attempting
- to use functionality of WifiManager.
-
- \qml
- import QtWifi 1.0
-
- GroupBox {
- id: wifiOptions
- title: "Wifi"
- visible: false
-
- Component.onCompleted: {
- if (WifiDevice.wifiSupported()) {
- var component = Qt.createComponent("WifiGroupBox.qml")
- var wifi = component.createObject(wifiOptions.contentItem)
- if (wifi)
- wifiOptions.visible = true
- } else {
- print("WiFi functionality not available on this device.")
- }
- }
+ \class QWifiDevice
+ \inmodule B2Qt.Wifi.Cpp
+ \ingroup wifi-cppclasses
+ \brief Represents a physical device.
+
+ Use this class to query if a device is Wifi capable, before attempting
+ to use the functionality of QWifiManager.
+
+ \code
+ QWifiManager *m_wifiManager = 0;
+ if (QWifiDevice::wifiSupported())
+ m_wifiManager = QWifiManager::instance();
+
+ if (m_wifiManager) {
+ m_wifiManager->start();
+ // and other wifi related code
}
- \endqml
-*/
-
-/*!
- \qmlmethod bool QWifiDevice::wifiSupported()
-
- Returns true if the device is WiFi capable - WiFi driver and firmware has been
- successfully loaded by the system, otherwise returns false.
-
- \sa wifiInterfaceName
-*/
+ \endcode
+ */
QWifiDevice::QWifiDevice()
{
@@ -75,6 +56,10 @@ QWifiDevice::~QWifiDevice()
{
}
+/*!
+ Returns \a true if a device is Wifi capable - Wifi driver and firmware has been
+ successfully loaded by the system, otherwise returns \a false.
+*/
bool QWifiDevice::wifiSupported()
{
#ifdef Q_OS_ANDROID_NO_SDK
@@ -108,18 +93,15 @@ bool QWifiDevice::wifiSupported()
}
/*!
- \fn QByteArray QWifiDevice::wifiInterfaceName()
-
- Returns WiFi interface name.
+ Returns Wifi interface name.
- \note On Android WiFi interface name is read from "wifi.interface" system property.
- On Linux WiFi interface name is read from B2QT_WIFI_INTERFACE environmental variable if
- it is set. The default interface name is "wlan0" if reading the designated places does not
- provide an interface name.
-
- /sa setWifiInterfaceName
-*/
+ \note On Android, the Wifi interface name is read from "wifi.interface"
+ system property. On Linux, it is read from the \c B2QT_WIFI_INTERFACE
+ environment variable if it is set, otherwise, the default interface
+ name ("\e{wlan0}") is used.
+ \sa setWifiInterfaceName()
+ */
QByteArray QWifiDevice::wifiInterfaceName()
{
QByteArray ifc;
@@ -135,11 +117,10 @@ QByteArray QWifiDevice::wifiInterfaceName()
}
/*!
- \fn void QWifiDevice::setWifiInterfaceName(const QByteArray &name)
-
- A conveniece method for settings WiFi interface name.
-*/
+ A conveniece method to set the Wifi interface name.
+ \sa wifiInterfaceName()
+ */
void QWifiDevice::setWifiInterfaceName(const QByteArray &name)
{
#ifdef Q_OS_ANDROID_NO_SDK