1 // Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 option optimize_for = LITE_RUNTIME;
11 // Power supply status sent from powerd to Chrome.
12 message PowerSupplyProperties {
14 // AC/line/mains power is connected. This is generally the
15 // highest-power source that can be attached to the system, but the
16 // system may be drawing power at a high enough rate that the battery
17 // is discharging rather than charging; see BatteryState.
20 // A USB power source (SDP, DCP, CDP, or ACA) is connected. The battery
21 // may be charging or discharging depending on the instantaneous power
22 // consumption and the negotiated current; see BatteryState.
25 // An original spring AC charger (as identified by an ID sampled by the EC)
27 ORIGINAL_SPRING_CHARGER = 3;
29 // No external power source is connected.
32 // Next value to use: 4
36 // The battery is full or close to full.
39 // The battery is being charged but is not yet full.
42 // The battery is discharging. Note that an external power source may
43 // be connected but not supplying enough power to offset the system's
44 // instantaneous power consumption; see ExternalPower. This state is
45 // also used if the battery is neither charging nor discharging (i.e.
46 // current is zero) in a non-full state, which may indicate a battery
50 // The system doesn't have a battery.
53 // Next value to use: 4
56 // Details about a potential source of power to the system.
58 // Opaque ID corresponding to the device; see |external_power_source_id|.
59 optional string id = 1;
61 // User-friendly name describing the device.
62 optional string name = 2;
64 // True if the power source will automatically deliver charge to the system
65 // when connected (assuming there isn't another |active_by_default| source
66 // doing so). If false, the source will not deliver charge unless requested
67 // to do so by the user.
68 optional bool active_by_default = 3;
73 // Current state of the external power source.
74 optional ExternalPower external_power = 14;
76 // ID of the PowerSource that is currently providing power to the system.
77 optional string external_power_source_id = 17;
79 // Currently-connected external power sources.
80 repeated PowerSource available_external_power_source = 18;
82 // Current state of the battery.
83 optional BatteryState battery_state = 15;
85 // Estimated battery charge as a percent of its total capacity, in the
86 // range [0.0, 100.0].
87 optional double battery_percent = 7;
89 // Estimated time until the battery is empty, in seconds, or zero if the
90 // battery isn't discharging. -1 if the estimated time would be huge
91 // (e.g. because the current is zero or close to zero).
92 optional int64 battery_time_to_empty_sec = 5;
94 // Estimated time until the battery is full, in seconds, or zero if the
95 // battery isn't charging. -1 if the estimated time would be huge (e.g.
96 // because the current is zero or close to zero).
97 optional int64 battery_time_to_full_sec = 6;
99 // True when |battery_time_to_*| can't be trusted, e.g. because the power
100 // source just changed.
101 optional bool is_calculating_battery_time = 12 [default = false];
103 // The battery discharge rate measured in W. Positive if the battery is
104 // being discharged and negative if it's being charged.
105 optional double battery_discharge_rate = 16;
107 // Next ID to use: 19