[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v1 15/15] android-console: Add power capacity co
From: |
Alex Bennée |
Subject: |
Re: [Qemu-devel] [PATCH v1 15/15] android-console: Add power capacity command |
Date: |
Thu, 13 Nov 2014 10:17:48 +0000 |
Greg Bellows <address@hidden> writes:
> Add the Android emulator console "power capacity" command along associated
> help
> messages. The "capacity" command allows the battery capacity of the device to
> be manipulated.
>
> Signed-off-by: Greg Bellows <address@hidden>
> ---
> android-commands.h | 7 +++++++
> android-console.c | 26 ++++++++++++++++++++++++++
> android-console.h | 1 +
> 3 files changed, 34 insertions(+)
>
<snip>
>
> +void android_console_power_capacity(Monitor *mon, const QDict *qdict)
> +{
> + const char *arg = qdict_get_try_str(qdict, "arg");
> +
> + if (arg) {
> + int capacity;
> +
> + if (sscanf(arg, "%d", &capacity) == 1 &&
> + capacity >= 0 && capacity <= 100) {
> + goldfish_battery_set_prop(0, POWER_SUPPLY_PROP_CAPACITY,
> capacity);
> + return;
> + }
Has the formatting of const/if (arg) gone off there?
--
Alex Bennée
- Re: [Qemu-devel] [PATCH v1 06/15] android-console: Add missing hw_has_battery prop, (continued)
- [Qemu-devel] [PATCH v1 08/15] android-console: Add header for battery externs, Greg Bellows, 2014/11/11
- [Qemu-devel] [PATCH v1 07/15] android-console: Init the battery ID state field, Greg Bellows, 2014/11/11
- [Qemu-devel] [PATCH v1 10/15] android-console: Add GF battery property getter, Greg Bellows, 2014/11/11
- [Qemu-devel] [PATCH v1 12/15] android-console: Add power status command, Greg Bellows, 2014/11/11
- [Qemu-devel] [PATCH v1 11/15] android-console: Add power ac command, Greg Bellows, 2014/11/11
- [Qemu-devel] [PATCH v1 13/15] android-console: Add power present command, Greg Bellows, 2014/11/11
- [Qemu-devel] [PATCH v1 14/15] android-console: Add power health command, Greg Bellows, 2014/11/11
- [Qemu-devel] [PATCH v1 15/15] android-console: Add power capacity command, Greg Bellows, 2014/11/11
- Re: [Qemu-devel] [PATCH v1 15/15] android-console: Add power capacity command,
Alex Bennée <=
- Re: [Qemu-devel] [PATCH v1 00/15] android-console: Add console power command, Greg Bellows, 2014/11/12