Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / cros_system_api / dbus / power_manager / power_supply_properties.proto
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.
4
5 syntax = "proto2";
6
7 option optimize_for = LITE_RUNTIME;
8
9 package power_manager;
10
11 // Power supply status sent from powerd to Chrome.
12 message PowerSupplyProperties {
13   enum ExternalPower {
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.
18     AC = 0;
19
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.
23     USB = 1;
24
25     // An original spring AC charger (as identified by an ID sampled by the EC)
26     // is connected.
27     ORIGINAL_SPRING_CHARGER = 3;
28
29     // No external power source is connected.
30     DISCONNECTED = 2;
31
32     // Next value to use: 4
33   }
34
35   enum BatteryState {
36     // The battery is full or close to full.
37     FULL = 0;
38
39     // The battery is being charged but is not yet full.
40     CHARGING = 1;
41
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
47     // defect.
48     DISCHARGING = 2;
49
50     // The system doesn't have a battery.
51     NOT_PRESENT = 3;
52
53     // Next value to use: 4
54   }
55
56   // Details about a potential source of power to the system.
57   message PowerSource {
58     // Opaque ID corresponding to the device; see |external_power_source_id|.
59     optional string id = 1;
60
61     // User-friendly name describing the device.
62     optional string name = 2;
63
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;
69
70     // Next ID to use: 4
71   }
72
73   // Current state of the external power source.
74   optional ExternalPower external_power = 14;
75
76   // ID of the PowerSource that is currently providing power to the system.
77   optional string external_power_source_id = 17;
78
79   // Currently-connected external power sources.
80   repeated PowerSource available_external_power_source = 18;
81
82   // Current state of the battery.
83   optional BatteryState battery_state = 15;
84
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;
88
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;
93
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;
98
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];
102
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;
106
107   // Next ID to use: 19
108 }