Bug 28286 - Add iDevice battery status
Summary: Add iDevice battery status
Status: RESOLVED FIXED
Alias: None
Product: upower
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Richard Hughes
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-27 16:17 UTC by Bastien Nocera
Modified: 2010-05-28 07:00 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
patch for that (13.16 KB, patch)
2010-05-27 18:00 UTC, Bastien Nocera
Details | Splinter Review
with fixed configure checks (13.16 KB, patch)
2010-05-27 18:27 UTC, Bastien Nocera
Details | Splinter Review
and updated (and untested) (13.16 KB, patch)
2010-05-28 04:59 UTC, Bastien Nocera
Details | Splinter Review
and the right patch (14.26 KB, patch)
2010-05-28 05:11 UTC, Bastien Nocera
Details | Splinter Review

Description Bastien Nocera 2010-05-27 16:17:11 UTC
iDevices export their battery information. This isn't supported at the system level (kernel), so would require some custom code.

- udev will show devices appearing and disappearing
- for each device, we'll check the battery using:
$ ideviceinfo -q com.apple.mobile.battery
BatteryCurrentCapacity: 100
BatteryIsCharging: false

every:
$ ideviceinfo -q com.apple.mobile.iTunes  | grep -i battery
BatteryPollInterval: 60
seconds

Ideas on where to integrate this exactly?
Comment 1 Bastien Nocera 2010-05-27 18:00:25 UTC
Created attachment 35895 [details] [review]
patch for that

Untested, but compiles :)

Help appreciated for the FIXME, and the accuracy of the object properties used.
Comment 2 Bastien Nocera 2010-05-27 18:27:27 UTC
Created attachment 35896 [details] [review]
with fixed configure checks

Except that it doesn't work as expected because I get loads of those:
usbmuxd_send: Error -1 when sending: Broken pipe
on the command-line.

I think that the connection to usbmuxd must be getting broken, maybe we need to reconnect for every poll.

And gnome-power-manager doesn't show it either.
Comment 3 Richard Hughes 2010-05-27 23:20:37 UTC
Patch looks good on quick review. I don't think it's showing in g-p-m as you're not setting the "type", e.g. UP_DEVICE_KIND_UPS and it defaults to UP_DEVICE_KIND_UNKNOWN which g-p-m doesn't have rendering information about.
Comment 4 Bastien Nocera 2010-05-28 04:59:55 UTC
Created attachment 35905 [details] [review]
and updated (and untested)
Comment 5 Bastien Nocera 2010-05-28 05:11:14 UTC
Created attachment 35907 [details] [review]
and the right patch
Comment 6 Bastien Nocera 2010-05-28 07:00:15 UTC
And after 3 patches commited, we managed to make it work :)

Requires gnome-power-manager from master to show anything though.

Thanks Richard for the quick review(s)!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.