39
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*/
|
|
16 |
|
|
17 |
|
|
18 |
#include "wlanqtutils_context.h"
|
|
19 |
#include "wlanqtutils.h"
|
|
20 |
#include "wlanqtutilsap.h"
|
|
21 |
|
|
22 |
WlanQtUtilsContext::WlanQtUtilsContext(WlanQtUtils *utils )
|
|
23 |
: mUtils(utils)
|
|
24 |
{
|
|
25 |
|
|
26 |
|
|
27 |
}
|
|
28 |
|
|
29 |
WlanQtUtilsContext::~WlanQtUtilsContext()
|
|
30 |
{
|
|
31 |
|
|
32 |
}
|
|
33 |
|
|
34 |
void WlanQtUtilsContext::setScanWlanApsResult(
|
|
35 |
QList<QSharedPointer<WlanQtUtilsAp> > result )
|
|
36 |
{
|
|
37 |
mUtils->mScanWlanAps = result;
|
|
38 |
}
|
|
39 |
|
|
40 |
void WlanQtUtilsContext::setScanWlanDirectResult( QString ssid,
|
|
41 |
QList<QSharedPointer<WlanQtUtilsAp> > result )
|
|
42 |
{
|
|
43 |
mUtils->mScanWlanDirectSsid = ssid;
|
|
44 |
mUtils->mScanWlanDirect = result;
|
|
45 |
}
|
|
46 |
|
|
47 |
void WlanQtUtilsContext::setCreateWlanIapResult(int iapId)
|
|
48 |
{
|
|
49 |
mUtils->mCreateWlanIapReturn = iapId;
|
|
50 |
mUtils->mActiveWlanIapReturn = iapId;
|
|
51 |
}
|
|
52 |
|
|
53 |
void WlanQtUtilsContext::setActiveWlanIapResult(int iapId)
|
|
54 |
{
|
|
55 |
mUtils->mActiveWlanIapReturn = iapId;
|
|
56 |
}
|
|
57 |
|
|
58 |
void WlanQtUtilsContext::setUpdateWlanIapResult(bool returnValue)
|
|
59 |
{
|
|
60 |
mUtils->mUpdateWlanIapReturn = returnValue;
|
|
61 |
}
|
|
62 |
|
|
63 |
void WlanQtUtilsContext::setConnectionSuccessed(bool value)
|
|
64 |
{
|
|
65 |
mUtils->mConnectionSuccess = value;
|
|
66 |
}
|
|
67 |
|
|
68 |
void WlanQtUtilsContext::setSignalWlanNetworkOpened(int iapId)
|
|
69 |
{
|
|
70 |
mUtils->mWlanNetworkOpenedIapId = iapId;
|
|
71 |
}
|
|
72 |
|
|
73 |
void WlanQtUtilsContext::setSignalWlanNetworkClosed(int iapId, int reason)
|
|
74 |
{
|
|
75 |
mUtils->mWlanNetworkClosedIapId = iapId;
|
|
76 |
mUtils->mWlanNetworkClosedReason = reason;
|
|
77 |
}
|
|
78 |
|
|
79 |
void WlanQtUtilsContext::setSignalIctResult(int iapId, WlanQtUtils::IctStatus result)
|
|
80 |
{
|
|
81 |
mUtils->mIctResultIapId = iapId;
|
|
82 |
mUtils->mIctResultResults = result;
|
|
83 |
}
|
|
84 |
|
|
85 |
void WlanQtUtilsContext::setScanApStatus(int status)
|
|
86 |
{
|
|
87 |
mUtils->mScanApStatus = status;
|
|
88 |
}
|
|
89 |
|
|
90 |
void WlanQtUtilsContext::setScanDirectStatus(int status)
|
|
91 |
{
|
|
92 |
mUtils->mScanDirectStatus = status;
|
|
93 |
}
|
|
94 |
|
|
95 |
void WlanQtUtilsContext::setImmediateApScanResult(bool immediate)
|
|
96 |
{
|
|
97 |
mUtils->mEmitScanApReady = immediate;
|
|
98 |
}
|
|
99 |
|
|
100 |
void WlanQtUtilsContext::emitScanApReady()
|
|
101 |
{
|
|
102 |
mUtils->emitScanApsReady();
|
|
103 |
}
|
|
104 |
|
|
105 |
QStringList WlanQtUtilsContext::calledMethods()
|
|
106 |
{
|
|
107 |
QStringList methods = mUtils->mCalledMethods;
|
|
108 |
mUtils->mCalledMethods.clear();
|
|
109 |
return methods;
|
|
110 |
}
|
|
111 |
|
|
112 |
bool WlanQtUtilsContext::verifyWlanIapSettings(WlanQtUtilsAp &ref)
|
|
113 |
{
|
|
114 |
bool ret = true;
|
|
115 |
if (!mUtils->mWlanAp){
|
|
116 |
qWarning("WlanQtUtilsContext::verifyWlanIapSettings: iap not created");
|
|
117 |
ret = false;
|
|
118 |
}
|
|
119 |
|
|
120 |
if (!(*(mUtils->mWlanAp) == ref)){
|
|
121 |
qWarning("WlanQtUtilsContext::verifyWlanIapSettings: settings does not match");
|
|
122 |
ret = false;
|
|
123 |
}
|
|
124 |
return ret;
|
|
125 |
}
|
|
126 |
|
|
127 |
void WlanQtUtilsContext::emitWlanNetworkOpened(int iapId)
|
|
128 |
{
|
|
129 |
emit mUtils->wlanNetworkOpened(iapId);
|
|
130 |
}
|
|
131 |
|
|
132 |
void WlanQtUtilsContext::emitWlanNetworkClosed(int iapId, int reason)
|
|
133 |
{
|
|
134 |
emit mUtils->wlanNetworkClosed(iapId, reason);
|
|
135 |
}
|