equal
deleted
inserted
replaced
1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2001-2010 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 |
22 #include "CSimSerComm.h" |
29 #include "CSimSerComm.h" |
23 #include "CSimPhone.h" |
30 #include "CSimPhone.h" |
24 #include "Simlog.h" |
|
25 |
31 |
26 MComm::MComm() |
32 MComm::MComm() |
27 /** |
33 /** |
28 * Trivial constructor. |
34 * Trivial constructor. |
29 */ |
35 */ |
110 * @param aName The serial port name. |
116 * @param aName The serial port name. |
111 * @param aMode The required access mode: shared, exclusive, etc... |
117 * @param aMode The required access mode: shared, exclusive, etc... |
112 * @return TInt Standard error value. |
118 * @return TInt Standard error value. |
113 */ |
119 */ |
114 { |
120 { |
115 LOGDATA1("Attempting to Open Serial Port"); |
121 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, MCOMM_COMMOPEN1_1, "Attempting to Open Serial Port"); |
116 TInt err; |
122 TInt err; |
117 if (err = iCommServer.Connect(), err!=KErrNone) |
123 if (err = iCommServer.Connect(), err!=KErrNone) |
118 return err; |
124 return err; |
119 if (err = iCommPort.Open(iCommServer, aName, ECommExclusive), err!=KErrNone) |
125 if (err = iCommPort.Open(iCommServer, aName, ECommExclusive), err!=KErrNone) |
120 // if any other TSY (or other app) is using comm port, we want to return gracefully |
126 // if any other TSY (or other app) is using comm port, we want to return gracefully |
130 { |
136 { |
131 iCommServer.Close(); |
137 iCommServer.Close(); |
132 return err; |
138 return err; |
133 } |
139 } |
134 } |
140 } |
135 LOGDATA1("Sucessfully Opened Serial Port"); |
141 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, MCOMM_COMMOPEN1_2, "Sucessfully Opened Serial Port"); |
136 return KErrNone; |
142 return KErrNone; |
137 } |
143 } |
138 |
144 |
139 void MComm::CommClose() |
145 void MComm::CommClose() |
140 /** |
146 /** |