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; }
int main() { std::auto_ptr<MyClass> myPtr(new MyClass); }