hti/HtiCommPlugins/HtiIPCommPlugin/src/HtiIPCommEcomPlugin.cpp
branchRCL_3
changeset 59 8ad140f3dd41
equal deleted inserted replaced
49:7fdc9a71d314 59:8ad140f3dd41
       
     1 /*
       
     2 * Copyright (c) 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 "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  ECOM plugin for communication over IP port
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "HtiIPCommEcomPlugin.h"
       
    21 #include <HtiLogging.h>
       
    22 
       
    23 CHtiIPCommEcomPlugin* CHtiIPCommEcomPlugin::NewL()
       
    24     {
       
    25     CHtiIPCommEcomPlugin* self = new (ELeave) CHtiIPCommEcomPlugin();
       
    26     CleanupStack::PushL( self );
       
    27     self->ConstructL();
       
    28     CleanupStack::Pop( self );
       
    29     return self;
       
    30     }
       
    31 
       
    32 CHtiIPCommEcomPlugin::CHtiIPCommEcomPlugin()
       
    33     {
       
    34     }
       
    35 
       
    36 CHtiIPCommEcomPlugin::~CHtiIPCommEcomPlugin()
       
    37     {
       
    38     iHtiIPCommServer.Close();
       
    39     }
       
    40 
       
    41 void CHtiIPCommEcomPlugin::ConstructL()
       
    42     {
       
    43     TInt err = iHtiIPCommServer.Connect();
       
    44     if ( err )
       
    45         {
       
    46         HTI_LOG_FORMAT( "error connecting to HtiIPCommServer %d", err );
       
    47         User::Leave( err );
       
    48         }
       
    49     }
       
    50 
       
    51 void CHtiIPCommEcomPlugin::Receive( TDes8& aRawdataBuf, TRequestStatus& aStatus )
       
    52     {
       
    53     iHtiIPCommServer.Receive( aRawdataBuf, aStatus );
       
    54     }
       
    55 
       
    56 void CHtiIPCommEcomPlugin::Send( const TDesC8& aRawdataBuf, TRequestStatus& aStatus )
       
    57     {
       
    58     iHtiIPCommServer.Send( aRawdataBuf, aStatus );
       
    59     }
       
    60 
       
    61 void CHtiIPCommEcomPlugin::CancelReceive()
       
    62     {
       
    63     iHtiIPCommServer.CancelReceive();
       
    64     }
       
    65 
       
    66 void CHtiIPCommEcomPlugin::CancelSend()
       
    67     {
       
    68     iHtiIPCommServer.CancelSend();
       
    69     }
       
    70 
       
    71 TInt CHtiIPCommEcomPlugin::GetSendBufferSize()
       
    72     {
       
    73     return iHtiIPCommServer.GetSendBufferSize();
       
    74     }
       
    75 
       
    76 TInt CHtiIPCommEcomPlugin::GetReceiveBufferSize()
       
    77     {
       
    78     return iHtiIPCommServer.GetReceiveBufferSize();
       
    79     }
       
    80 
       
    81