os/boardsupport/haitest/bspsvs/suite/bsp/mmc/src/T_MmcSDPsuDriverData.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 2005-2009 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:
    15 *
    16 */
    17 
    18 #include "T_MmcSDPsuDriverData.h"
    19 
    20 //MMCSD Commands index
    21 /*@{*/
    22 
    23 _LIT(KEnumNull,							" ");
    24 
    25 _LIT(KCmdPsuInfo,						"PsuInfo");
    26 _LIT(KCmdPbusState,						"PbusState");
    27 _LIT(KCmdSetPsuState,					"SetState");
    28 _LIT(KCmdVccState,						"VccState");
    29 _LIT(KCmdPsuVoltage,					"SetVoltage");
    30 _LIT(KCmdPsuNumber,						"PsuNumber");
    31 _LIT(KCmdMediaChangeNumber,				"MediaChangeNumber");
    32 _LIT(KCmdPsuCurLimit,					"PsuCurLimit");
    33 
    34 _LIT(KVoltage,							"expectedvoltage");
    35 _LIT(KCurrent,							"expectedcurrent");
    36 _LIT(KVoltageinterval,					"expectedvoltageinterval");
    37 _LIT(KVoltagecheck,						"expectedvoltagecheck");
    38 _LIT(KInactivityTimeOut,				"expectedpsuinactivitytimeOut");
    39 _LIT(KNotlockedtimeOut,					"expectednotlockedtimeOut");
    40 _LIT(KPbusState,						"expectedpbusstate");
    41 _LIT(KVccState,							"expectedvccstate");
    42 _LIT(KExpectedpsuNumber,				"expectedpsuNumber");
    43 _LIT(KExpectedmediaChangeNumber,		"expectedmediaChangeNumber");
    44 _LIT(KExpectedpsuCurLimit,				"expectedpsuCurLimit");
    45 
    46 _LIT(KPsuState,							"psustate");
    47 _LIT(KPsuVoltage,						"psuVoltage");
    48 /*@}*/
    49 
    50 _LIT(KPsuChkComparator,					"EDPsuChkComparator");
    51 _LIT(KPsuChkADCType,					"EDPsuChkADCType");
    52 _LIT(KPsuChkADCType2,					"EDPsuChkADCType2");
    53 
    54 _LIT(KBusCardAbsent,					"EBusCardAbsent");
    55 _LIT(KBusOff,							"EBusOff");
    56 _LIT(KBusPoweringUp,					"EBusPoweringUp");
    57 _LIT(KBusOn,							"EBusOn");
    58 _LIT(KEBusPsuFault,						"EBusPsuFault");
    59 _LIT(KBusPowerUpPending,				"EBusPowerUpPending");
    60 
    61 _LIT(KPsuOff,							"EDPsuOff");
    62 _LIT(KPsuOnCurLimit,					"EDPsuOnCurLimit");
    63 _LIT(KPsuOnFull,						"EDPsuOnFull");
    64 
    65 const CDataWrapperBase::TEnumEntryTable	CT_MMCSDPsuDriverData::iEnumTableVoltageCheckMethod[] =
    66 	{
    67 //	Enum as a descriptor					Enum
    68 	KPsuChkComparator,						EDPsuChkComparator,
    69 	KPsuChkADCType,							EDPsuChkADCType,
    70 	KPsuChkADCType2,						EDPsuChkADCType2,
    71 	KEnumNull,								-1
    72 	};
    73 
    74 const CDataWrapperBase::TEnumEntryTable	CT_MMCSDPsuDriverData::iEnumTablePbusState[] =
    75 	{
    76 //	Enum as a descriptor					Enum
    77 	KBusCardAbsent,							EBusCardAbsent,
    78 	KBusOff,								EBusOff,
    79 	KBusPoweringUp,							EBusPoweringUp,
    80 	KBusOn,									EBusOn,
    81 	KEBusPsuFault,							EBusPsuFault,
    82 	KBusPowerUpPending,						EBusPowerUpPending,
    83 	KEnumNull,								-1
    84 	};
    85 
    86 const CDataWrapperBase::TEnumEntryTable	CT_MMCSDPsuDriverData::iEnumTableVccState[] =
    87 	{
    88 //	Enum as a descriptor					Enum
    89 	KPsuOff,								EDPsuOff,
    90 	KPsuOnCurLimit,							EDPsuOnCurLimit,
    91 	KPsuOnFull,								EDPsuOnFull,
    92 	KEnumNull,								-1
    93 	};
    94 
    95 //////////////////////////////////////////////////////////////////////
    96 // Construction/Destruction
    97 //////////////////////////////////////////////////////////////////////
    98 
    99 CT_MMCSDPsuDriverData* CT_MMCSDPsuDriverData::NewL()
   100 	{
   101 	CT_MMCSDPsuDriverData*	ret=new (ELeave) CT_MMCSDPsuDriverData();
   102 	CleanupStack::PushL(ret);
   103 	ret->ConstructL();
   104 	CleanupStack::Pop(ret);
   105 	return ret;
   106 	}
   107 
   108 
   109 CT_MMCSDPsuDriverData::CT_MMCSDPsuDriverData()
   110 :	CT_MmcSDDriverData()
   111 ,	iAsyncErrorIndex(0)
   112 	{
   113 	}
   114 
   115 void CT_MMCSDPsuDriverData::ConstructL()
   116 /**
   117  * Second phase construction
   118  *
   119  * @internalComponent
   120  *
   121  * @return	N/A
   122  *
   123  * @pre		None
   124  * @post	None
   125  *
   126  * @leave	system wide error
   127  */
   128 	{
   129 	CT_MmcSDDriverData::ConstructL();
   130 	}
   131 
   132 CT_MMCSDPsuDriverData::~CT_MMCSDPsuDriverData()
   133 /**
   134  * Public destructor
   135  */
   136 	{
   137 	}
   138 
   139 TBool CT_MMCSDPsuDriverData::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
   140 /**
   141  * Process a command read from the ini file
   142  *
   143  * @param aCommand			The command to process
   144  * @param aSection			The section in the ini containing data for the command
   145  * @param aAsyncErrorIndex	Command index for async calls to return errors to
   146  *
   147  * @return					ETrue if the command is processed
   148  *
   149  * @leave					System wide error
   150  */
   151 	{
   152 	TBool	ret=ETrue;
   153 
   154 	if ( aCommand==KCmdPsuInfo )
   155 		{
   156 		DoCmdPsuInfo(aSection);
   157 		}
   158 	else if ( aCommand==KCmdPsuVoltage )
   159 		{
   160 		DoCmdSetPsuVoltage(aSection);
   161 		}
   162 	else if ( aCommand==KCmdPsuNumber )
   163 		{
   164 		DoCmdPsuNumber(aSection);
   165 		}
   166 	else if ( aCommand==KCmdMediaChangeNumber )
   167 		{
   168 		DoCmdMediaChangeID(aSection);
   169 		}
   170 	else if ( aCommand==KCmdPsuCurLimit )
   171 		{
   172 		DoCmdPsuCurLimit(aSection);
   173 		}
   174 	else if ( aCommand==KCmdPbusState)
   175 		{
   176 		DoCmdPbusState(aSection);
   177 		}
   178 	else if ( aCommand==KCmdSetPsuState)
   179 		{
   180 		DoCmdSetPsuState(aSection);
   181 		}
   182 	else if ( aCommand==KCmdVccState)
   183 		{
   184 		DoCmdVccState(aSection);
   185 		}
   186 	else
   187 		{
   188 		ret=CT_MmcSDDriverData::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
   189 		}
   190 	return ret;
   191 	}
   192 
   193 /**
   194  * Psu information
   195  *
   196  * @param aSection			The section in the ini containing data for the command
   197  *
   198  * @return					void
   199  *
   200  * @leave					System wide error
   201  */
   202 void CT_MMCSDPsuDriverData::DoCmdPsuInfo(const TDesC& aSection)
   203 	{
   204  	TInt err;
   205  	TPBusPsuInf psuInfo;
   206 	err = iMmcSDController->PsuInfo(psuInfo);
   207 		if ( err!=KErrNone )
   208 			{
   209 			ERR_PRINTF2(_L("Getting PsuInfo Error %d"), err);
   210 			SetError(err);
   211 			}
   212 		else
   213 			{
   214 			//Inactivity Timeout
   215 			INFO_PRINTF2(_L("PSU: Bus Inactivity timeout Period    = %d \n"),psuInfo.iInactivityTimeOut);
   216 			TInt	expectedInactivityTimeOut;
   217 			if(GetIntFromConfig(aSection, KInactivityTimeOut(), expectedInactivityTimeOut))
   218 				{
   219 				if(psuInfo.iInactivityTimeOut != expectedInactivityTimeOut)
   220 					{
   221 					SetBlockResult(EFail);
   222 					ERR_PRINTF3(_L("psuInfo.iInactivityTimeOut(%d) != expectedInactivityTimeOut(%d)"), psuInfo.iInactivityTimeOut, expectedInactivityTimeOut);
   223 					}
   224 				if(psuInfo.iInactivityTimeOut<=0 || psuInfo.iInactivityTimeOut>10)
   225 					{
   226 					ERR_PRINTF1(_L("MMC/SD: Error : Inactivity timeout is not programmed correctly. \n"));
   227 					ERR_PRINTF1(_L("MMC/SD: Inactivity time out depends on platform. Possible value can be (1/3/5/10) seconds \n"));
   228 					SetBlockResult(EFail);
   229 					}
   230 				}
   231 			else
   232 				{
   233 				SetBlockResult(EFail);
   234 				WARN_PRINTF1(_L("Inactivity timeout Value Missing From INI File"));
   235 				}
   236 			//NotLocked Timeout
   237 			INFO_PRINTF2(_L("PSU: Bus Not Locked Timeout Period = %d \n"),psuInfo.iNotLockedTimeOut);
   238 			TInt	expectedNotlockedtimeOut;
   239 			if(GetIntFromConfig(aSection, KNotlockedtimeOut(), expectedNotlockedtimeOut))
   240 				{
   241 				if(psuInfo.iNotLockedTimeOut != expectedNotlockedtimeOut)
   242 					{
   243 					SetBlockResult(EFail);
   244 					ERR_PRINTF3(_L("psuInfo.iNotLockedTimeOut(%d) != expectedNotlockedtimeOut(%d)"), psuInfo.iNotLockedTimeOut, expectedNotlockedtimeOut);
   245 					}
   246 				}
   247 			else
   248 				{
   249 				SetBlockResult(EFail);
   250 				WARN_PRINTF1(_L("NotlockedtimeOut Value Missing From INI File"));
   251 				}
   252 			//MaxCurrentInMicroAmps
   253 			INFO_PRINTF2(_L("PSU: MaxCurrentInMicroAmps     = %d \n"),psuInfo.iMaxCurrentInMicroAmps);
   254 			TInt	expectedMaxCurrentInMicroAmps;
   255 			if(GetIntFromConfig(aSection, KCurrent(), expectedMaxCurrentInMicroAmps))
   256 				{
   257 				if(psuInfo.iMaxCurrentInMicroAmps != expectedMaxCurrentInMicroAmps)
   258 					{
   259 					SetBlockResult(EFail);
   260 					ERR_PRINTF3(_L("psuInfo.iMaxCurrentInMicroAmps(%d) != expectedMaxCurrentInMicroAmps(%d)"), psuInfo.iMaxCurrentInMicroAmps, expectedMaxCurrentInMicroAmps);
   261 					}
   262 			 	}
   263 			else
   264 				{
   265 				SetBlockResult(EFail);
   266 				WARN_PRINTF1(_L("MaxCurrentInMicroAmps Value Missing From INI File"));
   267 				}
   268 			//Volatge Supported
   269 			INFO_PRINTF2(_L("PSU: Volatge Supported(OCR Register Format)     = 0x%08x(OCR Format) \n"),psuInfo.iVoltageSupported);
   270 			TUint	expectedVoltageSupported;
   271 			if(GetUintFromConfig(aSection, KVoltage(), expectedVoltageSupported))
   272 				{
   273 				 if(psuInfo.iVoltageSupported != expectedVoltageSupported)
   274 					{
   275 					SetBlockResult(EFail);
   276 					ERR_PRINTF3(_L("psuInfo.iVoltageSupported(0x%08x) != expectedVoltageSupported(0x%08x)"), psuInfo.iVoltageSupported, expectedVoltageSupported);
   277 					}
   278 				//Bit MASK (Refer OCR register format)
   279 				if(psuInfo.iVoltageSupported ==0)
   280 					{
   281 					ERR_PRINTF1(_L("MMC/SD: iVoltageSupported should not be zero \n"));
   282 					ERR_PRINTF1(_L("MMC/SD: iVoltageSupported depends on platform. Possible values(3.0/3.3) volts in OCR register format\n"));
   283 					SetBlockResult(EFail);
   284 					}
   285 			 	}
   286 			else
   287 				{
   288 				SetBlockResult(EFail);
   289 				WARN_PRINTF1(_L("VoltageSupported Value Missing From INI File"));
   290 				}
   291 			//Voltage Interval
   292 			INFO_PRINTF2(_L("PSU: Voltage Interval      = %x \n"),psuInfo.iVoltCheckInterval);
   293 			TUint	expectedVoltCheckInterval;
   294 			if(GetUintFromConfig(aSection, KVoltageinterval(), expectedVoltCheckInterval))
   295 				{
   296 				 if(psuInfo.iVoltCheckInterval != expectedVoltCheckInterval)
   297 					{
   298 					SetBlockResult(EFail);
   299 					ERR_PRINTF3(_L("psuInfo.iVoltCheckInterval(%d) != expectedVoltCheckInterval(%d)"), psuInfo.iVoltCheckInterval, expectedVoltCheckInterval);
   300 					}
   301 			 	}
   302 			else
   303 				{
   304 				SetBlockResult(EFail);
   305 				WARN_PRINTF1(_L("VoltCheckInterval Value Missing From INI File"));
   306 				}
   307 			//VoltCheckMethod
   308 			switch(psuInfo.iVoltCheckMethod)
   309 				{
   310 				case EDPsuChkComparator:
   311 					{
   312 					INFO_PRINTF1(_L("PSU VoltCheck Method  is  Comparator"));
   313 					break;
   314 					}
   315 				case EDPsuChkADCType:
   316 					{
   317 					INFO_PRINTF1(_L("PSU VoltCheck Method  is  ADCType"));
   318 					break;
   319 					}
   320 				case EDPsuChkADCType2:
   321 					{
   322 					INFO_PRINTF1(_L("PSU VoltCheck Method  is  ADCType2"));
   323 					break;
   324 					}
   325 			default:
   326 					ERR_PRINTF2(_L("PSU VoltCheck Method  is  Not Supported=%d"),psuInfo.iVoltCheckMethod);
   327 				}
   328 			TInt	expectedVoltCheckMethod;
   329 			if ( GetEnumFromConfig(aSection, KVoltagecheck(), iEnumTableVoltageCheckMethod, expectedVoltCheckMethod) )
   330 				{
   331 				 if(psuInfo.iVoltCheckMethod != (TUint)expectedVoltCheckMethod)
   332 					{
   333 					SetBlockResult(EFail);
   334 					ERR_PRINTF3(_L("psuInfo.iVoltCheckMethod(%d) != expectedVoltCheckMethod(%d)"), psuInfo.iVoltCheckMethod, expectedVoltCheckMethod);
   335 					}
   336 				}
   337 			else
   338 				{
   339 				SetBlockResult(EFail);
   340 				WARN_PRINTF1(_L("expectedVoltCheckMethod Value Missing From INI File"));
   341 				}
   342 
   343 			}
   344 	}
   345 
   346 /**
   347  * TPBusState Information
   348  *
   349  * @param aSection			The section in the ini containing data for the command
   350  *
   351  * @return					void
   352  *
   353  * @leave					System wide error
   354  */
   355 void CT_MMCSDPsuDriverData::DoCmdPbusState(const TDesC& aSection)
   356 	{
   357 	TInt err;
   358 	TInt pbusState;
   359 	err= iMmcSDController->PbusState(pbusState);
   360 		if(err != KErrNone)
   361 			{
   362 			ERR_PRINTF2(_L("MMC/SD : Error in getting PbusState information, error code = %d \n"),err);
   363 			SetError(err);
   364 			}
   365 		else
   366 			{
   367 			switch(pbusState)
   368 				{
   369 				case EBusCardAbsent:
   370 					{
   371 					WARN_PRINTF1(_L("Card is absent in the slot"));
   372 					break;
   373 					}
   374 				case EBusOff:
   375 					{
   376 					INFO_PRINTF1(_L("Bus State is OFF"));
   377 					break;
   378 					}
   379 				case EBusPoweringUp:
   380 					{
   381 					INFO_PRINTF1(_L("Bus State is Powerwing Up"));
   382 					break;
   383 					}
   384 				case EBusOn:
   385 					{
   386 					INFO_PRINTF1(_L("Bus State is Power ON"));
   387 					break;
   388 					}
   389 				case EBusPsuFault:
   390 					{
   391 					WARN_PRINTF1(_L("Bus State is BusPsuFault"));
   392 					break;
   393 					}
   394 				case EBusPowerUpPending:
   395 					{
   396 					INFO_PRINTF1(_L("Bus State is BusPowerUpPending"));
   397 					break;
   398 					}
   399 			default:
   400 					ERR_PRINTF2(_L("Bus State Not Supported = %d"),pbusState);
   401 				}
   402 			TInt	expectedPbusState;
   403 			if ( GetEnumFromConfig(aSection, KPbusState(), iEnumTablePbusState, expectedPbusState) )
   404 				{
   405 				if(pbusState != expectedPbusState)
   406 					{
   407 					ERR_PRINTF3(_L("pbusState(%d) != expectedPbusState(%d)"), pbusState, expectedPbusState);
   408 					SetBlockResult(EFail);
   409 					}
   410 				}
   411 			else
   412 				{
   413 				SetBlockResult(EFail);
   414 				WARN_PRINTF1(_L("expectedPbusState Value Missing From INI File"));
   415 				}
   416 			}
   417 
   418 	}
   419 
   420 /**
   421  * Set Power Supply State
   422  *
   423  * @param aSection			The section in the ini containing data for the command
   424  *
   425  * @return					void
   426  *
   427  * @leave					System wide error
   428  */
   429 void CT_MMCSDPsuDriverData::DoCmdSetPsuState(const TDesC& aSection)
   430 	{
   431 	TInt err;
   432 	TInt psuState;
   433 	GetIntFromConfig(aSection, KPsuState(), psuState);
   434 	err=iMmcSDController->SetPsuState(psuState);
   435 	if(err != KErrNone)
   436 		{
   437 		ERR_PRINTF2(_L("MMCSD : Error in Setting PowerSupply State, error code = %d \n"),err);
   438 		SetError(err);
   439 		}
   440 	}
   441 
   442 /**
   443  * PSU VCC State Information
   444  *
   445  * @param aSection			The section in the ini containing data for the command
   446  *
   447  * @return					void
   448  *
   449  * @leave					System wide error
   450  */
   451 void CT_MMCSDPsuDriverData::DoCmdVccState(const TDesC& aSection)
   452 	{
   453 	TInt err;
   454 	TInt vccState;
   455 	err= iMmcSDController->VccState(vccState);
   456 	if(err != KErrNone)
   457 			{
   458 			ERR_PRINTF2(_L("MMC/SD : Error in getting VccState information, error code = %d \n"),err);
   459 			SetBlockResult(EFail);
   460 			}
   461 		else
   462 			{
   463 			switch(vccState)
   464 				{
   465 				case EDPsuOff:
   466 					{
   467 					INFO_PRINTF1(_L("PSU VCC State  is PsuOff "));
   468 					break;
   469 					}
   470 				case EDPsuOnCurLimit:
   471 					{
   472 					INFO_PRINTF1(_L("PSU VCC State  is PsuOnCurLimit "));
   473 					break;
   474 					}
   475 				case EDPsuOnFull:
   476 					{
   477 					INFO_PRINTF1(_L("PSU VCC State  is PsuOnFull "));
   478 					break;
   479 					}
   480 			default:
   481 					ERR_PRINTF2(_L("PSU VCC State Not Supported = %d"),vccState);
   482 				}
   483 			TInt	expectedvccState;
   484 			if ( GetEnumFromConfig(aSection, KVccState(), iEnumTableVccState, expectedvccState) )
   485 				{
   486 				if(vccState != expectedvccState)
   487 					{
   488 					ERR_PRINTF3(_L("vccState(%d) != expectedvccState(%d)"), vccState, expectedvccState);
   489 					SetBlockResult(EFail);
   490 					}
   491 				}
   492 			else
   493 				{
   494 				SetBlockResult(EFail);
   495 				WARN_PRINTF1(_L("expectedvccState Value Missing From INI File"));
   496 				}
   497 			}
   498 	}
   499 /**
   500  *Set Psu Voltage in OCR Format
   501  *
   502  * @param aSection			The section in the ini containing data for the command
   503  *
   504  * @return					void
   505  *
   506  * @leave					System wide error
   507  */
   508 void CT_MMCSDPsuDriverData::DoCmdSetPsuVoltage(const TDesC& aSection)
   509 	{
   510 	TInt err;
   511 	TUint psuVoltage; //OCR Register Format
   512 	GetUintFromConfig(aSection, KPsuVoltage(), psuVoltage);
   513 	err=iMmcSDController->SetPsuVoltage(psuVoltage);
   514 	if(err != KErrNone)
   515 		{
   516 		ERR_PRINTF2(_L("MMCSD : Error in Setting Psu Voltage, error code = %d \n"),err);
   517 		SetError(err);
   518 		}
   519 	}
   520 
   521 /**
   522  *Reads the MMCSD power supply unit number
   523  *
   524  * @param aSection			The section in the ini containing data for the command
   525  *
   526  * @return					void
   527  *
   528  * @leave					System wide error
   529  */
   530 void CT_MMCSDPsuDriverData::DoCmdPsuNumber(const TDesC& aSection)
   531 	{
   532 	TInt err;
   533 	TInt psuNumber;
   534 	err=iMmcSDController->PsuNumber(psuNumber);
   535 	if(err != KErrNone)
   536 		{
   537 		ERR_PRINTF2(_L("MMCSD : Error in reading PSU Number from the platform, error code = %d \n"),err);
   538 		SetError(err);
   539 		}
   540 	else
   541 		{
   542 		INFO_PRINTF2(_L("MMCSD Psu Number on platform   = %d \n"),psuNumber);
   543 		TInt	expectedpsuNumber;
   544 		if(GetIntFromConfig(aSection, KExpectedpsuNumber(), expectedpsuNumber))
   545 			{
   546 			if(psuNumber != expectedpsuNumber)
   547 				{
   548 				ERR_PRINTF3(_L("psuNumber(%d) != expectedpsuNumber(%d)"), psuNumber, expectedpsuNumber);
   549 				SetBlockResult(EFail);
   550 				}
   551 			}
   552 		else
   553 			{
   554 			SetBlockResult(EFail);
   555 			WARN_PRINTF1(_L("expectedpsuNumber Value Missing From INI File"));
   556 			}
   557 		}
   558 	}
   559 
   560 /**
   561  *Reads the MMCSD Media Change ID
   562  *
   563  * @param aSection			The section in the ini containing data for the command
   564  *
   565  * @return					void
   566  *
   567  * @leave					System wide error
   568  */
   569 void CT_MMCSDPsuDriverData::DoCmdMediaChangeID(const TDesC& aSection)
   570 	{
   571 	TInt err;
   572 	TInt mediaChangeNumber;
   573 	err=iMmcSDController->MediaChangeID(mediaChangeNumber);
   574 	if(err != KErrNone)
   575 		{
   576 		ERR_PRINTF2(_L("MMCSD : Error in reading MeadiaChangeID from the platform, error code = %d \n"),err);
   577 		SetError(err);
   578 		}
   579 	else
   580 		{
   581 		INFO_PRINTF2(_L("MMCSD MeadiaChangeID on platform   = %d \n"),mediaChangeNumber);
   582 		TInt	expectedmediaChangeNumber;
   583 		if(GetIntFromConfig(aSection, KExpectedmediaChangeNumber(), expectedmediaChangeNumber))
   584 			{
   585 			if(mediaChangeNumber != expectedmediaChangeNumber)
   586 				{
   587 				ERR_PRINTF3(_L("mediaChangeNumber(%d) != expectedmediaChangeNumber(%d)"), mediaChangeNumber, expectedmediaChangeNumber);
   588 				SetBlockResult(EFail);
   589 				};
   590 			}
   591 		else
   592 			{
   593 			SetBlockResult(EFail);
   594 			WARN_PRINTF1(_L("expectedmediaChangeNumber Value Missing From INI File"));
   595 			}
   596 		}
   597 
   598 	}
   599 
   600 /**
   601  *Reads PSU current is limited to a safe level or Not
   602  *
   603  * @param aSection			The section in the ini containing data for the command
   604  *
   605  * @return					void
   606  *
   607  * @leave					System wide error
   608  */
   609 void CT_MMCSDPsuDriverData::DoCmdPsuCurLimit(const TDesC& aSection)
   610 	{
   611 	TInt err;
   612 	TBool psuCurLimit;
   613 	err=iMmcSDController->PsuCurLimit(psuCurLimit);
   614 	if(err != KErrNone)
   615 		{
   616 		ERR_PRINTF2(_L("MMCSD : Error in reading PsuCurLimit from the platform, error code = %d \n"),err);
   617 		SetError(err);
   618 		}
   619 	else
   620 		{
   621 		INFO_PRINTF2(_L("MMCSD PsuCurLimit on platform   = %d \n"),psuCurLimit);
   622 		TInt	expectedpsuCurLimit;
   623 		if(GetIntFromConfig(aSection, KExpectedpsuCurLimit(), expectedpsuCurLimit))
   624 			{
   625 			if(psuCurLimit != expectedpsuCurLimit)
   626 				{
   627 				ERR_PRINTF3(_L("psuCurLimit(%d) != expectedpsuCurLimit(%d)"), psuCurLimit, expectedpsuCurLimit);
   628 				SetBlockResult(EFail);
   629 				}
   630 			}
   631 		else
   632 			{
   633 			SetBlockResult(EFail);
   634 			WARN_PRINTF1(_L("expectedpsuCurLimit Value Missing From INI File"));
   635 			}
   636 		}
   637 	}