|
1 /* |
|
2 * Copyright (c) 2010 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 * WLAN Management API stubbing for WLAN Qt Utilities. |
|
16 */ |
|
17 |
|
18 #include <QTest> |
|
19 |
|
20 #include <e32std.h> |
|
21 #include <e32base.h> |
|
22 #include <e32cmn.h> |
|
23 #include "wlanmgmtclient.h" |
|
24 #include "testwlanwizardcontext.h" |
|
25 |
|
26 // --------------------------------------------------------- |
|
27 // CWlanScanRequest::NewL |
|
28 // --------------------------------------------------------- |
|
29 // |
|
30 CWlanMgmtClient* CWlanMgmtClient::NewL() |
|
31 { |
|
32 CWlanMgmtClient* self = new CWlanMgmtClient; |
|
33 |
|
34 TestWlanWizardContext::setWlanMgmtClientObject(self); |
|
35 return self; |
|
36 } |
|
37 |
|
38 // --------------------------------------------------------- |
|
39 // CWlanScanRequest::~CWlanMgmtClient |
|
40 // --------------------------------------------------------- |
|
41 // |
|
42 CWlanMgmtClient::~CWlanMgmtClient() |
|
43 { |
|
44 delete iResults; |
|
45 } |
|
46 |
|
47 // --------------------------------------------------------- |
|
48 // CWlanScanRequest::CWlanMgmtClient |
|
49 // --------------------------------------------------------- |
|
50 // |
|
51 CWlanMgmtClient::CWlanMgmtClient() |
|
52 { |
|
53 iResults = new (ELeave) CArrayFixSeg<TWlanProtectedSetupCredentialAttribute> (4); |
|
54 } |
|
55 |
|
56 // --------------------------------------------------------- |
|
57 // CWlanScanRequest::RunProtectedSetup |
|
58 // --------------------------------------------------------- |
|
59 // |
|
60 void CWlanMgmtClient::RunProtectedSetup( |
|
61 TRequestStatus& aStatus, |
|
62 const TWlanSsid& aSsid, |
|
63 const TWlanWpsPin& aWpsPin, |
|
64 CArrayFixSeg<TWlanProtectedSetupCredentialAttribute>& aCredentials ) |
|
65 { |
|
66 Q_UNUSED(aWpsPin); |
|
67 QCOMPARE(aSsid, iSsid); |
|
68 for (int i = 0 ; i < iResults->Count() ; ++i){ |
|
69 aCredentials.AppendL(iResults->At(i)); |
|
70 } |
|
71 User::RequestComplete(&aStatus, iCompletionCode); |
|
72 } |
|
73 |
|
74 // --------------------------------------------------------- |
|
75 // CWlanScanRequest::CancelProtectedSetup |
|
76 // --------------------------------------------------------- |
|
77 // |
|
78 void CWlanMgmtClient::CancelProtectedSetup() |
|
79 { |
|
80 // TODO |
|
81 //User::RequestComplete(iStubRequestStatus, KErrCancel); |
|
82 //iStubRequestStatus = 0; |
|
83 } |