epoc32/include/networkemulator/cuccsdeviceprotocol.h
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
       
     1 /*
       
     2 * Copyright (c) 2005-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 "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 * CUCCSDeviceProtocol Class
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef _CUCCSDeviceProtocol_H
       
    21 #define _CUCCSDeviceProtocol_H
       
    22 
       
    23 
       
    24 /*****************************************************************************
       
    25  *
       
    26  * System Includes 
       
    27  *
       
    28  ****************************************************************************/
       
    29 #include <e32cons.h>
       
    30 
       
    31 
       
    32 /*****************************************************************************
       
    33  *
       
    34  * Local Includes
       
    35  *
       
    36  ****************************************************************************/
       
    37 //#include "MUCCTransport.h"
       
    38 //#include "CProtocolTypes.h"
       
    39 
       
    40 #include <mucctransport.h>
       
    41 #include <cprotocoltypes.h>
       
    42 
       
    43 
       
    44 /*****************************************************************************
       
    45  *
       
    46  *  Types
       
    47  *
       
    48  ****************************************************************************/
       
    49 typedef enum {
       
    50 	TDP_SUCCESS,
       
    51 	TDP_INVALIDCMDID,
       
    52 	TDP_SENDERROR,
       
    53 	TDP_RECVERROR,
       
    54 	TDP_ERRINTIALISING,
       
    55 	TDP_UIDMISMATCH,
       
    56 } TDPError;
       
    57 
       
    58 typedef enum {
       
    59 	TDP_IDLE,
       
    60 	TDP_CONNECTED
       
    61 } TDPStatus;
       
    62 
       
    63 
       
    64 typedef enum 
       
    65 {
       
    66 	TDP_NONE,
       
    67 	TDP_SERIAL,
       
    68 	TDP_TCP
       
    69 } TDPTransport;
       
    70 
       
    71 /*****************************************************************************
       
    72  *
       
    73  * Class Definition
       
    74  *
       
    75  ****************************************************************************/
       
    76 class CUCCSDeviceProtocol : public CBase
       
    77 {
       
    78 public:
       
    79 	CUCCSDeviceProtocol();
       
    80 	~CUCCSDeviceProtocol();
       
    81 
       
    82 	TDPError initialise(TBufC16<40> aRemoteHost, TDPTransport aTransportType = TDP_SERIAL );
       
    83 	TDPError disconnect();
       
    84 	
       
    85 	TDPError sendMessage(TPCommand aCmd, int aDataLength, void *aData);
       
    86 	TDPError receiveMessage(TPCommand* aCmd, int* aDataLength, void* aData);
       
    87 
       
    88 private:
       
    89 	bool isValidCMDID(TPCommand aCommand);
       
    90 
       
    91 	int iRand_UID;
       
    92 	MUCCTransport* iTransport;
       
    93 	TBufC16<40> iRemoteHost;
       
    94 	TInt64 iRandomSeed;
       
    95 	TDPStatus iStatus;
       
    96 
       
    97 };
       
    98 
       
    99 #endif