TInt CDummyUsbDevice::GetChargingCurrentFromProperty(TInt &aCurrent)
	{
	
	TRequestStatus stat;
	iPropertyReadChargingCurrentAck.Subscribe(stat);
	
	TInt err = iProperty.Set(TUid::Uid(KBattChargReadPropertyCurrentUid),
								KBattChargReadCurrentChargingKey,
								1);
	ASSERT(!err);	
	User::WaitForRequest(stat);
	
	TBufC8<50> value;
	TPtr8 myPtr(value.Des());
	TInt error = iPropertyReadChargingCurrentAck.Get(myPtr);
	ASSERT(!error);
	
	TDataFromPropBattChargToTBatteryCharging received;
	TPckg<TDataFromPropBattChargToTBatteryCharging>tmp(received);
	tmp.Copy(value);
	aCurrent = received.iCurrent;
	return received.iError;
	
	}
Example #2
0
File: main.cpp Project: CCJY/coliru
int main() {

std::auto_ptr<MyClass> myPtr(new MyClass);

}