Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
1 // Copyright (c) 2004-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Remote Control client side.
25 #ifndef REMCONCLIENT_H
26 #define REMCONCLIENT_H
28 #include <remcon/clienttype.h>
29 #include <remcon/messagetype.h>
30 #include <remcon/operationinformation.h>
35 The abstract base class for RemCon session handles.
37 class RRemCon : public RSessionBase
41 Connect the handle to the server.
42 Must be called before all other methods (except Version and Close).
45 IMPORT_C TInt Connect();
48 Getter for the version of the server.
49 @return Version of the server.
51 IMPORT_C TVersion Version() const;
54 Sends a message (command or response) to the remote device.
55 @param aStatus TRequestStatus for asynchronous completion.
56 @param aInterfaceUid The UID of the interface to which the message
58 @param aOperationId The ID of the message. RemCon needs to know this,
59 separately from the arbitrary data, so it can (a) match up any incoming
60 response to this client (if the message is a command), and (b) match this
61 message up to the target (if this message is a response).
62 @param aNumRemotes On success only, the number of remotes the message was
63 successfully sent to (at the bearer level). If the message is a command
64 from a connection-oriented controller, then on success aNumRemotes will be
65 1. [For consistency, this pattern holds if the message is a response, even
66 though the information is redundant.] If the message is a command from a
67 connectionless controller, then aNumRemotes will be zero or more,
68 depending on what the TSP said should be done with the message and how
69 many of the TSP-nominated bearers successfully sent the message.
70 @param aData Data associated with the message.
72 IMPORT_C void Send(TRequestStatus& aStatus,
76 TRemConMessageSubType aSubType,
77 const TDesC8& aData = KNullDesC8());
79 IMPORT_C TInt SendUnreliable( TUid aInterfaceUid,
81 TRemConMessageSubType aSubType,
82 const TDesC8& aData = KNullDesC8());
85 Cancels interest in the completion of an outstanding Send operation.
88 IMPORT_C TInt SendCancel();
91 Receive a message (command or response) from the remote device. Note that
92 RemCon server queues both commands and responses so that none are ever
93 thrown away just because the client didn't have a Receive outstanding when
95 @param aStatus TRequestStatus for asynchronous completion.
96 @param aInterfaceUid The UID of the interface to which the message
98 @param aOperationId The ID of the message.
99 @param aData Data associated with the message.
101 IMPORT_C void Receive(TRequestStatus& aStatus,
104 TRemConMessageSubType& aSubType,
108 Cancels interest in the completion of an outstanding Receive operation.
111 IMPORT_C TInt ReceiveCancel();
114 Getter for the current set of connections in the system (not just those
115 associated with this session). The client is responsible for cleaning up
116 the collection- the addresses are on the client's heap.
117 @param aConnections A collection of remote addresses, representing all the
118 currently extant connections. Must be empty when this function is called.
121 IMPORT_C TInt GetConnections(TSglQue<TRemConAddress>& aConnections);
124 Notification for changes in the set of connections.
125 This completes whenever the set of connections changes in some way.
126 If they wish to know what specifically changed, the client must call
127 GetConnections and do their own analysis of the results from that.
128 Changes to the connection history of the system are logged internally so
129 that the client will not 'miss' any changes by not reposting the
130 notification quickly enough. However, if more than one bearer-level
131 connection change occurs in the server before the notification is reposted
132 by the client, then the following notification completion may 'cover' more
133 than one actual state change.
134 @param aStatus TRequestStatus for asynchronous completion.
136 IMPORT_C void NotifyConnectionsChange(TRequestStatus& aStatus);
139 Cancels interest in the completion of an outstanding
140 NotifyConnectionsChange operation.
143 IMPORT_C TInt NotifyConnectionsChangeCancel();
146 Marks the start of heap cell checking in the server's heap. In release
147 builds, just returns KErrNone.
150 IMPORT_C TInt __DbgMarkHeap();
153 Checks that the number of allocated cells on the server's heap is correct.
154 The server is panicked if not. In release builds, just returns KErrNone.
155 @param aCount The expected number of allocated heap cells.
158 IMPORT_C TInt __DbgCheckHeap(TInt aCount);
161 Marks the end of heap cell checking. Checks that the number of heap cells
162 allocated since the last __DbgMarkHeap() is aCount; the most common value
163 to pass here is zero. In release builds, just returns KErrNone.
164 @param aCount The expected number of allocated heap cells.
167 IMPORT_C TInt __DbgMarkEnd(TInt aCount);
170 Simulates memory allocation failure in the server. In release builds, just
172 @param aCount The number of allocations after which memory allocation
176 IMPORT_C TInt __DbgFailNext(TInt aCount);
181 @param aType The type of the session.
183 RRemCon(TRemConClientType aType);
190 TInt SetClientType();
193 const TRemConClientType iClientType;
198 TPckg<TUint> iNumRemotesPckg;
199 TPckgBuf<TOperationInformation> iOpInfoPckg;
204 TPckg<TUint> iUidPckg;
205 TPckg<TUint> iOpIdPckg;
206 TPckg<TRemConMessageSubType> iMsgSubTypePckg;
210 The concrete session class for RemCon controllers.
211 Controller sessions are connectionless when opened. This means that addressing
212 of commands is done by the Target Selector Plugin (TSP). A controller may
213 alternatively be connection-oriented, which means that addressing of commands
214 is done using a member of the server-side session which specifies a connection
215 to a remote device. [NB Just because a session 'points to' a connection in
216 this way does not means that the connection necessarily exists at the bearer
217 level or at any other level.]
218 To make a controller session connection-oriented, call GoConnectionOriented.
219 On success, the session's remote address member will have been set to the
220 requested remote address.
221 To make a session connectionless again, use GoConnectionless. On success, the
222 remote address member will be null, indicating that the TSP will be used to
223 address our commands.
224 To control bearer-level connections, use ConnectBearer and DisconnectBearer.
225 Note that real connections may, depending on the bearer, be torn down by the
226 remote end outside of our control. Use GetConnections (and the associated
227 notification) to get information about the current state of the real
228 connections. Note however that the client is not _required_ to be interested
229 in this level of control as RemCon is responsible for making sure the required
230 connection exists at the bearer level before sending the message. The level of
231 control mentioned is provided to the client so that it can, for instance,
232 ensure adequate responsiveness of the first command sent.
233 ConnectBearerCancel and DisconnectBearerCancel merely cancel interest in the
234 corresponding request. They do not change the state of the system, bearers,
235 connections, or member data in any other way. They operate as pure Symbian OS
236 asynchronous cancel methods.
238 class RRemConController : public RRemCon
242 IMPORT_C RRemConController();
245 IMPORT_C ~RRemConController();
248 Makes the session connection-oriented. On success, the given connection
249 data will be used for sending commands.
250 @param aBearerUid The UID of the bearer to use.
251 @param aData Optional bearer-specific connection data.
254 IMPORT_C TInt GoConnectionOriented(const TRemConAddress& aConnection);
257 Makes the session connectionless. On success, the TSP will be used for
261 IMPORT_C TInt GoConnectionless();
264 Establish a bearer-level connection using the information supplied in
265 GoConnectionOriented.
266 @param aStatus Used by the server to indicate completion of the request.
268 IMPORT_C void ConnectBearer(TRequestStatus& aStatus);
271 Cancels interest in the completion of an outstanding ConnectBearer
272 request. Does not affect the state of the bearer-level connection.
275 IMPORT_C TInt ConnectBearerCancel();
278 Triggers bearer-level disconnection of the connection specified in
279 GoConnectionOriented.
280 @param aStatus Used by the server to indicate completion of the request.
282 IMPORT_C void DisconnectBearer(TRequestStatus& aStatus);
285 Cancels interest in the completion of an outstanding DisconnectBearer
286 request. Does not affect the state of the bearer-level connection.
289 IMPORT_C TInt DisconnectBearerCancel();
293 The concrete session class for RemCon targets.
295 class RRemConTarget : public RRemCon
299 IMPORT_C RRemConTarget();
302 IMPORT_C ~RRemConTarget();
305 Tells the server in which APIs the client is interested. The server
306 will only deliver incoming commands of these APIs to the client.
307 @param aNumAPIs The number of APIs to be registered
308 @param aAPIs The concatenation of all the API UIDs.
309 @return The error code returned from the server.
311 IMPORT_C TInt RegisterInterestedAPIs(TInt aNumAPIs, const TDesC8& aAPIs);
314 #endif // REMCONCLIENT_H