qemu-devel
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]