sl@0: // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // Initialise Comm Server in an simple text shell environment sl@0: // sl@0: // sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #if defined (__WINS__) sl@0: #define PDD_NAME _L("ECDRV") sl@0: #define LDD_NAME _L("ECOMM") sl@0: #define LDD_FNAME _L("ECOMM") sl@0: #else sl@0: #define PDD_NAME _L("EUART1") sl@0: #define LDD_NAME _L("ECOMM") sl@0: #define LDD_FNAME _L("FCOMM") sl@0: #endif sl@0: sl@0: extern "C" { sl@0: sl@0: EXPORT_C int CommInit(int aEnhanced) sl@0: { sl@0: RFs fs; sl@0: TInt err=fs.Connect(); // make sure the FileServer is alive (only needed for WINS test code) sl@0: fs.Close(); sl@0: sl@0: err=User::LoadPhysicalDevice(PDD_NAME); sl@0: if (err!=KErrNone && err!=KErrAlreadyExists) sl@0: return(err); sl@0: err=User::LoadLogicalDevice( aEnhanced?LDD_FNAME:LDD_NAME ); sl@0: if (err!=KErrNone && err!=KErrAlreadyExists) sl@0: return(err); sl@0: return KErrNone; sl@0: } sl@0: sl@0: }