dbgagents/trkagent/dbgtrccomm/server/dbgtrcsrvsession.h
author ravikurupati
Tue, 02 Mar 2010 10:33:16 +0530
changeset 0 c6b0df440bee
permissions -rw-r--r--
Initial contribution of EPL licensed sources
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     1
/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     3
* All rights reserved.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     4
* This component and the accompanying materials are made available
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     6
* which accompanies this distribution, and is available
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     8
*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
     9
* Initial Contributors:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    11
*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    12
* Contributors:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    13
*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    14
* Description: 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    15
*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    16
*/
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    17
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    18
#ifndef __DbgTrcSrvSession_h__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    19
#define __DbgTrcSrvSession_h__
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    20
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    21
// System includes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    22
#include <e32base.h>
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    23
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    24
// User includes
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    25
#include "ostprotdefs.h"
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    26
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    27
// Constants
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    28
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    29
// Classes referenced
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    30
class COstBaseRouter;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    31
class COstMessage;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    32
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    33
// Enumerations
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    34
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    35
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    36
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    37
// CDbgTrcSrvSession (header)
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    38
//
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    39
/**
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    40
 * This class acts as a simple wrapper around the IPC client-server framework,
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    41
 * and drives a real underlying engine, which is actually responsible for
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    42
 * fulfulling all the client requests.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    43
 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    44
 
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    45
class CDbgTrcSrvSession : public CSession2
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    46
{
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    47
	public:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    48
		static 	CDbgTrcSrvSession* NewL(COstBaseRouter* aOstRouter);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    49
				~CDbgTrcSrvSession();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    50
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    51
	private:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    52
				CDbgTrcSrvSession(COstBaseRouter* aOstRouter);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    53
		void 	ConstructL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    54
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    55
	public:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    56
		void 	HandleServerDestruction();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    57
		void 	CreateL();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    58
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    59
	public: // callbacks for the OST router
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    60
		void 	MessageAvailableL(TDesC8& aMsg);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    61
		void 	WriteComplete(TInt aErrCode);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    62
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    63
	private:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    64
	//FROM CSession2
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    65
		void 	ServiceL(const RMessage2& aMessage);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    66
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    67
		
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    68
	private:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    69
	// CMD - SPECIFIC FUNCTIONALITY
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    70
		void 	CmdGetAcmConfigL(const RMessage2& aMessage);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    71
		void 	CmdSetAcmConfigL(const RMessage2& aMessage);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    72
		
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    73
		void 	CmdOpenCommPortL(const RMessage2& aMessage);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    74
		void 	CmdCloseCommPort(const RMessage2& aMessage);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    75
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    76
		void 	CmdRegisterProtocol(const RMessage2& aMessage);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    77
		void 	CmdUnRegisterProtocol(const RMessage2& aMessage);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    78
		
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    79
		void 	CmdRegisterProtocolIdsL(const RMessage2& aMessage);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    80
		void 	CmdUnRegisterProtocolIdsL(const RMessage2& aMessage);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    81
		
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    82
		void    CmdReadMsgL(const RMessage2& aMessage);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    83
		void 	CmdReadCancel(const RMessage2& aMessage);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    84
		
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    85
		void 	CmdWriteMsgL(const RMessage2& aMessage);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    86
		void 	CmdWriteCancel(const RMessage2& aMessage);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    87
		void 	CmdDisconnect(const RMessage2& aMessage);
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    88
		
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    89
		void 	DoDisconnect();
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    90
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    91
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    92
private:
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    93
	/*
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    94
	 * Used to transfer collections of objects between server and client.
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    95
	 */
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    96
	CBufBase*					iTransferBuffer;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    97
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    98
	RMessagePtr2			iBlockedRead;	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
    99
	RMessagePtr2			iBlockedWrite;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   100
	TBool 					iPendingRead;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   101
	TBool 					iPendingWrite;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   102
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   103
	TUint					iPendingReadBufferLength;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   104
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   105
	COstBaseRouter* iOstRouter;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   106
	
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   107
	RPointerArray<COstMessage>	iRecvMessageQueue;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   108
	RArray<TOstProtIds> iProtocolIds;
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   109
};
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   110
c6b0df440bee Initial contribution of EPL licensed sources
ravikurupati
parents:
diff changeset
   111
#endif //__DbgTrcSrvSession_h__