pkiutilities/ocsp/test/comms.cpp
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 // Copyright (c) 2001-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 "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Contains utilities such as a global comms init function for starting c32
       
    15 // and loading device drivers for test code
       
    16 // 
       
    17 //
       
    18 
       
    19 #include "comms.h"
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <c32comm.h>
       
    23 
       
    24 #if defined (__WINS__)
       
    25 #define PDD_NAME		_L("ECDRV")
       
    26 #else
       
    27 #define PDD_NAME		_L("EUART1")
       
    28 #define PDD2_NAME		_L("EUART2")
       
    29 #define PDD3_NAME		_L("EUART3")
       
    30 #define PDD4_NAME		_L("EUART4")
       
    31 #endif
       
    32 
       
    33 #define LDD_NAME		_L("ECOMM")
       
    34 
       
    35 void InitCommsL(void)
       
    36 	{
       
    37 	TInt ret = User::LoadPhysicalDevice(PDD_NAME);
       
    38 	User::LeaveIfError(ret == KErrAlreadyExists ? KErrNone : ret);
       
    39 
       
    40 #ifndef __WINS__
       
    41 	User::LoadPhysicalDevice(PDD2_NAME);
       
    42 	User::LoadPhysicalDevice(PDD3_NAME);
       
    43 	User::LoadPhysicalDevice(PDD4_NAME);
       
    44 #endif
       
    45 
       
    46 	ret = User::LoadLogicalDevice(LDD_NAME);
       
    47 	User::LeaveIfError(ret == KErrAlreadyExists ? KErrNone : ret);
       
    48 
       
    49 	ret = StartC32();
       
    50 	User::LeaveIfError(ret == KErrAlreadyExists ? KErrNone : ret);
       
    51 	}
       
    52