usbmgmt/usbmgr/device/classdrivers/acm/classimplementation/ecacm/src/RegistrationPort.cpp
branchRCL_3
changeset 16 012cc2ee6408
parent 15 f92a4f87e424
equal deleted inserted replaced
15:f92a4f87e424 16:012cc2ee6408
     1 /*
     1 /*
     2 * Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    13 *
    13 *
    14 * Description:
    14 * Description:
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include <usb/acmserver.h>
       
    19 #include "RegistrationPort.h"
    18 #include "RegistrationPort.h"
    20 #include "AcmConstants.h"
    19 #include "AcmConstants.h"
    21 #include "AcmUtils.h"
    20 #include "AcmUtils.h"
       
    21 #include <usb/acmserver.h>
    22 #include "acmcontroller.h"
    22 #include "acmcontroller.h"
       
    23 #include <usb/usblogger.h>
    23 #include "acmserverconsts.h"
    24 #include "acmserverconsts.h"
    24 #include "OstTraceDefinitions.h"
    25 
    25 #ifdef OST_TRACE_COMPILER_IN_USE
    26 #ifdef __FLOG_ACTIVE
    26 #include "RegistrationPortTraces.h"
    27 _LIT8(KLogComponent, "ECACM");
    27 #endif
    28 #endif
    28 
       
    29 
    29 
    30 CRegistrationPort* CRegistrationPort::NewL(MAcmController& aAcmController, 
    30 CRegistrationPort* CRegistrationPort::NewL(MAcmController& aAcmController, 
    31 										   TUint aUnit)
    31 										   TUint aUnit)
    32 /**
    32 /**
    33  * Factory function.
    33  * Factory function.
    35  * @param aOwner Observer (the port factory).
    35  * @param aOwner Observer (the port factory).
    36  * @param aUnit The port number.
    36  * @param aUnit The port number.
    37  * @return Ownership of a newly created CRegistrationPort object
    37  * @return Ownership of a newly created CRegistrationPort object
    38  */
    38  */
    39 	{
    39 	{
    40 	OstTraceFunctionEntry0( CREGISTRATIONPORT_NEWL_ENTRY );
    40 	LOG_STATIC_FUNC_ENTRY
       
    41 
    41 	CRegistrationPort* self = new(ELeave) CRegistrationPort(aAcmController);
    42 	CRegistrationPort* self = new(ELeave) CRegistrationPort(aAcmController);
    42 	CleanupClosePushL(*self);
    43 	CleanupClosePushL(*self);
    43 	self->ConstructL(aUnit);
    44 	self->ConstructL(aUnit);
    44 	CleanupStack::Pop();
    45 	CleanupStack::Pop();
    45 	OstTraceFunctionExit0( CREGISTRATIONPORT_NEWL_EXIT );
       
    46 	return self;
    46 	return self;
    47 	}
    47 	}
    48 
    48 
    49 void CRegistrationPort::ConstructL(TUint aUnit)
    49 void CRegistrationPort::ConstructL(TUint aUnit)
    50 /**
    50 /**
    51  * 2nd-phase constructor. 
    51  * 2nd-phase constructor. 
    52  *
    52  *
    53  * @param aUnit The port number.
    53  * @param aUnit The port number.
    54  */
    54  */
    55 	{
    55 	{
    56 	OstTraceFunctionEntry0( CREGISTRATIONPORT_CONSTRUCTL_ENTRY );
    56 	LOG_FUNC
       
    57 
    57 	TName name;
    58 	TName name;
    58 	name.Num(aUnit);
    59 	name.Num(aUnit);
    59 	TInt err = SetName(&name);
    60 	LEAVEIFERRORL(SetName(&name));
    60 	if (err < 0)
       
    61 		{
       
    62 		OstTrace1( TRACE_NORMAL, CREGISTRATIONPORT_CONSTRUCTL, "CRegistrationPort::ConstructL;err=%d", err );
       
    63 		User::Leave(err);
       
    64 		}
       
    65 	OstTraceFunctionExit0( CREGISTRATIONPORT_CONSTRUCTL_EXIT );
       
    66 	}
    61 	}
    67 
    62 
    68 CRegistrationPort::CRegistrationPort(MAcmController& aAcmController) 
    63 CRegistrationPort::CRegistrationPort(MAcmController& aAcmController) 
    69 /**
    64 /**
    70  * Constructor.
    65  * Constructor.
    71  *
    66  *
    72  * @param aAcmController To use when creating and destroying ACM functions.
    67  * @param aAcmController To use when creating and destroying ACM functions.
    73  */
    68  */
    74  :	iAcmController(aAcmController)
    69  :	iAcmController(aAcmController)
    75 	{
    70 	{
    76 	OstTraceFunctionEntry0( CREGISTRATIONPORT_CREGISTRATIONPORT_CONS_ENTRY );
       
    77 	OstTraceFunctionExit0( CREGISTRATIONPORT_CREGISTRATIONPORT_CONS_EXIT );
       
    78 	}
    71 	}
    79 
    72 
    80 void CRegistrationPort::StartRead(const TAny* /*aClientBuffer*/, 
    73 void CRegistrationPort::StartRead(const TAny* /*aClientBuffer*/, 
    81 								  TInt /*aLength*/)
    74 								  TInt /*aLength*/)
    82 /**
    75 /**
    84  *
    77  *
    85  * @param aClientBuffer pointer to the Client's buffer
    78  * @param aClientBuffer pointer to the Client's buffer
    86  * @param aLength number of bytes to read
    79  * @param aLength number of bytes to read
    87  */
    80  */
    88 	{
    81 	{
    89 	OstTraceFunctionEntry0( CREGISTRATIONPORT_STARTREAD_ENTRY );
    82 	LOG_FUNC
       
    83 
    90 	ReadCompleted(KErrNotSupported);
    84 	ReadCompleted(KErrNotSupported);
    91 	OstTraceFunctionExit0( CREGISTRATIONPORT_STARTREAD_EXIT );
       
    92 	}
    85 	}
    93 
    86 
    94 void CRegistrationPort::ReadCancel()
    87 void CRegistrationPort::ReadCancel()
    95 /**
    88 /**
    96  * Cancel a read
    89  * Cancel a read
    97  */
    90  */
    98 	{
    91 	{
    99 	OstTraceFunctionEntry0( CREGISTRATIONPORT_READCANCEL_ENTRY );
    92 	LOG_FUNC
       
    93 
   100 	ReadCompleted(KErrNotSupported);
    94 	ReadCompleted(KErrNotSupported);
   101 	OstTraceFunctionExit0( CREGISTRATIONPORT_READCANCEL_EXIT );
       
   102 	}
    95 	}
   103 
    96 
   104 
    97 
   105 TInt CRegistrationPort::QueryReceiveBuffer(TInt& /*aLength*/) const
    98 TInt CRegistrationPort::QueryReceiveBuffer(TInt& /*aLength*/) const
   106 /**
    99 /**
   108  *
   101  *
   109  * @param aLength reference to where the size will be written to
   102  * @param aLength reference to where the size will be written to
   110  * @return KErrNotSupported always.
   103  * @return KErrNotSupported always.
   111  */
   104  */
   112 	{
   105 	{
   113 	OstTraceFunctionEntry0( CREGISTRATIONPORT_QUERYRECEIVEBUFFER_ENTRY );
   106 	LOG_FUNC
   114 	OstTraceFunctionExit0( CREGISTRATIONPORT_QUERYRECEIVEBUFFER_EXIT );
   107 
   115 	return KErrNotSupported;
   108 	return KErrNotSupported;
   116 	}
   109 	}
   117 
   110 
   118 void CRegistrationPort::ResetBuffers(TUint)
   111 void CRegistrationPort::ResetBuffers(TUint)
   119 /**
   112 /**
   120  * Reset Tx and Rx buffers.
   113  * Reset Tx and Rx buffers.
   121  * Not supported.
   114  * Not supported.
   122  */
   115  */
   123 	{
   116 	{
   124 	OstTraceFunctionEntry0( CREGISTRATIONPORT_RESETBUFFERS_ENTRY );
   117 	LOG_FUNC
   125 	OstTraceFunctionExit0( CREGISTRATIONPORT_RESETBUFFERS_EXIT );
       
   126 	}
   118 	}
   127 
   119 
   128 void CRegistrationPort::StartWrite(const TAny* /*aClientBuffer*/, 
   120 void CRegistrationPort::StartWrite(const TAny* /*aClientBuffer*/, 
   129 								   TInt /*aLength*/)
   121 								   TInt /*aLength*/)
   130 /**
   122 /**
   132  *
   124  *
   133  * @param aClientBuffer pointer to the Client's buffer
   125  * @param aClientBuffer pointer to the Client's buffer
   134  * @param aLength number of bytes to write
   126  * @param aLength number of bytes to write
   135  */
   127  */
   136 	{
   128 	{
   137 	OstTraceFunctionEntry0( CREGISTRATIONPORT_STARTWRITE_ENTRY );
   129 	LOG_FUNC
       
   130 
   138 	WriteCompleted(KErrNotSupported);
   131 	WriteCompleted(KErrNotSupported);
   139 	OstTraceFunctionExit0( CREGISTRATIONPORT_STARTWRITE_EXIT );
       
   140 	}
   132 	}
   141 
   133 
   142 void CRegistrationPort::WriteCancel()
   134 void CRegistrationPort::WriteCancel()
   143 /**
   135 /**
   144  * Cancel a pending write
   136  * Cancel a pending write
   145  */
   137  */
   146 	{
   138 	{
   147 	OstTraceFunctionEntry0( CREGISTRATIONPORT_WRITECANCEL_ENTRY );
   139 	LOG_FUNC
       
   140 
   148 	WriteCompleted(KErrNotSupported);
   141 	WriteCompleted(KErrNotSupported);
   149 	OstTraceFunctionExit0( CREGISTRATIONPORT_WRITECANCEL_EXIT );
       
   150 	}
   142 	}
   151 
   143 
   152 void CRegistrationPort::Break(TInt /*aTime*/)
   144 void CRegistrationPort::Break(TInt /*aTime*/)
   153 /**
   145 /**
   154  * Send a break signal to the host.
   146  * Send a break signal to the host.
   155  *
   147  *
   156  * @param aTime Length of break in microseconds
   148  * @param aTime Length of break in microseconds
   157  */
   149  */
   158 	{
   150 	{
   159 	OstTraceFunctionEntry0( CREGISTRATIONPORT_BREAK_ENTRY );
   151 	LOG_FUNC
       
   152 
   160 	BreakCompleted(KErrNotSupported);
   153 	BreakCompleted(KErrNotSupported);
   161 	OstTraceFunctionExit0( CREGISTRATIONPORT_BREAK_EXIT );
       
   162 	}
   154 	}
   163 
   155 
   164 void CRegistrationPort::BreakCancel()
   156 void CRegistrationPort::BreakCancel()
   165 /**
   157 /**
   166  * Cancel a pending break.
   158  * Cancel a pending break.
   167  */
   159  */
   168 	{
   160 	{
   169 	OstTraceFunctionEntry0( CREGISTRATIONPORT_BREAKCANCEL_ENTRY );
   161 	LOG_FUNC
   170 	OstTraceFunctionExit0( CREGISTRATIONPORT_BREAKCANCEL_EXIT );
       
   171 	}
   162 	}
   172 
   163 
   173 TInt CRegistrationPort::GetConfig(TDes8& /*aDes*/) const
   164 TInt CRegistrationPort::GetConfig(TDes8& /*aDes*/) const
   174 /**
   165 /**
   175  * Pass a config request
   166  * Pass a config request
   176  *
   167  *
   177  * @param aDes config will be written to this descriptor 
   168  * @param aDes config will be written to this descriptor 
   178  * @return Error
   169  * @return Error
   179  */
   170  */
   180 	{
   171 	{
   181 	OstTraceFunctionEntry0( CREGISTRATIONPORT_GETCONFIG_ENTRY );
   172 	LOG_FUNC
   182 	OstTraceFunctionExit0( CREGISTRATIONPORT_GETCONFIG_EXIT );
   173 
   183 	return KErrNotSupported;
   174 	return KErrNotSupported;
   184 	}
   175 	}
   185 
   176 
   186 TInt CRegistrationPort::SetConfig(const TDesC8& /*aDes*/)
   177 TInt CRegistrationPort::SetConfig(const TDesC8& /*aDes*/)
   187 /**
   178 /**
   189  *
   180  *
   190  * @param aDes descriptor containing the new config
   181  * @param aDes descriptor containing the new config
   191  * @return Error
   182  * @return Error
   192  */
   183  */
   193 	{
   184 	{
   194 	OstTraceFunctionEntry0( CREGISTRATIONPORT_SETCONFIG_ENTRY );
   185 	LOG_FUNC
   195 	OstTraceFunctionExit0( CREGISTRATIONPORT_SETCONFIG_EXIT );
   186 
   196 	return KErrNotSupported;
   187 	return KErrNotSupported;
   197 	}
   188 	}
   198 
   189 
   199 TInt CRegistrationPort::SetServerConfig(const TDesC8& /*aDes*/)
   190 TInt CRegistrationPort::SetServerConfig(const TDesC8& /*aDes*/)
   200 /**
   191 /**
   202  *
   193  *
   203  * @param aDes package with new server configurations
   194  * @param aDes package with new server configurations
   204  * @return Error
   195  * @return Error
   205  */
   196  */
   206 	{
   197 	{
   207 	OstTraceFunctionEntry0( CREGISTRATIONPORT_SETSERVERCONFIG_ENTRY );
   198 	LOG_FUNC
   208 	OstTraceFunctionExit0( CREGISTRATIONPORT_SETSERVERCONFIG_EXIT );
   199 
   209 	return KErrNotSupported;
   200 	return KErrNotSupported;
   210 	}
   201 	}
   211 
   202 
   212 TInt CRegistrationPort::GetServerConfig(TDes8& /*aDes*/)
   203 TInt CRegistrationPort::GetServerConfig(TDes8& /*aDes*/)
   213 /**
   204 /**
   215  *
   206  *
   216  * @param aDes server configs will be written to this descriptor
   207  * @param aDes server configs will be written to this descriptor
   217  * @return Error
   208  * @return Error
   218  */
   209  */
   219 	{
   210 	{
   220 	OstTraceFunctionEntry0( CREGISTRATIONPORT_GETSERVERCONFIG_ENTRY );
   211 	LOG_FUNC
   221 	OstTraceFunctionExit0( CREGISTRATIONPORT_GETSERVERCONFIG_EXIT );
   212 	
   222 	return KErrNotSupported;
   213 	return KErrNotSupported;
   223 	}
   214 	}
   224 
   215 
   225 TInt CRegistrationPort::GetCaps(TDes8& /*aDes*/)
   216 TInt CRegistrationPort::GetCaps(TDes8& /*aDes*/)
   226 /**
   217 /**
   228  *
   219  *
   229  * @param aDes caps will be written to this descriptor
   220  * @param aDes caps will be written to this descriptor
   230  * @return Error
   221  * @return Error
   231  */
   222  */
   232 	{
   223 	{
   233 	OstTraceFunctionEntry0( CREGISTRATIONPORT_GETCAPS_ENTRY );
   224 	LOG_FUNC
   234 	OstTraceFunctionExit0( CREGISTRATIONPORT_GETCAPS_EXIT );
   225 
   235 	return KErrNotSupported;
   226 	return KErrNotSupported;
   236 	}
   227 	}
   237 
   228 
   238 TInt CRegistrationPort::GetSignals(TUint& /*aSignals*/)
   229 TInt CRegistrationPort::GetSignals(TUint& /*aSignals*/)
   239 /**
   230 /**
   241  *
   232  *
   242  * @param aSignals signals will be written to this descriptor
   233  * @param aSignals signals will be written to this descriptor
   243  * @return Error
   234  * @return Error
   244  */
   235  */
   245 	{
   236 	{
   246 	OstTraceFunctionEntry0( CREGISTRATIONPORT_GETSIGNALS_ENTRY );
   237 	LOG_FUNC
   247 	OstTraceFunctionExit0( CREGISTRATIONPORT_GETSIGNALS_EXIT );
   238 
   248 	return KErrNotSupported;
   239 	return KErrNotSupported;
   249 	}
   240 	}
   250 
   241 
   251 TInt CRegistrationPort::SetSignalsToMark(TUint aAcmField)
   242 TInt CRegistrationPort::SetSignalsToMark(TUint aAcmField)
   252 /**
   243 /**
   258  * @param aAcmField Low 2 bytes- number of ACM interfaces to create. High 2 
   249  * @param aAcmField Low 2 bytes- number of ACM interfaces to create. High 2 
   259  * bytes- protocol number (from USBCDC 1.1 Table 17).
   250  * bytes- protocol number (from USBCDC 1.1 Table 17).
   260  * @return Error
   251  * @return Error
   261  */
   252  */
   262 	{
   253 	{
   263 	OstTraceFunctionEntry0( CREGISTRATIONPORT_SETSIGNALSTOMARK_ENTRY );
   254 	LOGTEXT2(_L8(">>CRegistrationPort::SetSignalsToMark aAcmField = 0x%x"), aAcmField);
   264 	OstTrace1( TRACE_NORMAL, CREGISTRATIONPORT_SETSIGNALSTOMARK, "CRegistrationPort::SetSignalsToMark;aAcmField = 0x%x", aAcmField );
       
   265 
   255 
   266 	// Extract number of interfaces and protocol number
   256 	// Extract number of interfaces and protocol number
   267 	//	low 2 bytes represent the number of ACMs
   257 	//	low 2 bytes represent the number of ACMs
   268 	//	high 2 bytes represent the protocol number to use
   258 	//	high 2 bytes represent the protocol number to use
   269 	TUint interfaces = aAcmField & 0x0000FFFF;
   259 	TUint interfaces = aAcmField & 0x0000FFFF;
   273 	// i.e. the client is not using this interface to set the protocol number
   263 	// i.e. the client is not using this interface to set the protocol number
   274 	// NOTE: This means you cannot set a protocol number of 0 - to do this use the ACM Server.
   264 	// NOTE: This means you cannot set a protocol number of 0 - to do this use the ACM Server.
   275 	protocolNumber = protocolNumber ? protocolNumber : KDefaultAcmProtocolNum;
   265 	protocolNumber = protocolNumber ? protocolNumber : KDefaultAcmProtocolNum;
   276 
   266 
   277 	TInt ret = iAcmController.CreateFunctions(interfaces, protocolNumber, KControlIfcName, KDataIfcName);
   267 	TInt ret = iAcmController.CreateFunctions(interfaces, protocolNumber, KControlIfcName, KDataIfcName);
   278 	OstTrace1( TRACE_NORMAL, CREGISTRATIONPORT_SETSIGNALSTOMARK_DUP1, "CRegistrationPort::SetSignalsToMark;ret=%d", ret );
   268 
   279 	OstTraceFunctionExit0( CREGISTRATIONPORT_SETSIGNALSTOMARK_EXIT );
   269 	LOGTEXT2(_L8("<<CRegistrationPort::SetSignalsToMark ret = %d"), ret);
   280 	return ret;
   270 	return ret;
   281 	}
   271 	}
   282 
   272 
   283 TInt CRegistrationPort::SetSignalsToSpace(TUint aNoAcms)
   273 TInt CRegistrationPort::SetSignalsToSpace(TUint aNoAcms)
   284 /**
   274 /**
   289  *
   279  *
   290  * @param aNoAcms Number of ACM interfaces to destroy.
   280  * @param aNoAcms Number of ACM interfaces to destroy.
   291  * @return Error
   281  * @return Error
   292  */
   282  */
   293 	{
   283 	{
   294 	OstTraceFunctionEntry0( CREGISTRATIONPORT_SETSIGNALSTOSPACE_ENTRY );
   284 	LOGTEXT2(_L8(">>CRegistrationPort::SetSignalsToSpace aNoAcms = %d"), aNoAcms);
   295 	OstTrace1( TRACE_NORMAL, CREGISTRATIONPORT_SETSIGNALSTOSPACE, "CRegistrationPort::SetSignalsToSpace;aNoAcms=%d", (TInt)aNoAcms );
   285 
   296 	iAcmController.DestroyFunctions(aNoAcms);
   286 	iAcmController.DestroyFunctions(aNoAcms);
   297 	OstTrace0( TRACE_NORMAL, CREGISTRATIONPORT_SETSIGNALSTOSPACE_DUP1, "CRegistrationPort::SetSignalsToSpace;ret = KErrNone" );
   287 
   298 	OstTraceFunctionExit0( CREGISTRATIONPORT_SETSIGNALSTOSPACE_EXIT );
   288 	LOGTEXT(_L8("<<CRegistrationPort::SetSignalsToSpace ret = KErrNone"));
   299 	return KErrNone;
   289 	return KErrNone;
   300 	}
   290 	}
   301 
   291 
   302 TInt CRegistrationPort::GetReceiveBufferLength(TInt& /*aLength*/) const
   292 TInt CRegistrationPort::GetReceiveBufferLength(TInt& /*aLength*/) const
   303 /**
   293 /**
   305  *
   295  *
   306  * @param aLength reference to where the length will be written to
   296  * @param aLength reference to where the length will be written to
   307  * @return Error
   297  * @return Error
   308  */
   298  */
   309 	{
   299 	{
   310 	OstTraceFunctionEntry0( CREGISTRATIONPORT_GETRECEIVEBUFFERLENGTH_ENTRY );
   300 	LOG_FUNC
   311 	OstTraceFunctionExit0( CREGISTRATIONPORT_GETRECEIVEBUFFERLENGTH_EXIT );
   301 
   312 	return KErrNotSupported;
   302 	return KErrNotSupported;
   313 	}
   303 	}
   314 
   304 
   315 TInt CRegistrationPort::SetReceiveBufferLength(TInt /*aLength*/)
   305 TInt CRegistrationPort::SetReceiveBufferLength(TInt /*aLength*/)
   316 /**
   306 /**
   318  *
   308  *
   319  * @param aLength new length of Tx and Rx buffer
   309  * @param aLength new length of Tx and Rx buffer
   320  * @return Error
   310  * @return Error
   321  */
   311  */
   322 	{
   312 	{
   323 	OstTraceFunctionEntry0( CREGISTRATIONPORT_SETRECEIVEBUFFERLENGTH_ENTRY );
   313 	LOG_FUNC
   324 	OstTraceFunctionExit0( CREGISTRATIONPORT_SETRECEIVEBUFFERLENGTH_EXIT );
   314 
   325 	return KErrNotSupported;
   315 	return KErrNotSupported;
   326 	}
   316 	}
   327 
   317 
   328 void CRegistrationPort::Destruct()
   318 void CRegistrationPort::Destruct()
   329 /**
   319 /**
   330  * Destruct - we must (eventually) call delete this
   320  * Destruct - we must (eventually) call delete this
   331  */
   321  */
   332 	{
   322 	{
   333 	OstTraceFunctionEntry0( CREGISTRATIONPORT_DESTRUCT_ENTRY );
   323 	LOG_FUNC
       
   324 
   334 	delete this;
   325 	delete this;
   335 	OstTraceFunctionExit0( CREGISTRATIONPORT_DESTRUCT_EXIT );
       
   336 	}
   326 	}
   337 
   327 
   338 void CRegistrationPort::FreeMemory()
   328 void CRegistrationPort::FreeMemory()
   339 /**
   329 /**
   340  * Attempt to reduce our memory foot print.
   330  * Attempt to reduce our memory foot print.
   341  */
   331  */
   342 	{
   332 	{
   343 	OstTraceFunctionEntry0( CREGISTRATIONPORT_FREEMEMORY_ENTRY );
   333 	LOG_FUNC
   344 	OstTraceFunctionExit0( CREGISTRATIONPORT_FREEMEMORY_EXIT );
       
   345 	}
   334 	}
   346 
   335 
   347 void CRegistrationPort::NotifyDataAvailable()
   336 void CRegistrationPort::NotifyDataAvailable()
   348 /**
   337 /**
   349  * Notify client when data is available
   338  * Notify client when data is available
   350  */
   339  */
   351 	{
   340 	{
   352 	OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYDATAAVAILABLE_ENTRY );
   341 	LOG_FUNC
       
   342 
   353 	NotifyDataAvailableCompleted(KErrNotSupported);
   343 	NotifyDataAvailableCompleted(KErrNotSupported);
   354 	OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYDATAAVAILABLE_EXIT );
       
   355 	}
   344 	}
   356 
   345 
   357 void CRegistrationPort::NotifyDataAvailableCancel()
   346 void CRegistrationPort::NotifyDataAvailableCancel()
   358 /**
   347 /**
   359  * Cancel an outstanding data availalbe notification
   348  * Cancel an outstanding data availalbe notification
   360  */
   349  */
   361 	{
   350 	{
   362 	OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYDATAAVAILABLECANCEL_ENTRY );
   351 	LOG_FUNC
       
   352 
   363 	NotifyDataAvailableCompleted(KErrNotSupported);
   353 	NotifyDataAvailableCompleted(KErrNotSupported);
   364 	OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYDATAAVAILABLECANCEL_EXIT );
       
   365 	}
   354 	}
   366 
   355 
   367 TInt CRegistrationPort::GetFlowControlStatus(TFlowControl& /*aFlowControl*/)
   356 TInt CRegistrationPort::GetFlowControlStatus(TFlowControl& /*aFlowControl*/)
   368 /**
   357 /**
   369  * Get the flow control status
   358  * Get the flow control status
   370  *
   359  *
   371  * @param aFlowControl flow control status will be written to this descriptor
   360  * @param aFlowControl flow control status will be written to this descriptor
   372  * @return Error
   361  * @return Error
   373  */
   362  */
   374 	{
   363 	{
   375 	OstTraceFunctionEntry0( CREGISTRATIONPORT_GETFLOWCONTROLSTATUS_ENTRY );
   364 	LOG_FUNC
   376 	OstTraceFunctionExit0( CREGISTRATIONPORT_GETFLOWCONTROLSTATUS_EXIT );
   365 
   377 	return KErrNotSupported;
   366 	return KErrNotSupported;
   378 	}
   367 	}
   379 
   368 
   380 void CRegistrationPort::NotifyOutputEmpty()
   369 void CRegistrationPort::NotifyOutputEmpty()
   381 /**
   370 /**
   382  * Notify the client when the output buffer is empty.
   371  * Notify the client when the output buffer is empty.
   383  */
   372  */
   384 	{
   373 	{
   385 	OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYOUTPUTEMPTY_ENTRY );
   374 	LOG_FUNC
       
   375 	
   386 	NotifyOutputEmptyCompleted(KErrNotSupported);
   376 	NotifyOutputEmptyCompleted(KErrNotSupported);
   387 	OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYOUTPUTEMPTY_EXIT );
       
   388 	}
   377 	}
   389 
   378 
   390 void CRegistrationPort::NotifyOutputEmptyCancel()
   379 void CRegistrationPort::NotifyOutputEmptyCancel()
   391 /**
   380 /**
   392  * Cancel a pending request to be notified when the output buffer is empty.
   381  * Cancel a pending request to be notified when the output buffer is empty.
   393  */
   382  */
   394 	{
   383 	{
   395 	OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYOUTPUTEMPTYCANCEL_ENTRY );
   384 	LOG_FUNC
       
   385 
   396 	NotifyOutputEmptyCompleted(KErrNotSupported);
   386 	NotifyOutputEmptyCompleted(KErrNotSupported);
   397 	OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYOUTPUTEMPTYCANCEL_EXIT );
       
   398 	}
   387 	}
   399 
   388 
   400 void CRegistrationPort::NotifyBreak()
   389 void CRegistrationPort::NotifyBreak()
   401 /**
   390 /**
   402  * Notify a client of a break on the serial line.
   391  * Notify a client of a break on the serial line.
   403  */
   392  */
   404 	{
   393 	{
   405 	OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYBREAK_ENTRY );
   394 	LOG_FUNC
       
   395 
   406 	BreakNotifyCompleted(KErrNotSupported);
   396 	BreakNotifyCompleted(KErrNotSupported);
   407 	OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYBREAK_EXIT );
       
   408 	}
   397 	}
   409 
   398 
   410 void CRegistrationPort::NotifyBreakCancel()
   399 void CRegistrationPort::NotifyBreakCancel()
   411 /**
   400 /**
   412  * Cancel a pending notification of a serial line break.
   401  * Cancel a pending notification of a serial line break.
   413  */
   402  */
   414 	{
   403 	{
   415 	OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYBREAKCANCEL_ENTRY );
   404 	LOG_FUNC
       
   405 
   416 	BreakNotifyCompleted(KErrNotSupported);
   406 	BreakNotifyCompleted(KErrNotSupported);
   417 	OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYBREAKCANCEL_EXIT );
       
   418 	}
   407 	}
   419 
   408 
   420 void CRegistrationPort::NotifyFlowControlChange()
   409 void CRegistrationPort::NotifyFlowControlChange()
   421 /**
   410 /**
   422  * Notify a client of a change in the flow control state.
   411  * Notify a client of a change in the flow control state.
   423  */
   412  */
   424 	{
   413 	{
   425 	OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYFLOWCONTROLCHANGE_ENTRY );
   414 	LOG_FUNC
       
   415 	
   426 	FlowControlChangeCompleted(EFlowControlOn,KErrNotSupported);
   416 	FlowControlChangeCompleted(EFlowControlOn,KErrNotSupported);
   427 	OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYFLOWCONTROLCHANGE_EXIT );
       
   428 	}
   417 	}
   429 
   418 
   430 void CRegistrationPort::NotifyFlowControlChangeCancel()
   419 void CRegistrationPort::NotifyFlowControlChangeCancel()
   431 /**
   420 /**
   432  * Cancel a pending request to be notified when the flow control state changes.
   421  * Cancel a pending request to be notified when the flow control state changes.
   433  */
   422  */
   434 	{
   423 	{
   435 	OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYFLOWCONTROLCHANGECANCEL_ENTRY );
   424 	LOG_FUNC
       
   425 
   436 	FlowControlChangeCompleted(EFlowControlOn,KErrNotSupported);
   426 	FlowControlChangeCompleted(EFlowControlOn,KErrNotSupported);
   437 	OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYFLOWCONTROLCHANGECANCEL_EXIT );
       
   438 	}
   427 	}
   439 
   428 
   440 void CRegistrationPort::NotifyConfigChange()
   429 void CRegistrationPort::NotifyConfigChange()
   441 /**
   430 /**
   442  * Notify a client of a change to the serial port configuration.
   431  * Notify a client of a change to the serial port configuration.
   443  */
   432  */
   444 	{
   433 	{
   445 	OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYCONFIGCHANGE_ENTRY );
   434 	LOG_FUNC
       
   435 
   446 	ConfigChangeCompleted(KNullDesC8, KErrNotSupported);
   436 	ConfigChangeCompleted(KNullDesC8, KErrNotSupported);
   447 	OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYCONFIGCHANGE_EXIT );
       
   448 	}
   437 	}
   449 
   438 
   450 void CRegistrationPort::NotifyConfigChangeCancel()
   439 void CRegistrationPort::NotifyConfigChangeCancel()
   451 /**
   440 /**
   452  * Cancel a pending request to be notified of a change to the serial port 
   441  * Cancel a pending request to be notified of a change to the serial port 
   453  * configuration.
   442  * configuration.
   454  */
   443  */
   455 	{
   444 	{
   456 	OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYCONFIGCHANGECANCEL_ENTRY );
   445 	LOG_FUNC
       
   446 
   457 	ConfigChangeCompleted(KNullDesC8, KErrNotSupported);
   447 	ConfigChangeCompleted(KNullDesC8, KErrNotSupported);
   458 	OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYCONFIGCHANGECANCEL_EXIT );
       
   459 	}
   448 	}
   460 
   449 
   461 void CRegistrationPort::NotifySignalChange(TUint /*aSignalMask*/)
   450 void CRegistrationPort::NotifySignalChange(TUint /*aSignalMask*/)
   462 /**
   451 /**
   463  * Notify a client of a change to the signal lines.
   452  * Notify a client of a change to the signal lines.
   464  */
   453  */
   465 	{
   454 	{
   466 	OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYSIGNALCHANGE_ENTRY );
   455 	LOG_FUNC
       
   456 
   467 	SignalChangeCompleted(0, KErrNotSupported);
   457 	SignalChangeCompleted(0, KErrNotSupported);
   468 	OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYSIGNALCHANGE_EXIT );
       
   469 	}
   458 	}
   470 
   459 
   471 void CRegistrationPort::NotifySignalChangeCancel()
   460 void CRegistrationPort::NotifySignalChangeCancel()
   472 /**
   461 /**
   473  * Cancel a pending client request to be notified about a change to the signal 
   462  * Cancel a pending client request to be notified about a change to the signal 
   474  * lines.
   463  * lines.
   475  */
   464  */
   476 	{
   465 	{
   477 	OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYSIGNALCHANGECANCEL_ENTRY );
   466 	LOG_FUNC
       
   467 
   478 	SignalChangeCompleted(0, KErrNotSupported);
   468 	SignalChangeCompleted(0, KErrNotSupported);
   479 	OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYSIGNALCHANGECANCEL_EXIT );
       
   480 	}
   469 	}
   481 
   470 
   482 TInt CRegistrationPort::GetRole(TCommRole& aRole)
   471 TInt CRegistrationPort::GetRole(TCommRole& aRole)
   483 /**
   472 /**
   484  * Get the role of this port unit
   473  * Get the role of this port unit
   485  *
   474  *
   486  * @param aRole reference to where the role will be written to
   475  * @param aRole reference to where the role will be written to
   487  * @return Error
   476  * @return Error
   488  */
   477  */
   489 	{
   478 	{
   490 	OstTraceFunctionEntry0( CREGISTRATIONPORT_GETROLE_ENTRY );
   479 	LOG_FUNC
   491 	aRole = iRole;
   480 	aRole = iRole;
   492 	OstTrace1( TRACE_NORMAL, CREGISTRATIONPORT_GETROLE, "CRegistrationPort::GetRole;aRole=%d", (TInt)aRole );
   481 	LOGTEXT2(_L8("\trole=%d"), aRole);
   493 	OstTraceFunctionExit0( CREGISTRATIONPORT_GETROLE_EXIT );
       
   494 	return KErrNone;
   482 	return KErrNone;
   495 	}
   483 	}
   496 
   484 
   497 TInt CRegistrationPort::SetRole(TCommRole aRole)
   485 TInt CRegistrationPort::SetRole(TCommRole aRole)
   498 /**
   486 /**
   500  *
   488  *
   501  * @param aRole the new role
   489  * @param aRole the new role
   502  * @return Error
   490  * @return Error
   503  */
   491  */
   504 	{
   492 	{
   505 	OstTraceFunctionEntry0( CREGISTRATIONPORT_SETROLE_ENTRY );
   493 	LOG_FUNC
       
   494 
   506 	// This is required to keep C32 happy while opening the port.
   495 	// This is required to keep C32 happy while opening the port.
   507 	// All we do is store the role and return it if asked.
   496 	// All we do is store the role and return it if asked.
   508 	// Note that this is needed for multiple ACM ports because C32 doesn't 
   497 	// Note that this is needed for multiple ACM ports because C32 doesn't 
   509 	// check the return value for multiple ports so opening registration port 
   498 	// check the return value for multiple ports so opening registration port 
   510 	// more than once will fail.
   499 	// more than once will fail.
   511 	iRole = aRole;
   500 	iRole = aRole;
   512 	OstTraceFunctionExit0( CREGISTRATIONPORT_SETROLE_EXIT );
       
   513 	return KErrNone; 
   501 	return KErrNone; 
   514 	}
   502 	}
   515 
   503 
   516 CRegistrationPort::~CRegistrationPort()
   504 CRegistrationPort::~CRegistrationPort()
   517 /**
   505 /**
   518  * Destructor.
   506  * Destructor.
   519  */
   507  */
   520 	{
   508 	{
   521 	OstTraceFunctionEntry0( CREGISTRATIONPORT_CREGISTRATIONPORT_DES_ENTRY );
   509 	LOG_FUNC
   522 	OstTraceFunctionExit0( CREGISTRATIONPORT_CREGISTRATIONPORT_DES_EXIT );
       
   523 	}
   510 	}
   524 
   511 
   525 //
   512 //
   526 // End of file
   513 // End of file