usbmgmt/usbmgrtest/t_charging_emu/src/tbatterycharging.cpp
changeset 25 4ddb65515edd
parent 0 c9bc50fca66e
child 26 f3a1ae528dee
equal deleted inserted replaced
14:4285b54b0d2c 25:4ddb65515edd
   127 		}
   127 		}
   128 
   128 
   129 	iPlugin = iExtensionPlugins[0];
   129 	iPlugin = iExtensionPlugins[0];
   130 
   130 
   131 	iDummyLdd.Initialise();
   131 	iDummyLdd.Initialise();
   132 	//iRepository = CRepository::NewL(KUsbBatteryChargingCentralRepositoryUid);
       
   133 	User::LeaveIfError(iTimer.CreateLocal());
   132 	User::LeaveIfError(iTimer.CreateLocal());
   134 	
   133 	
   135 	DefinePropertyL(KBattChargWriteRepositoryUid, KBattChargWriteRepositoryKey,RProperty::EInt);
   134 	DefinePropertyL(KBattChargWriteRepositoryUid, KBattChargWriteRepositoryKey,RProperty::EInt);
   136 	DefinePropertyL(KBattChargReadPropertyCurrentUid,KBattChargReadCurrentChargingKey,RProperty::EInt);
   135 	DefinePropertyL(KBattChargReadPropertyCurrentUid,KBattChargReadCurrentChargingKey,RProperty::EInt);
   137 	
   136 	
   344 	CleanupStack::PopAndDestroy(); // fs
   343 	CleanupStack::PopAndDestroy(); // fs
   345 	}
   344 	}
   346 
   345 
   347 TInt CDummyUsbDevice::GetNextLine()
   346 TInt CDummyUsbDevice::GetNextLine()
   348 	{
   347 	{
   349 	TInt newLineOffset = (iPtr.Mid(iFileOffset)).Locate(13);//Find(_L("\r\n"));
   348 	TInt newLineOffset = (iPtr.Mid(iFileOffset)).Locate(13);
   350 	if (newLineOffset < 0)
   349 	if (newLineOffset < 0)
   351 		{
   350 		{
   352 		return newLineOffset;
   351 		return newLineOffset;
   353 		}
   352 		}
   354 	if (newLineOffset == 0)
   353 	if (newLineOffset == 0)
   425 			break;
   424 			break;
   426 		case EUsbChargingTestCommandUserSetting:
   425 		case EUsbChargingTestCommandUserSetting:
   427 			{
   426 			{
   428 			TInt err = WriteToRepositoryProperty(iCommandValue);
   427 			TInt err = WriteToRepositoryProperty(iCommandValue);
   429 			
   428 			
   430 			//TInt err = iRepository->Set(KUsbBatteryChargingKeyEnabledUserSetting, iCommandValue);
       
   431 			iTest(err == KErrNone);
   429 			iTest(err == KErrNone);
   432 			}
   430 			}
   433 			break;
   431 			break;
   434 		default:
   432 		default:
   435 			User::Panic(KUsbChargingTestPanic, EUsbChargingTestPanicBadCommand);
   433 			User::Panic(KUsbChargingTestPanic, EUsbChargingTestPanicBadCommand);
   481 		case EUsbChargingTestCheckCharging:
   479 		case EUsbChargingTestCheckCharging:
   482 			{
   480 			{
   483 			TInt current;			
   481 			TInt current;			
   484 			TInt err = GetChargingCurrentFromProperty(current);
   482 			TInt err = GetChargingCurrentFromProperty(current);
   485 			
   483 			
   486 			//TInt err = RProperty::Get(KPropertyUidUsbBatteryChargingCategory,
       
   487 			//	KPropertyUidUsbBatteryChargingChargingCurrent, current);
       
   488 			iTest(err == KErrNone);
   484 			iTest(err == KErrNone);
   489 			iTest(current == iCheckValue);
   485 			iTest(current == iCheckValue);
   490 			}
   486 			}
   491 			break;
   487 			break;
   492 		default:
   488 		default: