author | hgs |
Thu, 27 May 2010 10:28:52 +0300 | |
changeset 32 | 5bbf13e885a0 |
parent 31 | e8f4211554fb |
child 39 | 7b3e49e4608a |
permissions | -rw-r--r-- |
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
31 | 2 |
* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). |
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: |
31 | 15 |
* Wrapper for Symbian Connection Monitor library. |
16 |
*/ |
|
17 |
||
18 |
// System includes |
|
19 |
||
20 |
#include <QSharedPointer> |
|
21 |
#include <QScopedPointer> |
|
22 |
||
23 |
// User includes |
|
24 |
||
25 |
#include "wlanqtutilsconmonwrapperdisconnect_s60_p.h" |
|
26 |
#include "wlanqtutilsconmonwrapperinfo_s60_p.h" |
|
27 |
#include "wlanqtutilsconmonwrapperscan_s60_p.h" |
|
28 |
#include "wlanqtutilsconmonwrapper.h" |
|
29 |
||
30 |
/*! |
|
31 |
\class WlanQtUtilsConMonWrapper |
|
32 |
\brief Wrapper for Symbian Connection Monitor library. |
|
33 |
||
34 |
Provides functionality to scan WLAN networks, to retrieve connection |
|
35 |
information, and to disconnect connections. |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
*/ |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
|
31 | 38 |
// External function prototypes |
39 |
||
40 |
// Local constants |
|
41 |
||
42 |
// ======== LOCAL FUNCTIONS ======== |
|
43 |
||
44 |
// ======== MEMBER FUNCTIONS ======== |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
|
31 | 46 |
/*! |
47 |
Constructor. |
|
48 |
||
49 |
@param [in] parent Parent object. |
|
50 |
*/ |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
|
31 | 52 |
WlanQtUtilsConMonWrapper::WlanQtUtilsConMonWrapper(QObject *parent) : |
53 |
QObject(parent), |
|
54 |
d_ptrScan(new WlanQtUtilsConMonWrapperScan(this)), |
|
55 |
d_ptrInfo(new WlanQtUtilsConMonWrapperInfo(this)), |
|
56 |
d_ptrDisconnect(new WlanQtUtilsConMonWrapperDisconnect(this)) |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
57 |
{ |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
58 |
} |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
59 |
|
31 | 60 |
/*! |
61 |
Destructor. |
|
62 |
*/ |
|
63 |
||
64 |
WlanQtUtilsConMonWrapper::~WlanQtUtilsConMonWrapper() |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
65 |
{ |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
66 |
} |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
67 |
|
31 | 68 |
/*! |
69 |
Start a WLAN scan. |
|
70 |
*/ |
|
71 |
||
72 |
void WlanQtUtilsConMonWrapper::scanAvailableWlanAPs() |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
73 |
{ |
31 | 74 |
d_ptrScan->ScanAvailableWlanAPs(); |
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
75 |
} |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
76 |
|
31 | 77 |
/*! |
78 |
Stop a (possibly) ongoing WLAN scan. |
|
79 |
*/ |
|
80 |
||
81 |
void WlanQtUtilsConMonWrapper::stopScan() |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
82 |
{ |
31 | 83 |
d_ptrScan->StopScan(); |
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
84 |
} |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
85 |
|
31 | 86 |
/*! |
87 |
Return active connection information. |
|
88 |
||
89 |
@return Information of active connection, 0 if not found. |
|
90 |
*/ |
|
91 |
||
92 |
WlanQtUtilsConnection *WlanQtUtilsConMonWrapper::activeConnection() const |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
93 |
{ |
31 | 94 |
return d_ptrInfo->ActiveConnection(); |
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
95 |
} |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
96 |
|
31 | 97 |
/*! |
98 |
Returns information of a connection with the given connection ID. |
|
99 |
||
100 |
@param [in] connectionId Connection ID. |
|
101 |
||
102 |
@return Information of the given connection, 0 if not found. |
|
103 |
*/ |
|
104 |
||
105 |
WlanQtUtilsConnection* WlanQtUtilsConMonWrapper::connectionInfo( |
|
106 |
uint connectionId) const |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
107 |
{ |
31 | 108 |
return d_ptrInfo->ConnectionInfo(connectionId); |
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
109 |
} |
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
110 |
|
31 | 111 |
/*! |
112 |
Stops given connection regardless of how many applications are using it. |
|
113 |
||
114 |
@param [in] iapId IAP ID to disconnect. |
|
115 |
*/ |
|
116 |
||
117 |
void WlanQtUtilsConMonWrapper::disconnectIap(int iapId) |
|
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
118 |
{ |
31 | 119 |
d_ptrDisconnect->DisconnectConnection(iapId); |
19
10810c91db26
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
120 |
} |