epoc32/include/networkemulator/cuccsdeviceprotocol.h
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/networkemulator/cuccsdeviceprotocol.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,99 @@
     1.4 +/*
     1.5 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* 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
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +* CUCCSDeviceProtocol Class
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +#ifndef _CUCCSDeviceProtocol_H
    1.24 +#define _CUCCSDeviceProtocol_H
    1.25 +
    1.26 +
    1.27 +/*****************************************************************************
    1.28 + *
    1.29 + * System Includes 
    1.30 + *
    1.31 + ****************************************************************************/
    1.32 +#include <e32cons.h>
    1.33 +
    1.34 +
    1.35 +/*****************************************************************************
    1.36 + *
    1.37 + * Local Includes
    1.38 + *
    1.39 + ****************************************************************************/
    1.40 +//#include "MUCCTransport.h"
    1.41 +//#include "CProtocolTypes.h"
    1.42 +
    1.43 +#include <mucctransport.h>
    1.44 +#include <cprotocoltypes.h>
    1.45 +
    1.46 +
    1.47 +/*****************************************************************************
    1.48 + *
    1.49 + *  Types
    1.50 + *
    1.51 + ****************************************************************************/
    1.52 +typedef enum {
    1.53 +	TDP_SUCCESS,
    1.54 +	TDP_INVALIDCMDID,
    1.55 +	TDP_SENDERROR,
    1.56 +	TDP_RECVERROR,
    1.57 +	TDP_ERRINTIALISING,
    1.58 +	TDP_UIDMISMATCH,
    1.59 +} TDPError;
    1.60 +
    1.61 +typedef enum {
    1.62 +	TDP_IDLE,
    1.63 +	TDP_CONNECTED
    1.64 +} TDPStatus;
    1.65 +
    1.66 +
    1.67 +typedef enum 
    1.68 +{
    1.69 +	TDP_NONE,
    1.70 +	TDP_SERIAL,
    1.71 +	TDP_TCP
    1.72 +} TDPTransport;
    1.73 +
    1.74 +/*****************************************************************************
    1.75 + *
    1.76 + * Class Definition
    1.77 + *
    1.78 + ****************************************************************************/
    1.79 +class CUCCSDeviceProtocol : public CBase
    1.80 +{
    1.81 +public:
    1.82 +	CUCCSDeviceProtocol();
    1.83 +	~CUCCSDeviceProtocol();
    1.84 +
    1.85 +	TDPError initialise(TBufC16<40> aRemoteHost, TDPTransport aTransportType = TDP_SERIAL );
    1.86 +	TDPError disconnect();
    1.87 +	
    1.88 +	TDPError sendMessage(TPCommand aCmd, int aDataLength, void *aData);
    1.89 +	TDPError receiveMessage(TPCommand* aCmd, int* aDataLength, void* aData);
    1.90 +
    1.91 +private:
    1.92 +	bool isValidCMDID(TPCommand aCommand);
    1.93 +
    1.94 +	int iRand_UID;
    1.95 +	MUCCTransport* iTransport;
    1.96 +	TBufC16<40> iRemoteHost;
    1.97 +	TInt64 iRandomSeed;
    1.98 +	TDPStatus iStatus;
    1.99 +
   1.100 +};
   1.101 +
   1.102 +#endif