telephonyserverplugins/simtsy/src/CSimSerComm.cpp
branchRCL_3
changeset 20 07a122eea281
parent 19 630d2f34d719
equal deleted inserted replaced
19:630d2f34d719 20:07a122eea281
     1 // Copyright (c) 2001-2010 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    17 
    17 
    18 /**
    18 /**
    19  @file
    19  @file
    20 */
    20 */
    21 
    21 
    22 
       
    23 
       
    24 #include "OstTraceDefinitions.h"
       
    25 #ifdef OST_TRACE_COMPILER_IN_USE
       
    26 #include "CSimSerCommTraces.h"
       
    27 #endif
       
    28 
       
    29 #include "CSimSerComm.h"
    22 #include "CSimSerComm.h"
    30 #include "CSimPhone.h"
    23 #include "CSimPhone.h"
       
    24 #include "Simlog.h"
    31 
    25 
    32 MComm::MComm()
    26 MComm::MComm()
    33 /**
    27 /**
    34  * Trivial constructor.
    28  * Trivial constructor.
    35  */
    29  */
   116  * @param aName		The serial port name.
   110  * @param aName		The serial port name.
   117  * @param aMode		The required access mode: shared, exclusive, etc...
   111  * @param aMode		The required access mode: shared, exclusive, etc...
   118  * @return TInt		Standard error value.
   112  * @return TInt		Standard error value.
   119  */
   113  */
   120 	{
   114 	{
   121 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, MCOMM_COMMOPEN1_1, "Attempting to Open Serial Port");
   115 	LOGDATA1("Attempting to Open Serial Port");
   122 	TInt err;
   116 	TInt err;
   123 	if (err = iCommServer.Connect(), err!=KErrNone)
   117 	if (err = iCommServer.Connect(), err!=KErrNone)
   124 		return err;
   118 		return err;
   125 	if (err = iCommPort.Open(iCommServer, aName, ECommExclusive), err!=KErrNone)
   119 	if (err = iCommPort.Open(iCommServer, aName, ECommExclusive), err!=KErrNone)
   126 		// if any other TSY (or other app) is using comm port, we want to return gracefully
   120 		// if any other TSY (or other app) is using comm port, we want to return gracefully
   136 			{
   130 			{
   137 			iCommServer.Close();
   131 			iCommServer.Close();
   138 			return err;
   132 			return err;
   139 			}
   133 			}
   140 		}
   134 		}
   141 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, MCOMM_COMMOPEN1_2, "Sucessfully Opened Serial Port");
   135 	LOGDATA1("Sucessfully Opened Serial Port");
   142 	return KErrNone;
   136 	return KErrNone;
   143 	}
   137 	}
   144 
   138 
   145 void MComm::CommClose()
   139 void MComm::CommClose()
   146 /**
   140 /**