williamr@2
|
1 |
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@4
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@4
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
//
|
williamr@2
|
15 |
|
williamr@2
|
16 |
/**
|
williamr@2
|
17 |
@file
|
williamr@2
|
18 |
@publishedAll
|
williamr@2
|
19 |
@released
|
williamr@2
|
20 |
*/
|
williamr@2
|
21 |
|
williamr@2
|
22 |
#ifndef REMCONINTERFACESELECTOR_H
|
williamr@2
|
23 |
#define REMCONINTERFACESELECTOR_H
|
williamr@2
|
24 |
|
williamr@2
|
25 |
#include <e32base.h>
|
williamr@2
|
26 |
#include <remcon/messagetype.h>
|
williamr@2
|
27 |
#include <remcon/clienttype.h>
|
williamr@4
|
28 |
#include <remcon/playertype.h>
|
williamr@2
|
29 |
#include <remcon/remconinterfaceif.h>
|
williamr@2
|
30 |
#include <remconaddress.h>
|
williamr@2
|
31 |
|
williamr@2
|
32 |
class CRemConInterfaceBase;
|
williamr@4
|
33 |
class CBulkReceiver;
|
williamr@2
|
34 |
class CReceiver;
|
williamr@2
|
35 |
class MRemConErrorObserver;
|
williamr@4
|
36 |
class RRemConInterfaceFeatures;
|
williamr@4
|
37 |
class RSpecificThreadCallBack;
|
williamr@4
|
38 |
class CRemConInterfaceDetailsArray;
|
williamr@4
|
39 |
class RNestableLock;
|
williamr@4
|
40 |
class RRemConController;
|
williamr@4
|
41 |
class RRemConTarget;
|
williamr@4
|
42 |
class RRemConBulk;
|
williamr@4
|
43 |
class RRemCon;
|
williamr@2
|
44 |
|
williamr@2
|
45 |
// Panic information
|
williamr@2
|
46 |
_LIT(KRemConIfSelPanicCat, "RemConIfSel");
|
williamr@2
|
47 |
enum
|
williamr@2
|
48 |
{
|
williamr@2
|
49 |
/** The client has given a bad message type. */
|
williamr@2
|
50 |
ERemConIfSelBadMessageType = 0,
|
williamr@2
|
51 |
|
williamr@2
|
52 |
/** The client has already called OpenTargetL successfully.
|
williamr@2
|
53 |
|
williamr@2
|
54 |
This is no longer an illegal condition and so the panic will never
|
williamr@2
|
55 |
be raised.
|
williamr@2
|
56 |
*/
|
williamr@2
|
57 |
ERemConIfSelTargetSessionAlreadyExists = 1,
|
williamr@2
|
58 |
|
williamr@2
|
59 |
/** The client has already called OpenControllerL successfully.
|
williamr@2
|
60 |
|
williamr@2
|
61 |
This is no longer an illegal condition and so the panic will never
|
williamr@2
|
62 |
be raised.
|
williamr@2
|
63 |
*/
|
williamr@2
|
64 |
ERemConIfSelControllerSessionAlreadyExists = 2,
|
williamr@2
|
65 |
|
williamr@2
|
66 |
/** The client has created (and registered) an outer layer interface of a
|
williamr@2
|
67 |
type which is already registered. */
|
williamr@2
|
68 |
ERemConIfSelInterfaceOfThatTypeAlreadyRegistered = 3,
|
williamr@2
|
69 |
|
williamr@2
|
70 |
/** The client has not offended- there is a defect in some layer of the
|
williamr@2
|
71 |
Remote Control system. */
|
williamr@2
|
72 |
ERemConIfSelInternalError = 4,
|
williamr@2
|
73 |
|
williamr@2
|
74 |
/** An outer-layer interface has been instantiated (and registered with
|
williamr@2
|
75 |
the intermediate layer) after OpenControllerL or OpenTargetL has been
|
williamr@2
|
76 |
successfully called. */
|
williamr@2
|
77 |
ERemConIfSelTardyInterfaceRegistration = 5,
|
williamr@2
|
78 |
|
williamr@2
|
79 |
/** OpenControllerL has not successfully been called before using an API
|
williamr@2
|
80 |
which expects a controller session to have been created. */
|
williamr@2
|
81 |
ERemConIfSelNoControllerSession = 6,
|
williamr@2
|
82 |
|
williamr@2
|
83 |
/** OpenTargetL has not successfully been called before using an API which
|
williamr@2
|
84 |
expects a target session to have been created. */
|
williamr@2
|
85 |
ERemConIfSelNoTargetSession = 7,
|
williamr@2
|
86 |
|
williamr@2
|
87 |
/** Neither OpenControllerL not OpenTargetL has been successfully called
|
williamr@2
|
88 |
before using an API which expects either a controller or a target session
|
williamr@2
|
89 |
to have been created. */
|
williamr@2
|
90 |
ERemConIfSelNoSession = 8,
|
williamr@2
|
91 |
|
williamr@2
|
92 |
/** An outer layer DLL has instantiated CRemConInterfaceBase with an
|
williamr@2
|
93 |
illegal client type. */
|
williamr@2
|
94 |
ERemConIfSelUndefinedClientType = 9,
|
williamr@2
|
95 |
|
williamr@2
|
96 |
/** An implementation of CRemConInterfaceBase::GetInterface does not
|
williamr@2
|
97 |
provide an implementation of MRemConInterfaceIf. */
|
williamr@2
|
98 |
ERemConIfSelNoInterfaceImplementation = 10,
|
williamr@4
|
99 |
|
williamr@4
|
100 |
/** A client has created bulk interfaces in multiple different threads,
|
williamr@4
|
101 |
all bulk interfaces must be created in the same thread*/
|
williamr@4
|
102 |
ERemConIfSelMultipleBulkInterfaceThreads = 11,
|
williamr@2
|
103 |
};
|
williamr@2
|
104 |
|
williamr@2
|
105 |
/**
|
williamr@2
|
106 |
CRemConInterfaceSelector is only instantiable via its NewL function. It is not
|
williamr@2
|
107 |
derivable.
|
williamr@2
|
108 |
*/
|
williamr@2
|
109 |
NONSHARABLE_CLASS(CRemConInterfaceSelector) : public CBase
|
williamr@2
|
110 |
{
|
williamr@2
|
111 |
public:
|
williamr@2
|
112 |
/**
|
williamr@2
|
113 |
Factory method.
|
williamr@2
|
114 |
@return Ownership of a new CRemConInterfaceSelector.
|
williamr@2
|
115 |
*/
|
williamr@2
|
116 |
IMPORT_C static CRemConInterfaceSelector* NewL();
|
williamr@2
|
117 |
|
williamr@2
|
118 |
/** Destructor. */
|
williamr@2
|
119 |
IMPORT_C ~CRemConInterfaceSelector();
|
williamr@2
|
120 |
|
williamr@2
|
121 |
public:
|
williamr@2
|
122 |
/**
|
williamr@2
|
123 |
Register the interface with the selector. This is called by the
|
williamr@2
|
124 |
interface's BaseConstructL. Takes ownership of aInterface.
|
williamr@2
|
125 |
This function is not to be called outside of remconinterfacebase.dll. It is available for compatibility with previous
|
williamr@2
|
126 |
versions, but it is intended to be called only by CRemConInterfaceBase::BaseConstructL.
|
williamr@2
|
127 |
CRemConInterfaceBase-derived classes should indirectly perform a RegisterInterfaceL, by calling
|
williamr@2
|
128 |
CRemConInterfaceBase::BaseConstructL from their construction functions.
|
williamr@2
|
129 |
@param aInterface The interface.
|
williamr@2
|
130 |
*/
|
williamr@2
|
131 |
IMPORT_C void RegisterInterfaceL(CRemConInterfaceBase& aInterface);
|
williamr@2
|
132 |
|
williamr@4
|
133 |
/**
|
williamr@4
|
134 |
Register the interface with the selector. This is called by the
|
williamr@4
|
135 |
interface's BaseConstructL. Takes ownership of aInterface.
|
williamr@4
|
136 |
This function is not to be called outside of remconinterfacebase.dll. It is available for compatibility with previous
|
williamr@4
|
137 |
versions, but it is intended to be called only by CRemConInterfaceBase::BaseConstructL.
|
williamr@4
|
138 |
CRemConInterfaceBase-derived classes should indirectly perform a RegisterInterfaceL, by calling
|
williamr@4
|
139 |
CRemConInterfaceBase::BaseConstructL from their construction functions.
|
williamr@4
|
140 |
@param aInterface The interface.
|
williamr@4
|
141 |
@param aRemConInterfaceFeatures The operation IDs of the interface. Ownership is retained by the caller. Any necessary
|
williamr@4
|
142 |
data will be copied by the interface selector.
|
williamr@4
|
143 |
*/
|
williamr@4
|
144 |
void RegisterInterfaceL(CRemConInterfaceBase& aInterface, RRemConInterfaceFeatures& aRemConInterfaceFeatures);
|
williamr@2
|
145 |
/**
|
williamr@2
|
146 |
Register an error observer. This is provided to allow the client to
|
williamr@2
|
147 |
discover when an error has occurred passively.
|
williamr@2
|
148 |
|
williamr@2
|
149 |
@param aObserver An error observer to be notified on a passive error.
|
williamr@2
|
150 |
NULL to stop receiving notifications.
|
williamr@2
|
151 |
*/
|
williamr@2
|
152 |
IMPORT_C void RegisterErrorObserver(MRemConErrorObserver* aObserver);
|
williamr@2
|
153 |
|
williamr@2
|
154 |
/**
|
williamr@2
|
155 |
Opens a controller session to RemCon. The session is connectionless until
|
williamr@2
|
156 |
such time as GoConnectionOriented may be called.
|
williamr@2
|
157 |
@leave KErrInUse If a controller session is already open.
|
williamr@2
|
158 |
*/
|
williamr@2
|
159 |
IMPORT_C void OpenControllerL();
|
williamr@2
|
160 |
|
williamr@2
|
161 |
/**
|
williamr@2
|
162 |
Makes the controller session (which must already exist- use
|
williamr@2
|
163 |
OpenControllerL) connection-oriented.
|
williamr@2
|
164 |
@param aConnection The remote to talk to.
|
williamr@2
|
165 |
*/
|
williamr@2
|
166 |
IMPORT_C void GoConnectionOrientedL(const TRemConAddress& aConnection);
|
williamr@2
|
167 |
|
williamr@2
|
168 |
/**
|
williamr@2
|
169 |
Makes the controller session (which must already exist- use
|
williamr@2
|
170 |
OpenControllerL) connectionless.
|
williamr@2
|
171 |
*/
|
williamr@2
|
172 |
IMPORT_C void GoConnectionlessL();
|
williamr@2
|
173 |
|
williamr@2
|
174 |
/**
|
williamr@2
|
175 |
Brings up a bearer-level connection.
|
williamr@2
|
176 |
The controller session must already exist (use OpenControllerL) and
|
williamr@2
|
177 |
be connection-oriented.
|
williamr@2
|
178 |
@param aStatus TRequestStatus for asynchronous completion.
|
williamr@2
|
179 |
*/
|
williamr@2
|
180 |
IMPORT_C void ConnectBearer(TRequestStatus& aStatus);
|
williamr@2
|
181 |
|
williamr@2
|
182 |
/**
|
williamr@2
|
183 |
Cancels interest in the completion of a ConnectBearer request.
|
williamr@2
|
184 |
@return KErrNone.
|
williamr@2
|
185 |
*/
|
williamr@2
|
186 |
IMPORT_C TInt ConnectBearerCancel();
|
williamr@2
|
187 |
|
williamr@2
|
188 |
/**
|
williamr@2
|
189 |
Destroys a bearer-level connection.
|
williamr@2
|
190 |
The controller session must already exist (use OpenControllerL) and be
|
williamr@2
|
191 |
connection-oriented.
|
williamr@2
|
192 |
@param aStatus TRequestStatus for asynchronous completion.
|
williamr@2
|
193 |
*/
|
williamr@2
|
194 |
IMPORT_C void DisconnectBearer(TRequestStatus& aStat);
|
williamr@2
|
195 |
|
williamr@2
|
196 |
/**
|
williamr@2
|
197 |
Cancels interest in the completion of a DisconnectBearer request.
|
williamr@2
|
198 |
@return KErrNone.
|
williamr@2
|
199 |
*/
|
williamr@2
|
200 |
IMPORT_C TInt DisconnectBearerCancel();
|
williamr@2
|
201 |
|
williamr@2
|
202 |
/**
|
williamr@2
|
203 |
Opens a target session to RemCon.
|
williamr@2
|
204 |
@leave KErrInUse If a target session is already open.
|
williamr@2
|
205 |
*/
|
williamr@2
|
206 |
IMPORT_C void OpenTargetL();
|
williamr@2
|
207 |
|
williamr@2
|
208 |
/**
|
williamr@4
|
209 |
Opens a target session to RemCon.
|
williamr@4
|
210 |
@param aPlayerType The type of player
|
williamr@4
|
211 |
@param aPlayerSubType The sub-type of the player
|
williamr@4
|
212 |
@param aPlayerName The name of the player in UTF-8.
|
williamr@4
|
213 |
@leave KErrInUse If a target session is already open.
|
williamr@4
|
214 |
*/
|
williamr@4
|
215 |
IMPORT_C void OpenTargetL(TPlayerType aPlayerType, TPlayerSubType aPlayerSubType, const TDesC8& aPlayerName);
|
williamr@4
|
216 |
/**
|
williamr@2
|
217 |
Sends a message to the remote device(s).
|
williamr@2
|
218 |
There should be only one command and response outstanding at any one time.
|
williamr@2
|
219 |
Send cannot be called again until aStatus is completed.
|
williamr@2
|
220 |
@panic RemConClient 4 If a send is already outstanding
|
williamr@2
|
221 |
@param aStatus TRequestStatus for asynchronous completion.
|
williamr@2
|
222 |
@param aInterfaceUid The UID of the concrete (outer-layer) interface
|
williamr@2
|
223 |
sending the message.
|
williamr@2
|
224 |
@param aOperationId The interface-specific operation identifier.
|
williamr@2
|
225 |
@param aNumRemotes On success, the number of remotes the message was
|
williamr@2
|
226 |
successfully sent to.
|
williamr@2
|
227 |
@param aMsgType Whether the message is a command or a response.
|
williamr@2
|
228 |
@param aData Any associated message data in interface-specific format.
|
williamr@2
|
229 |
*/
|
williamr@2
|
230 |
IMPORT_C void Send(TRequestStatus& aStatus,
|
williamr@2
|
231 |
TUid aInterfaceUid,
|
williamr@2
|
232 |
TUint aOperationId,
|
williamr@2
|
233 |
TUint& aNumRemotes,
|
williamr@2
|
234 |
TRemConMessageType aMsgType,
|
williamr@2
|
235 |
const TDesC8& aData = KNullDesC8());
|
williamr@2
|
236 |
|
williamr@2
|
237 |
/**
|
williamr@2
|
238 |
Sends a message to the remote device(s).
|
williamr@2
|
239 |
@param aStatus TRequestStatus for asynchronous completion.
|
williamr@2
|
240 |
@param aInterfaceUid The UID of the concrete (outer-layer) interface
|
williamr@2
|
241 |
sending the message.
|
williamr@2
|
242 |
@param aOperationId The interface-specific operation identifier.
|
williamr@2
|
243 |
@param aNumRemotes On success, the number of remotes the message was
|
williamr@2
|
244 |
successfully sent to.
|
williamr@2
|
245 |
@param aMsgType Whether the message is a command or a response.
|
williamr@2
|
246 |
@param aMsgSubType The subtype of the command of response
|
williamr@2
|
247 |
@param aData Any associated message data in interface-specific format.
|
williamr@2
|
248 |
*/
|
williamr@2
|
249 |
IMPORT_C void Send(TRequestStatus& aStatus,
|
williamr@2
|
250 |
TUid aInterfaceUid,
|
williamr@2
|
251 |
TUint aOperationId,
|
williamr@2
|
252 |
TUint& aNumRemotes,
|
williamr@2
|
253 |
TRemConMessageType aMsgType,
|
williamr@2
|
254 |
TRemConMessageSubType aMsgSubType,
|
williamr@2
|
255 |
const TDesC8& aData = KNullDesC8());
|
williamr@2
|
256 |
|
williamr@4
|
257 |
/**
|
williamr@4
|
258 |
Sends a
|
williamr@4
|
259 |
*/
|
williamr@4
|
260 |
IMPORT_C void SendNotify(TRequestStatus& aStatus,
|
williamr@4
|
261 |
TUid aInterfaceUid,
|
williamr@4
|
262 |
TUint aOperationId,
|
williamr@4
|
263 |
TRemConMessageType aMsgType,
|
williamr@4
|
264 |
TRemConMessageSubType aMsgSubType,
|
williamr@4
|
265 |
const TDesC8& aData = KNullDesC8());
|
williamr@2
|
266 |
|
williamr@2
|
267 |
/**
|
williamr@4
|
268 |
This method is for internal sub-system use only and should be not be used otherwise.
|
williamr@2
|
269 |
Sends a message to the remote device(s), without waiting for the send to complete
|
williamr@2
|
270 |
@param aInterfaceUid The UID of the concrete (outer-layer) interface
|
williamr@2
|
271 |
sending the message.
|
williamr@2
|
272 |
@param aOperationId The interface-specific operation identifier.
|
williamr@2
|
273 |
@param aMsgType Whether the message is a command or a response.
|
williamr@2
|
274 |
@param aData Any associated message data in interface-specific format.
|
williamr@2
|
275 |
*/
|
williamr@2
|
276 |
IMPORT_C TInt SendUnreliable(
|
williamr@2
|
277 |
TUid aInterfaceUid,
|
williamr@2
|
278 |
TUint aOperationId,
|
williamr@2
|
279 |
TRemConMessageType aMsgType,
|
williamr@2
|
280 |
const TDesC8& aData = KNullDesC8());
|
williamr@2
|
281 |
|
williamr@2
|
282 |
/**
|
williamr@4
|
283 |
This method is for internal sub-system use only and should be not be used otherwise.
|
williamr@2
|
284 |
Sends a message to the remote device(s), without waiting for the send to complete
|
williamr@2
|
285 |
@param aInterfaceUid The UID of the concrete (outer-layer) interface
|
williamr@2
|
286 |
sending the message.
|
williamr@2
|
287 |
@param aOperationId The interface-specific operation identifier.
|
williamr@2
|
288 |
@param aMsgType Whether the message is a command or a response.
|
williamr@2
|
289 |
@param aMsgSubType The subtype of the command of response
|
williamr@2
|
290 |
@param aData Any associated message data in interface-specific format.
|
williamr@2
|
291 |
*/
|
williamr@2
|
292 |
IMPORT_C TInt SendUnreliable(
|
williamr@2
|
293 |
TUid aInterfaceUid,
|
williamr@2
|
294 |
TUint aOperationId,
|
williamr@2
|
295 |
TRemConMessageType aMsgType,
|
williamr@2
|
296 |
TRemConMessageSubType aMsgSubType,
|
williamr@2
|
297 |
const TDesC8& aData = KNullDesC8());
|
williamr@2
|
298 |
|
williamr@2
|
299 |
/**
|
williamr@2
|
300 |
Cancels interest in the completion of a Send request.
|
williamr@2
|
301 |
@param aMsgType The type of the message, the completion of the send of
|
williamr@2
|
302 |
which we are not interested in. This is needed because a single
|
williamr@2
|
303 |
CRemConInterfaceSelector may have two sends outstanding at once, one on
|
williamr@2
|
304 |
a controller session and another on a target session.
|
williamr@2
|
305 |
@return KErrNone.
|
williamr@2
|
306 |
*/
|
williamr@2
|
307 |
IMPORT_C TInt SendCancel(TRemConMessageType aMsgType);
|
williamr@4
|
308 |
|
williamr@4
|
309 |
/**
|
williamr@4
|
310 |
This method is for internal sub-system use only and should be not be used otherwise.
|
williamr@4
|
311 |
Sends a message to the remote device(s) through the bulk path.
|
williamr@4
|
312 |
There should be only one response outstanding at any one time.
|
williamr@4
|
313 |
Send cannot be called again until aStatus is completed.
|
williamr@4
|
314 |
@panic RemConClient 4 If a send is already outstanding
|
williamr@4
|
315 |
@param aStatus TRequestStatus for asynchronous completion.
|
williamr@4
|
316 |
@param aInterfaceUid The UID of the concrete (outer-layer) interface
|
williamr@4
|
317 |
sending the message.
|
williamr@4
|
318 |
@param aOperationId The interface-specific operation identifier.
|
williamr@4
|
319 |
@param aData Any associated message data in interface-specific format.
|
williamr@4
|
320 |
*/
|
williamr@4
|
321 |
IMPORT_C void SendBulk(TRequestStatus& aStatus,
|
williamr@4
|
322 |
TUid aInterfaceUid,
|
williamr@4
|
323 |
TUint aOperationId,
|
williamr@4
|
324 |
const TDesC8& aData = KNullDesC8());
|
williamr@4
|
325 |
|
williamr@4
|
326 |
/**
|
williamr@4
|
327 |
This method is for internal sub-system use only and should be not be used otherwise.
|
williamr@4
|
328 |
Sends a message to the remote device(s) through the bulk path, without
|
williamr@4
|
329 |
waiting for the send to complete.
|
williamr@4
|
330 |
@param aInterfaceUid The UID of the concrete (outer-layer) interface
|
williamr@4
|
331 |
sending the message.
|
williamr@4
|
332 |
@param aOperationId The interface-specific operation identifier.
|
williamr@4
|
333 |
@param aData Any associated message data in interface-specific format.
|
williamr@4
|
334 |
*/
|
williamr@4
|
335 |
IMPORT_C TInt SendBulkUnreliable(
|
williamr@4
|
336 |
TUid aInterfaceUid,
|
williamr@4
|
337 |
TUint aOperationId,
|
williamr@4
|
338 |
const TDesC8& aData = KNullDesC8());
|
williamr@4
|
339 |
|
williamr@4
|
340 |
/**
|
williamr@4
|
341 |
This method is for internal sub-system use only and should be not be used otherwise.
|
williamr@4
|
342 |
Cancels interest in the completion of a BulkSend request.
|
williamr@4
|
343 |
@return KErrNone.
|
williamr@4
|
344 |
*/
|
williamr@4
|
345 |
IMPORT_C TInt SendBulkCancel();
|
williamr@2
|
346 |
|
williamr@2
|
347 |
/**
|
williamr@2
|
348 |
Only called internally, by the Active Object which sucks messages out of
|
williamr@2
|
349 |
RemCon. Note that the message type is not given- it is interpolated from
|
williamr@2
|
350 |
the type of the session doing the receiving.
|
williamr@2
|
351 |
@param aInterfaceUid Interface UID of the new message.
|
williamr@2
|
352 |
@param aOperationId Operation ID of the new message.
|
williamr@4
|
353 |
@param aMsgSubType The message subtype.
|
williamr@4
|
354 |
@param aRemoteAddress The address of the remote which sent the message.
|
williamr@2
|
355 |
@param aData Data associated with the new message.
|
williamr@2
|
356 |
@param aType The type of session which received the message (from which
|
williamr@2
|
357 |
the type of the message can be interpolated).
|
williamr@2
|
358 |
*/
|
williamr@2
|
359 |
void ReceiveComplete(TUid aInterfaceUid,
|
williamr@2
|
360 |
TUint aOperationId,
|
williamr@2
|
361 |
TRemConMessageSubType aMsgSubType,
|
williamr@4
|
362 |
const TRemConAddress& aRemoteAddress,
|
williamr@2
|
363 |
const TDesC8& aData,
|
williamr@2
|
364 |
TRemConClientType aType);
|
williamr@4
|
365 |
|
williamr@4
|
366 |
/**
|
williamr@4
|
367 |
Only called internally, by the Active Object which sucks messages out of
|
williamr@4
|
368 |
RemCon. Note that the message type is not given- it is interpolated from
|
williamr@4
|
369 |
the type of the session doing the receiving.
|
williamr@4
|
370 |
@param aInterfaceUid Interface UID of the new message.
|
williamr@4
|
371 |
@param aOperationId Operation ID of the new message.
|
williamr@4
|
372 |
@param aData Data associated with the new message.
|
williamr@4
|
373 |
*/
|
williamr@4
|
374 |
void BulkReceiveComplete(TUid aInterfaceUid,
|
williamr@4
|
375 |
TUint aOperationId,
|
williamr@4
|
376 |
const TDesC8& aData);
|
williamr@2
|
377 |
|
williamr@2
|
378 |
/**
|
williamr@2
|
379 |
Only called internally, by the Active Object which sucks messages out of
|
williamr@2
|
380 |
RemCon. This is called in the case of a session error.
|
williamr@2
|
381 |
|
williamr@2
|
382 |
@param The error that has occurred. If this is KErrServerTerminated, the
|
williamr@2
|
383 |
error is fatal and the session must be restarted before any new
|
williamr@2
|
384 |
messages can be received.
|
williamr@2
|
385 |
*/
|
williamr@2
|
386 |
void Error(TInt aError);
|
williamr@4
|
387 |
|
williamr@4
|
388 |
/**
|
williamr@4
|
389 |
Only called internally, by the Active Object which sucks messages out of
|
williamr@4
|
390 |
RemCon Bulk Server. This is called in the case of a session error.
|
williamr@4
|
391 |
|
williamr@4
|
392 |
@param The error that has occurred. If this is KErrServerTerminated, the
|
williamr@4
|
393 |
error is fatal and the session must be restarted before any new
|
williamr@4
|
394 |
messages can be received.
|
williamr@4
|
395 |
*/
|
williamr@4
|
396 |
void BulkError(TInt aError);
|
williamr@4
|
397 |
|
williamr@4
|
398 |
/**
|
williamr@4
|
399 |
Only called internally, by the Active Object which sucks messages out of
|
williamr@4
|
400 |
RemCon (bulk server).
|
williamr@4
|
401 |
*/
|
williamr@4
|
402 |
void BulkSessionConnectL();
|
williamr@2
|
403 |
|
williamr@2
|
404 |
/**
|
williamr@2
|
405 |
Getter for the current set of connections in the system (not just those
|
williamr@2
|
406 |
associated with this session). The client is responsible for cleaning up
|
williamr@2
|
407 |
aConnections- the addresses will be on the heap.
|
williamr@2
|
408 |
@param aConnections A collection of remote addresses, representing all the
|
williamr@2
|
409 |
currently extant connections.
|
williamr@2
|
410 |
@return Error.
|
williamr@2
|
411 |
*/
|
williamr@2
|
412 |
IMPORT_C TInt GetConnections(TSglQue<TRemConAddress>& aConnections);
|
williamr@2
|
413 |
|
williamr@2
|
414 |
/**
|
williamr@2
|
415 |
Notification for changes in the set of connections.
|
williamr@2
|
416 |
@param aStatus TRequestStatus for asynchronous completion.
|
williamr@2
|
417 |
*/
|
williamr@2
|
418 |
IMPORT_C void NotifyConnectionsChange(TRequestStatus& aStatus);
|
williamr@2
|
419 |
|
williamr@2
|
420 |
/**
|
williamr@2
|
421 |
Cancels interest in the completion of an outstanding
|
williamr@2
|
422 |
NotifyConnectionsChange operation.
|
williamr@2
|
423 |
@return KErrNone.
|
williamr@2
|
424 |
*/
|
williamr@2
|
425 |
IMPORT_C TInt NotifyConnectionsChangeCancel();
|
williamr@2
|
426 |
|
williamr@2
|
427 |
/**
|
williamr@2
|
428 |
To determine if a target session has been opened.
|
williamr@2
|
429 |
@return EFalse if no session has been opened, ETrue otherwise.
|
williamr@2
|
430 |
*/
|
williamr@2
|
431 |
IMPORT_C TBool TargetOpened() const;
|
williamr@2
|
432 |
|
williamr@2
|
433 |
/**
|
williamr@2
|
434 |
To determine if a controller session has been opened.
|
williamr@2
|
435 |
@return EFalse if no session has been opened, ETrue otherwise.
|
williamr@2
|
436 |
*/
|
williamr@2
|
437 |
IMPORT_C TBool ControllerOpened() const;
|
williamr@2
|
438 |
|
williamr@2
|
439 |
private:
|
williamr@2
|
440 |
CRemConInterfaceSelector();
|
williamr@4
|
441 |
void ConstructL();
|
williamr@2
|
442 |
|
williamr@2
|
443 |
private: // utility
|
williamr@2
|
444 |
void AssertSession(RRemCon* aSess, TInt aPanicCode) const;
|
williamr@2
|
445 |
TInt TryToReconnect();
|
williamr@4
|
446 |
TInt TryToReconnectBulk();
|
williamr@4
|
447 |
void OpenTargetCommonL();
|
williamr@4
|
448 |
void RegisterInterfaceCommonL(CRemConInterfaceBase& aInterface, const TDesC8& aFeatures);
|
williamr@4
|
449 |
void RegisterInterestedApisL(TRemConClientType aType);
|
williamr@4
|
450 |
|
williamr@4
|
451 |
void EstablishBulkThreadBindingL();
|
williamr@4
|
452 |
|
williamr@4
|
453 |
static TInt StaticBulkCleanup(TAny* aSelf);
|
williamr@4
|
454 |
void BulkCleanup();
|
williamr@4
|
455 |
TBool BulkOpened() const;
|
williamr@2
|
456 |
|
williamr@2
|
457 |
private: // owned
|
williamr@4
|
458 |
CRemConInterfaceDetailsArray* iInterfaces;
|
williamr@2
|
459 |
|
williamr@4
|
460 |
RRemConController* iControllerSession;
|
williamr@4
|
461 |
RRemConTarget* iTargetSession;
|
williamr@4
|
462 |
RRemConBulk* iBulkSession;
|
williamr@2
|
463 |
|
williamr@2
|
464 |
CReceiver* iTargetReceiver;
|
williamr@2
|
465 |
CReceiver* iControllerReceiver;
|
williamr@4
|
466 |
CBulkReceiver* iBulkReceiver;
|
williamr@2
|
467 |
|
williamr@2
|
468 |
/** For all registered interfaces, this is the size of the biggest
|
williamr@2
|
469 |
operation-associated data lump. */
|
williamr@4
|
470 |
TUint iControlMaxDataLength;
|
williamr@4
|
471 |
TUint iBulkMaxDataLength;
|
williamr@2
|
472 |
|
williamr@2
|
473 |
// The session to use for NotifyConnectionsChange and
|
williamr@2
|
474 |
// NotifyConnectionsChangeCancel. It doesn't matter which we use- just one
|
williamr@2
|
475 |
// that's connected will do. The only interesting bit is that the session
|
williamr@2
|
476 |
// we called NotifyConnectionsChange on should be the one we call
|
williamr@2
|
477 |
// NotifyConnectionsChangeCancel on, but as sessions are only closed when
|
williamr@2
|
478 |
// 'this' comes down that's not a complication.
|
williamr@2
|
479 |
RRemCon* iNotificationSession;
|
williamr@2
|
480 |
|
williamr@2
|
481 |
TRemConAddress iAddress;
|
williamr@4
|
482 |
|
williamr@4
|
483 |
RHeap* iBulkHeap;
|
williamr@4
|
484 |
RThread iBulkThread;
|
williamr@4
|
485 |
RHeap* iSharedThreadHeap;
|
williamr@4
|
486 |
RSpecificThreadCallBack* iBulkCleanupCall;
|
williamr@4
|
487 |
RNestableLock* iLock;
|
williamr@2
|
488 |
private: // unowned
|
williamr@2
|
489 |
MRemConErrorObserver* iErrorObserver;
|
williamr@2
|
490 |
};
|
williamr@2
|
491 |
|
williamr@2
|
492 |
#endif // REMCONINTERFACESELECTOR_H
|