|
1 /* |
|
2 * Copyright (c) 2002-2006 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: Implementation of WLAN Agent |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 8 % |
|
20 */ |
|
21 |
|
22 #include "am_debug.h" |
|
23 #include "wlanagt.h" |
|
24 #include "wlanagtsm.h" |
|
25 |
|
26 // WLAN bearer type |
|
27 const TUint32 KWlanAgentBearerType = 0x3C; |
|
28 |
|
29 // |
|
30 // First ordinal export |
|
31 // |
|
32 extern "C" EXPORT_C CNifAgentFactory* NewAgentFactoryL() |
|
33 { |
|
34 return new(ELeave) CWlanAgentFactory; |
|
35 } |
|
36 |
|
37 // ======== WLAN agent factory MEMBER FUNCTIONS ======== |
|
38 |
|
39 // --------------------------------------------------------------------------- |
|
40 // CWlanAgentFactory::InstallL |
|
41 // --------------------------------------------------------------------------- |
|
42 // |
|
43 void CWlanAgentFactory::InstallL() |
|
44 { |
|
45 } |
|
46 |
|
47 // --------------------------------------------------------------------------- |
|
48 // CWlanAgentFactory::NewAgentL |
|
49 // --------------------------------------------------------------------------- |
|
50 // |
|
51 CNifAgentBase* CWlanAgentFactory::NewAgentL(const TDesC& /*aName*/) |
|
52 { |
|
53 DEBUG( "CWlanAgentFactory::NewAgentL()" ); |
|
54 return CWlanAgent::NewL(); |
|
55 } |
|
56 |
|
57 // --------------------------------------------------------------------------- |
|
58 // CWlanAgentFactory::Info |
|
59 // --------------------------------------------------------------------------- |
|
60 // |
|
61 TInt CWlanAgentFactory::Info( |
|
62 TNifAgentInfo& aInfo, |
|
63 TInt /*aIndex*/) const |
|
64 { |
|
65 aInfo.iName = KWlanAgentName; |
|
66 aInfo.iName.AppendFormat(_L("-AgentFactory[0x%08x]"), this); |
|
67 aInfo.iVersion = TVersion(KMajorVersionNumber,KMinorVersionNumber,KBuildVersionNumber); |
|
68 return KErrNone; |
|
69 } |
|
70 |
|
71 // ======== WLAN agent MEMBER FUNCTIONS ======== |
|
72 |
|
73 // --------------------------------------------------------------------------- |
|
74 // CWlanAgent::CWlanAgent |
|
75 // --------------------------------------------------------------------------- |
|
76 // |
|
77 CWlanAgent::CWlanAgent() |
|
78 { |
|
79 } |
|
80 |
|
81 // --------------------------------------------------------------------------- |
|
82 // CWlanAgent::CWlanAgent |
|
83 // --------------------------------------------------------------------------- |
|
84 // |
|
85 CWlanAgent::~CWlanAgent() |
|
86 { |
|
87 } |
|
88 |
|
89 // --------------------------------------------------------------------------- |
|
90 // CWlanAgent::CWlanAgent |
|
91 // --------------------------------------------------------------------------- |
|
92 // |
|
93 CWlanAgent* CWlanAgent::NewL() |
|
94 { |
|
95 CWlanAgent* self = new (ELeave) CWlanAgent(); |
|
96 CleanupStack::PushL( self ); |
|
97 self->ConstructL(); |
|
98 CleanupStack::Pop( self ); |
|
99 return self; |
|
100 } |
|
101 |
|
102 // --------------------------------------------------------------------------- |
|
103 // CWlanAgent::CWlanAgent |
|
104 // --------------------------------------------------------------------------- |
|
105 // |
|
106 void CWlanAgent::ConstructL() |
|
107 { |
|
108 CStateMachineAgentBase::ConstructL(); |
|
109 } |
|
110 |
|
111 // --------------------------------------------------------------------------- |
|
112 // CWlanAgent::CWlanAgent |
|
113 // --------------------------------------------------------------------------- |
|
114 // |
|
115 CAgentSMBase* CWlanAgent::CreateAgentSML( |
|
116 MAgentNotify& aObserver, |
|
117 CDialogProcessor* aDlgPrc, |
|
118 CCommsDbAccess& aDbAccess, |
|
119 TCommDbConnectionDirection aDirection ) |
|
120 { |
|
121 if( aDirection == ECommDbConnectionDirectionIncoming ) |
|
122 { |
|
123 User::Leave( KErrNotSupported ); |
|
124 } |
|
125 |
|
126 return CWlanSM::NewL( aObserver, aDlgPrc, aDbAccess ); |
|
127 } |
|
128 |
|
129 // --------------------------------------------------------------------------- |
|
130 // CWlanAgent::CWlanAgent |
|
131 // --------------------------------------------------------------------------- |
|
132 // |
|
133 void CWlanAgent::Info( TNifAgentInfo& aInfo ) const |
|
134 { |
|
135 aInfo.iName = KWlanAgentName; |
|
136 aInfo.iName.AppendFormat(_L("-Agent[0x%08x]"), this); |
|
137 aInfo.iVersion = TVersion(KMajorVersionNumber,KMinorVersionNumber,KBuildVersionNumber); |
|
138 } |
|
139 |
|
140 // --------------------------------------------------------------------------- |
|
141 // CWlanAgent::GetBearerInfo |
|
142 // --------------------------------------------------------------------------- |
|
143 // |
|
144 TUint32 CWlanAgent::GetBearerInfo() const |
|
145 { |
|
146 return KWlanAgentBearerType; |
|
147 } |