systemswstubs/hwrmstubplugins/src/FmtxPlugin.cpp
changeset 46 e1758cbb96ac
parent 0 0ce1b5ce9557
equal deleted inserted replaced
43:e71858845f73 46:e1758cbb96ac
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Hardware Resource Manager stub plugins fmtx plugin 
       
    15 *                implementation.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #include <hwrmfmtxcommands.h>
       
    22 #include "FmtxPlugin.h"
       
    23 #include "PluginTimer.h"
       
    24 #include "Trace.h"
       
    25 
       
    26 const TUint32 KFmTxStubPluginFreqMax  = 107900; // KHz
       
    27 const TUint32 KFmTxStubPluginFreqMin  = 88100; // KHz
       
    28 const TUint32 KFmTxStubPluginStepSize = 50; // KHz
       
    29 const TInt KMaxLengthMarker = 63;
       
    30 
       
    31 #ifdef PUBLISH_STATE_INFO
       
    32 const TUid KPSUidHWResourceNotification = {0x101F7A01}; // HWRM private PS Uid
       
    33 #endif /* PUBLISH_STATE_INFO */
       
    34 
       
    35 
       
    36 CFmtxPlugin* CFmtxPlugin::NewL()
       
    37     {
       
    38     COMPONENT_TRACE(( _L("CFmtxPlugin::NewL()") ));
       
    39     
       
    40     CFmtxPlugin* self = new(ELeave) CFmtxPlugin();
       
    41     CleanupStack::PushL(self);
       
    42     self->ConstructL();
       
    43     CleanupStack::Pop();
       
    44     return self;
       
    45     }
       
    46 
       
    47 
       
    48 CFmtxPlugin::~CFmtxPlugin()
       
    49     {
       
    50     COMPONENT_TRACE(( _L("CFmtxPlugin::~CFmtxPlugin()") ));
       
    51     
       
    52     iTimers.ResetAndDestroy();
       
    53 #ifdef PUBLISH_STATE_INFO
       
    54     iCmdProperty.Close();
       
    55     iDataProperty.Close();
       
    56 #endif /* PUBLISH_STATE_INFO */
       
    57     }
       
    58 
       
    59 
       
    60 CFmtxPlugin::CFmtxPlugin() : iLastCommand(HWRMFmTxCommand::ENoCommandId),
       
    61                              iHwState(HWRMFmTxCommand::EFmTxHwStateOff),
       
    62                              iClearFrequency(KFmTxStubPluginFreqMin)
       
    63     {
       
    64     COMPONENT_TRACE(( _L("CFmtxPlugin::CFmtxPlugin()") ));
       
    65     }
       
    66 
       
    67 
       
    68 void CFmtxPlugin::ConstructL()
       
    69     {
       
    70     COMPONENT_TRACE(( _L("CFmtxPlugin::ConstructL") ));
       
    71 
       
    72 #ifdef PUBLISH_STATE_INFO
       
    73     RProperty::Define(KPSUidHWResourceNotification, KHWRMTestFmtxCommand, RProperty::EInt);
       
    74     RProperty::Define(KPSUidHWResourceNotification, KHWRMTestFmtxDataPckg, RProperty::EByteArray, 512);
       
    75     iCmdProperty.Attach(KPSUidHWResourceNotification, KHWRMTestFmtxCommand);
       
    76     iDataProperty.Attach(KPSUidHWResourceNotification, KHWRMTestFmtxDataPckg);
       
    77 #endif /* PUBLISH_STATE_INFO */
       
    78     }
       
    79 
       
    80 
       
    81 TInt CFmtxPlugin::CheckFrequencyWithinRange(TDesC8& aData)
       
    82 	{
       
    83 	HWRMFmTxCommand::TSetFrequencyPackage pckg;
       
    84 	pckg.Copy(aData);
       
    85 	TInt frequency = pckg();
       
    86 			
       
    87 	if ( frequency < KFmTxStubPluginFreqMin ||
       
    88 		 frequency > KFmTxStubPluginFreqMax )
       
    89 		{
       
    90 		COMPONENT_TRACE((_L("CFmtxPlugin::CheckFrequencyWithinRange, frequency %d is out of range"), frequency));
       
    91 		return KErrArgument;
       
    92 		}
       
    93 	else
       
    94 		{
       
    95 		iFrequency = frequency;
       
    96 		return KErrNone;
       
    97 		}
       
    98 	}
       
    99 
       
   100 
       
   101 void CFmtxPlugin::ProcessCommandL(const TInt aCommandId,
       
   102                                   const TUint8 aTransId,
       
   103                                   TDesC8& aData)
       
   104     {
       
   105     COMPONENT_TRACE((_L("CFmtxPlugin::ProcessCommandL, command: 0x%x, TransId: 0x%x"), aCommandId, aTransId));
       
   106 
       
   107     TInt retVal(KErrNone);
       
   108 
       
   109     switch (aCommandId)
       
   110         {
       
   111         case HWRMFmTxCommand::ETxOnCmdId:
       
   112             {
       
   113             COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed ETxOnCmdId"));
       
   114             
       
   115             // check TSetFrequencyPackage param
       
   116 			if ( iHwState != HWRMFmTxCommand::EFmTxHwStateOff )
       
   117 				{
       
   118 				retVal = KErrInUse;
       
   119 				}
       
   120 			else
       
   121 			    {
       
   122 			    retVal = CheckFrequencyWithinRange(aData);
       
   123 			    }
       
   124 			}
       
   125             break;
       
   126             
       
   127         case HWRMFmTxCommand::ETxOffCmdId:
       
   128             {
       
   129             COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed ETxOffCmdId"));
       
   130             
       
   131 			if ( iHwState == HWRMFmTxCommand::EFmTxHwStateOff )
       
   132 				{
       
   133 				retVal = KErrNotReady;
       
   134 				}
       
   135             }
       
   136             break;
       
   137             
       
   138         case HWRMFmTxCommand::ESetTxFrequencyCmdId:
       
   139             {
       
   140             COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed ESetTxFrequencyCmdId"));
       
   141 
       
   142 			if ( iHwState == HWRMFmTxCommand::EFmTxHwStateOn )
       
   143 				{
       
   144             	// check TSetFrequencyPackage param
       
   145 				retVal = CheckFrequencyWithinRange(aData);
       
   146 				}
       
   147 			else
       
   148 				{
       
   149 				COMPONENT_TRACE((_L("HWRM FmtxPlugin: HW isn't ready, iHwState = %d"), iHwState));
       
   150 				retVal = KErrNotReady;
       
   151 				}			
       
   152             }
       
   153             break;
       
   154 
       
   155         case HWRMFmTxCommand::ETxScanRequestCmdId:
       
   156         	{
       
   157         	COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed ETxScanRequestCmdId"));
       
   158         	
       
   159 			if ( iHwState == HWRMFmTxCommand::EFmTxHwStateOn )
       
   160 				{        	
       
   161         		// check TScanRequestPackage param        	
       
   162         		HWRMFmTxCommand::TScanRequestPackage pckg;
       
   163 				pckg.Copy(aData);        	
       
   164 				TUint channelsRequested = pckg();			
       
   165                 if( channelsRequested > 10 )
       
   166                     {
       
   167                     // Should not come here because input verified in client end
       
   168                     retVal = KErrArgument;
       
   169                     }
       
   170 				iChannelsRequested = ( channelsRequested <= 10 ) ? channelsRequested : 10;
       
   171 				}
       
   172 			else
       
   173 				{
       
   174 				COMPONENT_TRACE((_L("HWRM FmtxPlugin: HW isn't ready, iHwState = %d"), iHwState));
       
   175 				retVal = KErrNotReady;
       
   176 				}
       
   177         	}
       
   178         	break;
       
   179 
       
   180         case HWRMFmTxCommand::EGetTxFrequencyRangeCmdId:
       
   181         	{
       
   182         	COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed EGetTxFrequencyRangeCmdId"));
       
   183         	
       
   184         	// No params to check
       
   185         	}
       
   186         	break;        
       
   187 
       
   188         case HWRMFmTxCommand::ESetTxRdsPsCmdId:
       
   189         	{
       
   190         	COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed ESetTxRdsPsCmdId"));
       
   191 
       
   192 			if ( iHwState == HWRMFmTxCommand::EFmTxHwStateOn )
       
   193 				{
       
   194 				// check TRdsPsPackage param
       
   195 				}
       
   196 			else
       
   197 				{
       
   198 				COMPONENT_TRACE((_L("HWRM FmtxPlugin: HW isn't ready, iHwState = %d"), iHwState));
       
   199 				retVal = KErrNotReady;
       
   200 				}
       
   201         	}
       
   202         	break;        
       
   203         
       
   204         case HWRMFmTxCommand::ESetTxRdsPtyCmdId:
       
   205         	{
       
   206         	COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed ESetTxRdsPtyCmdId"));
       
   207         	
       
   208 			if ( iHwState == HWRMFmTxCommand::EFmTxHwStateOn )
       
   209 				{
       
   210 				// Check TRdsPtyPackage param
       
   211         		HWRMFmTxCommand::TRdsPtyPackage pckg;
       
   212 				pckg.Copy(aData);        	
       
   213 				TInt programType = pckg();			
       
   214                 const TInt KRdsPtyFirst = 0;
       
   215                 const TInt KRdsPtyLast = 31;
       
   216 
       
   217                 if( programType < KRdsPtyFirst || programType > KRdsPtyLast )
       
   218                     {
       
   219                     // Should not come here because input verified in client end
       
   220                     retVal = KErrArgument;
       
   221                     }
       
   222 				}
       
   223 			else
       
   224 				{
       
   225 				COMPONENT_TRACE((_L("HWRM FmtxPlugin: HW isn't ready, iHwState = %d"), iHwState));
       
   226 				retVal = KErrNotReady;
       
   227 				}        	
       
   228         	}
       
   229         	break;        	        
       
   230         
       
   231         case HWRMFmTxCommand::ESetTxRdsPtynCmdId:
       
   232         	{
       
   233         	COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed ESetTxRdsPtynCmdId"));
       
   234         	
       
   235 			if ( iHwState == HWRMFmTxCommand::EFmTxHwStateOn )
       
   236 				{
       
   237         		// Check TRdsPtynPackage param
       
   238         		HWRMFmTxCommand::TRdsPtynPackage pckg;
       
   239 				pckg.Copy(aData);        	
       
   240 				HWRMFmTxCommand::TRdsPtyn prgTypeName = pckg();			
       
   241                 const TInt KMaxRdsPtynLength = 8;
       
   242                 if( prgTypeName.Length() > KMaxRdsPtynLength )
       
   243                     {
       
   244                     // Should not come here because input verified in client end
       
   245                     retVal = KErrArgument;
       
   246                     }
       
   247 				}
       
   248 			else
       
   249 				{
       
   250 				COMPONENT_TRACE((_L("HWRM FmtxPlugin: HW isn't ready, iHwState = %d"), iHwState));
       
   251 				retVal = KErrNotReady;
       
   252 				}        	
       
   253         	}
       
   254         	break;
       
   255         
       
   256         case HWRMFmTxCommand::ESetTxRdsMsCmdId:
       
   257         	{
       
   258         	COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed ESetTxRdsMsCmdId"));
       
   259         	
       
   260 			if ( iHwState == HWRMFmTxCommand::EFmTxHwStateOn )
       
   261 				{
       
   262         		// No params to check
       
   263 				}
       
   264 			else
       
   265 				{
       
   266 				COMPONENT_TRACE((_L("HWRM FmtxPlugin: HW isn't ready, iHwState = %d"), iHwState));
       
   267 				retVal = KErrNotReady;
       
   268 				}         	
       
   269         	}
       
   270         	break;        
       
   271         
       
   272         case HWRMFmTxCommand::ESetTxRdsLangIdCmdId:
       
   273         	{
       
   274         	COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed ESetTxRdsLangIdCmdId"));
       
   275         	        	
       
   276 			if ( iHwState == HWRMFmTxCommand::EFmTxHwStateOn )
       
   277 				{
       
   278         		// Check TRdsLangIdPackage param
       
   279         		HWRMFmTxCommand::TRdsLangIdPackage pckg;
       
   280 				pckg.Copy(aData);        	
       
   281 				TInt languageId = pckg();
       
   282                 const TInt KRdsLanguageFirst = 0x00;
       
   283                 const TInt KRdsLanguageLast = 0x7F;
       
   284 
       
   285                 if( languageId < KRdsLanguageFirst || languageId > KRdsLanguageLast )
       
   286                     {
       
   287                     // Should not come here because input verified in client end
       
   288                     User::Leave(KErrArgument);
       
   289                     }
       
   290 				}
       
   291 			else
       
   292 				{
       
   293 				COMPONENT_TRACE((_L("HWRM FmtxPlugin: HW isn't ready, iHwState = %d"), iHwState));
       
   294 				retVal = KErrNotReady;
       
   295 				}           	
       
   296         	}
       
   297         	break;        
       
   298         
       
   299         case HWRMFmTxCommand::ESetTxRtCmdId:
       
   300         	{
       
   301         	COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed ESetTxRtCmdId"));
       
   302         	        	
       
   303 			if ( iHwState == HWRMFmTxCommand::EFmTxHwStateOn )
       
   304 				{
       
   305         		// Check TRtPackage params
       
   306 	            HWRMFmTxCommand::TRtPackage pckg;
       
   307 	            pckg.Copy(aData);
       
   308                 HWRMFmTxCommand::TRtData rtData = pckg();
       
   309 
       
   310 	            if( rtData.iTag1.iContentType > KMaxLengthMarker || rtData.iTag2.iContentType > KMaxLengthMarker ||
       
   311                     rtData.iTag1.iLengthMarker > KMaxLengthMarker || rtData.iTag2.iLengthMarker > KMaxLengthMarker )
       
   312                     {
       
   313                     retVal = KErrArgument;
       
   314                     }
       
   315 				}
       
   316 			else
       
   317 				{
       
   318 				COMPONENT_TRACE((_L("HWRM FmtxPlugin: HW isn't ready, iHwState = %d"), iHwState));
       
   319 				retVal = KErrNotReady;
       
   320 				}            	
       
   321         	}
       
   322         	break;        
       
   323         
       
   324         case HWRMFmTxCommand::EClearTxRtCmdId:
       
   325         	{
       
   326         	COMPONENT_TRACE(_L("HWRM FmtxPlugin: Processed EClearTxRtCmdId"));
       
   327         	
       
   328 			if ( iHwState != HWRMFmTxCommand::EFmTxHwStateOn )			
       
   329 				{
       
   330 				COMPONENT_TRACE((_L("HWRM FmtxPlugin: HW isn't ready, iHwState = %d"), iHwState));
       
   331 				retVal = KErrNotReady;
       
   332 				}             	        	
       
   333 			// No params to check
       
   334         	}
       
   335         	break;
       
   336 
       
   337 		case HWRMFmTxCommand::ENoCommandId:   // fall through
       
   338         default :
       
   339             {
       
   340             COMPONENT_TRACE((_L("HWRM FmtxPlugin: Unknown Command: 0x%x"), aCommandId));
       
   341             }
       
   342             break;
       
   343         }
       
   344 
       
   345     // Check for concurrent requests. Scan request (ETxScanRequestCmdId) may precede
       
   346     // set frequency (ESetTxFrequencyCmdId), because it is handled as a split command.
       
   347     if ( iLastCommand != HWRMFmTxCommand::ENoCommandId &&
       
   348          !(iLastCommand == HWRMFmTxCommand::ETxScanRequestCmdId && aCommandId == HWRMFmTxCommand::ESetTxFrequencyCmdId) )
       
   349     	{
       
   350 		COMPONENT_TRACE(_L("HWRM FmtxPlugin: Not ready due to concurrent command"));
       
   351     	retVal = KErrNotReady;
       
   352     	}
       
   353 	iLastCommand = static_cast<HWRMFmTxCommand::TFmTxCmd>(aCommandId);
       
   354 
       
   355     TInt timeout(500); // microseconds
       
   356 
       
   357     // Increase timeout for scan requests
       
   358     if (HWRMFmTxCommand::ETxScanRequestCmdId == aCommandId)
       
   359     	{
       
   360     	timeout = 2*1000*1000; // 2 seconds
       
   361     	}
       
   362 
       
   363 #ifdef PUBLISH_STATE_INFO
       
   364     // publish
       
   365     iCmdProperty.Set(aCommandId);
       
   366     iDataProperty.Set(aData);
       
   367 #endif /* PUBLISH_STATE_INFO */
       
   368 
       
   369     // create new timer
       
   370     CPluginTimer* timer = CPluginTimer::NewL(timeout, iResponseCallback, aCommandId, aTransId, retVal, this);
       
   371     CleanupStack::PushL(timer);
       
   372     iTimers.AppendL(timer);
       
   373     CleanupStack::Pop(timer);
       
   374     
       
   375     COMPONENT_TRACE((_L("HWRM FmtxPlugin: Processing command - return")));
       
   376     }
       
   377 
       
   378 
       
   379 void CFmtxPlugin::CancelCommandL(const TUint8 aTransId,
       
   380 #if defined(_DEBUG) && defined(COMPONENT_TRACE_FLAG)
       
   381                                  const TInt aCommandId)
       
   382 #else
       
   383                                  const TInt /*aCommandId*/)
       
   384 #endif
       
   385     {
       
   386     COMPONENT_TRACE((_L("HWRM FmtxPlugin: Cancelling command: 0x%x, TransId: 0x%x"), aCommandId, aTransId));
       
   387     COMPONENT_TRACE((_L("HWRM FmtxPlugin: Cancelling command - iTimers.Count(): %d "), iTimers.Count()));
       
   388 
       
   389     for( TInt i = 0; i < iTimers.Count(); i++ )
       
   390         {
       
   391         if ( iTimers[i]->TransId() == aTransId )
       
   392             {
       
   393             delete iTimers[i];
       
   394             iTimers.Remove(i);
       
   395             COMPONENT_TRACE((_L("HWRM FmtxPlugin: Cancelling command - Removed command: 0x%x, TransId: 0x%x"), aCommandId, aTransId));
       
   396             break;
       
   397             }
       
   398         }
       
   399 
       
   400     if ( iTimers.Count() == 0 )
       
   401     	{
       
   402     	// no more commands on-going
       
   403     	iLastCommand = HWRMFmTxCommand::ENoCommandId;
       
   404     	}
       
   405     }
       
   406 
       
   407 void CFmtxPlugin::GenericTimerFired(MHWRMPluginCallback* aService,
       
   408                                     TInt aCommandId,
       
   409                                     const TUint8 aTransId,
       
   410                                     TInt aRetVal)
       
   411     {
       
   412     COMPONENT_TRACE((_L("HWRM FmtxPlugin: GenericTimerFired (0x%x, 0x%x, %d)"), aCommandId, aTransId, aRetVal));
       
   413 
       
   414     __ASSERT_ALWAYS(aService != NULL, User::Invariant() );
       
   415 
       
   416 	TInt err = KErrNone;
       
   417 	
       
   418 	HWRMFmTxCommand::TFmTxHwState tempState = HWRMFmTxCommand::EFmTxHwStateOff;
       
   419 
       
   420     switch (aCommandId)
       
   421         {
       
   422         case HWRMFmTxCommand::EGetTxFrequencyRangeCmdId:
       
   423         	{
       
   424 			COMPONENT_TRACE((_L("HWRM FmtxPlugin: Returning freq range")));
       
   425 			HWRMFmTxCommand::TFrequencyRangeData freqRange;
       
   426 			freqRange.iErrorCode = KErrNone;
       
   427 			freqRange.iMinFrequency = KFmTxStubPluginFreqMin;
       
   428 			freqRange.iMaxFrequency = KFmTxStubPluginFreqMax;
       
   429 			freqRange.iStepSize = KFmTxStubPluginStepSize;
       
   430     		HWRMFmTxCommand::TFrequencyRangePackage freqRangePckg(freqRange);
       
   431     		TRAP(err, aService->ProcessResponseL(aCommandId, aTransId, freqRangePckg)); 
       
   432         	}
       
   433         	break;
       
   434 
       
   435         case HWRMFmTxCommand::ETxScanRequestCmdId:
       
   436         	{
       
   437 			HWRMFmTxCommand::TScanResponseData scanData;
       
   438 			scanData.iErrorCode = aRetVal;
       
   439 			if ( aRetVal == KErrNone )
       
   440 				{
       
   441 				if ( (iClearFrequency += KFmTxStubPluginStepSize) > KFmTxStubPluginFreqMax )
       
   442 					{
       
   443 					iClearFrequency = KFmTxStubPluginFreqMin;
       
   444 					}
       
   445 				scanData.iErrorCode = KErrNone;
       
   446     			scanData.iFrequenciesFound = iChannelsRequested;
       
   447     			TUint32 clearFrequency = iClearFrequency;
       
   448     			for(TInt i=0; i<iChannelsRequested; i++)
       
   449     			    {
       
   450     			    scanData.iChannels.Copy(&clearFrequency,i+1);
       
   451     				if ( (clearFrequency += KFmTxStubPluginStepSize) > KFmTxStubPluginFreqMax )
       
   452     					{
       
   453     					clearFrequency = KFmTxStubPluginFreqMin;
       
   454     					}
       
   455     			    }
       
   456     			COMPONENT_TRACE((_L("HWRM FmtxPlugin: Returning 1 clear frequency")));
       
   457 				}
       
   458 			else
       
   459 				{
       
   460 				scanData.iFrequenciesFound = 0;
       
   461 				COMPONENT_TRACE((_L("HWRM FmtxPlugin: Returning 0 clear frequencies")));
       
   462 				}			
       
   463     		HWRMFmTxCommand::TScanResponsePackage scanPckg(scanData);
       
   464     		TRAP(err, aService->ProcessResponseL(aCommandId, aTransId, scanPckg)); 
       
   465     		}
       
   466         	break;
       
   467 
       
   468         case HWRMFmTxCommand::ETxOnCmdId:           // fall through
       
   469         case HWRMFmTxCommand::ESetTxFrequencyCmdId: 
       
   470         	tempState = HWRMFmTxCommand::EFmTxHwStateOn; // fall through
       
   471         case HWRMFmTxCommand::ETxOffCmdId:          
       
   472         	{
       
   473         	if ( aRetVal == KErrNone)
       
   474         		{
       
   475         		iHwState = tempState;
       
   476         	
       
   477 				if ( iStatusIndTransId ) // if request successful, and status indication has been requested
       
   478 	        		{	
       
   479     	    		// also send frequency/state changed indications for these
       
   480  					COMPONENT_TRACE((_L("HWRM FmtxPlugin: sending status indication")));
       
   481  					HWRMFmTxCommand::TFmTxStatusData statusData;
       
   482  					statusData.state     = tempState;
       
   483 					statusData.frequency = iFrequency;
       
   484 		    		HWRMFmTxCommand::TStatusIndicationPackage statusIndPckg(statusData);
       
   485 		    		TInt tempTransId = iStatusIndTransId; // status indication may be reissued immediately...
       
   486 	    			iStatusIndTransId = 0;                // ...so null here first
       
   487 					TRAP(err, aService->ProcessResponseL(HWRMFmTxCommand::ETxStatusIndId, tempTransId, statusIndPckg)); 
       
   488 					if ( err != KErrNone )
       
   489 						{
       
   490 						COMPONENT_TRACE((_L("HWRM FmtxPlugin: Error sending status indication")));
       
   491 						}
       
   492 					}
       
   493 				}
       
   494         	} // fall through
       
   495 
       
   496         case HWRMFmTxCommand::ESetTxRdsPsCmdId:
       
   497         case HWRMFmTxCommand::ESetTxRtCmdId:
       
   498         default :
       
   499             {
       
   500             COMPONENT_TRACE((_L("HWRM FmtxPlugin: Returning error code %d, Command: 0x%x"), aRetVal, aCommandId));
       
   501     		HWRMFmTxCommand::TErrorCodeResponsePackage retvalPackage(aRetVal);
       
   502     		TRAP(err, aService->ProcessResponseL(aCommandId, aTransId, retvalPackage));          
       
   503             }
       
   504             break;
       
   505         }
       
   506 
       
   507     if ( err != KErrNone )
       
   508         {
       
   509         COMPONENT_TRACE((_L("HWRM FmtxPlugin: Error in ProcessResponseL: %d"), err));
       
   510         }
       
   511 
       
   512     // delete obsolete timers
       
   513     for( TInt i = (iTimers.Count()-1); i > -1 ; i-- )
       
   514         {
       
   515         if ( !iTimers[i]->IsActive() )
       
   516             {
       
   517             delete iTimers[i];
       
   518             iTimers.Remove(i);
       
   519             COMPONENT_TRACE((_L("HWRM FmtxPlugin: GenericTimerFired - Removed obsolete timer")));
       
   520             }
       
   521         }
       
   522         
       
   523     if ( iTimers.Count() == 0 )
       
   524     	{
       
   525     	// no more commands on-going
       
   526     	iLastCommand = HWRMFmTxCommand::ENoCommandId;
       
   527     	}
       
   528     }