|
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent |
|
19 @released since 399 |
|
20 */ |
|
21 |
|
22 #ifndef CS_CONNECTION_SERV_IMPL_H |
|
23 #define CS_CONNECTION_SERV_IMPL_H |
|
24 |
|
25 #include <e32std.h> |
|
26 #include <es_sock.h> |
|
27 #include <comms-infras/es_connectionserv.h> |
|
28 #include <comms-infras/cs_connservparams.h> |
|
29 #include <comms-infras/cs_connservparams_internal.h> |
|
30 |
|
31 namespace ConnectionServ |
|
32 { |
|
33 |
|
34 const TUint KInitialBufferSize = 1024; // bytes |
|
35 |
|
36 class CConnectionServImpl; |
|
37 |
|
38 class CAccessPointStatusRequest : public CActive |
|
39 /** |
|
40 Handles the 2 RPC calls required by the Access Point status call. |
|
41 */ |
|
42 { |
|
43 protected: |
|
44 // constructor |
|
45 CAccessPointStatusRequest(CConnectionServImpl& aImpl); |
|
46 |
|
47 public: |
|
48 ~CAccessPointStatusRequest(); |
|
49 |
|
50 static CAccessPointStatusRequest* NewL(CConnectionServImpl& aImpl); |
|
51 void ConstructL(); |
|
52 void Start(const CConnectionServParameterBundle& aQuery, CConnectionServParameterBundle& aResult, TRequestStatus& aStatus); |
|
53 void DoCancel(); |
|
54 void RunL(); |
|
55 TInt RunError(TInt aError); |
|
56 void CompleteClientRequest(TInt aError); |
|
57 |
|
58 |
|
59 private: |
|
60 CConnectionServImpl& iConnectionServImpl; |
|
61 |
|
62 TInt iSentRequest; |
|
63 |
|
64 RBuf8 iQueryBuffer; |
|
65 TInt iResultBufferSize; |
|
66 RBuf8 iResultBuffer; |
|
67 |
|
68 // pointer to bundle to populate (created by caller) |
|
69 CConnectionServParameterBundle* iResult; |
|
70 |
|
71 TRequestStatus* iClientRequest; |
|
72 }; |
|
73 |
|
74 class CAccessPointNotificationRequest : public CActive |
|
75 /** |
|
76 Handles the 1 or 2 RPC calls required by each access point notification. |
|
77 */ |
|
78 { |
|
79 protected: |
|
80 // constructor |
|
81 CAccessPointNotificationRequest(CConnectionServImpl& aImpl); |
|
82 |
|
83 public: |
|
84 static CAccessPointNotificationRequest* NewL(CConnectionServImpl& aImpl); |
|
85 void ConstructL(); |
|
86 void Start(const CConnectionServParameterBundle& aQuery, MAccessPointNotificationObserver& aObserver); |
|
87 void DoCancel(); |
|
88 void RunL(); |
|
89 TInt RunError(TInt aError); |
|
90 |
|
91 private: |
|
92 CConnectionServImpl& iConnectionServImpl; |
|
93 |
|
94 TInt iSentRequest; |
|
95 |
|
96 RBuf8 iQueryBuffer; |
|
97 TInt iResultBufferSize; |
|
98 RBuf8 iResultBuffer; |
|
99 |
|
100 MAccessPointNotificationObserver* iObserver; |
|
101 }; |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 class CConnectionServImpl : public CBase |
|
107 /** |
|
108 Proxy class for all the interesting functions which need delegate active objects to work asynchronously |
|
109 */ |
|
110 { |
|
111 protected: |
|
112 // constructor |
|
113 CConnectionServImpl(RConnectionServ& aCS); |
|
114 |
|
115 public: |
|
116 // destructor |
|
117 ~CConnectionServImpl(); |
|
118 |
|
119 static CConnectionServImpl* NewL(RConnectionServ& aCS); |
|
120 |
|
121 void AccessPointStatusQuery(const CConnectionServParameterBundle& aQuery, CConnectionServParameterBundle& aResult, TRequestStatus& aStatus); |
|
122 void CancelAccessPointStatusQuery(); |
|
123 void AccessPointNotification(const CConnectionServParameterBundle& aQuery, MAccessPointNotificationObserver& aObserver); |
|
124 void CancelAccessPointNotification(); |
|
125 |
|
126 inline TInt Send(TInt aFunction,const TIpcArgs& aArgs) const; |
|
127 inline void SendReceive(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const; |
|
128 inline TInt SendReceive(TInt aFunction,const TIpcArgs& aArgs) const; |
|
129 inline TInt Send(TInt aFunction) const; |
|
130 inline void SendReceive(TInt aFunction,TRequestStatus& aStatus) const; |
|
131 inline TInt SendReceive(TInt aFunction) const; |
|
132 |
|
133 static TInt EnsureBufferIsBigEnough(RBuf8& aBuf, TUint aLen); |
|
134 |
|
135 private: |
|
136 RConnectionServ& iConnectionServ; |
|
137 |
|
138 CAccessPointStatusRequest* iAccessPointStatusRequest; |
|
139 CAccessPointNotificationRequest* iAccessPointNotificationRequest; |
|
140 }; |
|
141 |
|
142 } // namespace ConnectionServ |
|
143 |
|
144 |
|
145 #include "cs_connectionservimpl.inl" |
|
146 |
|
147 #endif // ES_CONNECTION_SERV_IMPL_H |
|
148 |