|
1 /* |
|
2 * Copyright (c) 2002-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 the License "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: Active object to send and receive management packets (EAP packets). |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef WLANMGMTFRAMEHANDLER_H |
|
20 #define WLANMGMTFRAMEHANDLER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include "RWlanLogicalChannel.h" |
|
24 #include "FrameXferBlock.h" |
|
25 #include "am_platform_libraries.h" |
|
26 |
|
27 class RWlanLogicalChannel; |
|
28 class MWlanMgmtPacket; |
|
29 |
|
30 /** |
|
31 * Callback interface |
|
32 */ |
|
33 class MWlanMgmtFrameCallback |
|
34 { |
|
35 public: |
|
36 virtual void OnFrameReceive( |
|
37 const TDataBuffer::TFrameType aFrameType, |
|
38 const TUint aLength, |
|
39 const TUint8* const aData, |
|
40 TUint8 aRcpi ) = 0; |
|
41 }; |
|
42 |
|
43 /** |
|
44 * Management packet handler. |
|
45 * Active object that waits for management packets from |
|
46 * driver side. |
|
47 * @since S60 v3.0 |
|
48 * @lib wlmserversrv.lib |
|
49 */ |
|
50 NONSHARABLE_CLASS( CWlanMgmtFrameHandler ) : public CActive |
|
51 { |
|
52 public: // Constructors and destructor |
|
53 |
|
54 /** |
|
55 * C++ default constructor. |
|
56 * @param aServiceProvider Interface to drivers. |
|
57 * @param aClient Interfce to client. |
|
58 */ |
|
59 CWlanMgmtFrameHandler( |
|
60 RWlanLogicalChannel& aServiceProvider, |
|
61 MWlanMgmtFrameCallback& aClient ); |
|
62 |
|
63 /** |
|
64 * Static constructor. |
|
65 * @param aServiceProvider Interface to drivers. |
|
66 * @param aClient Interfce to client. |
|
67 */ |
|
68 static CWlanMgmtFrameHandler* NewL( |
|
69 RWlanLogicalChannel& aServiceProvider, |
|
70 MWlanMgmtFrameCallback& aClient); |
|
71 |
|
72 /** |
|
73 * Destructor. |
|
74 */ |
|
75 virtual ~CWlanMgmtFrameHandler(); |
|
76 |
|
77 public: // New functions |
|
78 |
|
79 /** |
|
80 * Activate the handler |
|
81 * Handler starts to listen for received management frames |
|
82 * @since S60 v.3.1 |
|
83 * @return error code |
|
84 */ |
|
85 TInt Start(); |
|
86 |
|
87 /** |
|
88 * Deactivate the handler |
|
89 * Handler stops to listen for received management frames |
|
90 * @since S60 v.3.1 |
|
91 */ |
|
92 void Stop(); |
|
93 |
|
94 /** |
|
95 * Send management packet. |
|
96 * @param aFrameType The type of the frame to send. |
|
97 * @param aLength The length of sent data. |
|
98 * @param aData The sent data. |
|
99 * @param aUserPriority The user priority of the frame. |
|
100 * @param aDestination Destination MAC address. |
|
101 * @param aSendUnencrypted Whether the frame must be sent unencrypted. |
|
102 * @return error code |
|
103 */ |
|
104 TInt SendFrame( |
|
105 const TDataBuffer::TFrameType aFrameType, |
|
106 const TUint aLength, |
|
107 const TUint8* const aData, |
|
108 TUint8 aUserPriority, |
|
109 const TMacAddress& aDestination, |
|
110 TBool aSendUnencrypted ); |
|
111 |
|
112 public: // Functions from base classes |
|
113 |
|
114 /** |
|
115 * From CActive Is executed when synchronous request is ready. |
|
116 */ |
|
117 void RunL(); |
|
118 |
|
119 /** |
|
120 * From CActive Cancel synchronous request. |
|
121 */ |
|
122 void DoCancel(); |
|
123 |
|
124 private: // Functions |
|
125 |
|
126 /** |
|
127 * By default Symbian 2nd phase constructor is private. |
|
128 */ |
|
129 void ConstructL(); |
|
130 |
|
131 /** |
|
132 * Request a synchronous call for management packets. |
|
133 */ |
|
134 void IssueRequest(); |
|
135 |
|
136 private: // Data |
|
137 |
|
138 /** |
|
139 * Interface to receive packets. |
|
140 */ |
|
141 RWlanLogicalChannel& iServiceProvider; |
|
142 /** |
|
143 * Interface to forward packets. |
|
144 */ |
|
145 MWlanMgmtFrameCallback& iClient; |
|
146 /** |
|
147 * Data transfer buffer. Not owned by this pointer. |
|
148 */ |
|
149 RFrameXferBlock* iDataBlock; |
|
150 }; |
|
151 |
|
152 #endif // WLANMGMTFRAMEHANDLER_H |