| // Copyright (c) 2013 The Chromium OS Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| syntax = "proto2"; |
| |
| option optimize_for = LITE_RUNTIME; |
| |
| package power_manager; |
| option go_package = "power_manager_proto"; |
| |
| // Power supply status sent from powerd to Chrome. |
| message PowerSupplyProperties { |
| // For any of these power sources, the system may be consuming power at a high |
| // enough rate that the battery is discharging rather than charging; see |
| // BatteryState. See the PowerSource submessage's |type| field for more |
| // details about the active power source. |
| enum ExternalPower { |
| // AC/line/mains or USB PD power is connected. This is typically the |
| // highest-power source that can be attached to the system. |
| AC = 0; |
| |
| // A low-power USB source (SDP, DCP, CDP, or ACA) is connected. |
| USB = 1; |
| |
| // No external power source is connected. |
| DISCONNECTED = 2; |
| |
| // Next value to use: 4 |
| } |
| |
| enum BatteryState { |
| // The battery is full or close to full. |
| FULL = 0; |
| |
| // The battery is being charged but is not yet full. |
| CHARGING = 1; |
| |
| // The battery is discharging. Note that an external power source may be |
| // connected but not supplying enough power to offset the system's |
| // instantaneous power consumption. This state is also used if the battery |
| // is neither charging nor discharging (i.e. current is zero) in a non-full |
| // state, which may indicate a battery defect. |
| DISCHARGING = 2; |
| |
| // The system doesn't have a battery. |
| NOT_PRESENT = 3; |
| |
| // Next value to use: 4 |
| } |
| |
| // Details about a potential source of power to the system. |
| message PowerSource { |
| enum Port { |
| // The location of the port is unknown, or there's only one port. |
| UNKNOWN = 0; |
| |
| // Various positions on the device. The first word describes the side of |
| // the device where the port is located while the second clarifies the |
| // position. For example, LEFT_BACK means the farthest-back port on the |
| // left side, while BACK_LEFT means the leftmost port on the back of the |
| // device. |
| LEFT = 1; |
| RIGHT = 2; |
| BACK = 3; |
| FRONT = 4; |
| LEFT_FRONT = 5; |
| LEFT_BACK = 6; |
| RIGHT_FRONT = 7; |
| RIGHT_BACK = 8; |
| BACK_LEFT = 9; |
| BACK_RIGHT = 10; |
| |
| // Next value to use: 11 |
| } |
| |
| enum Type { |
| // Unspecified type. |
| OTHER = 0; |
| |
| // Dedicated charger. Typically single-purpose and non-USB (e.g. barrel |
| // jack plugs). Corresponds to kernel-reported type "Mains". This source |
| // is reported by the ACPI driver and may also appear (along with a USB_PD |
| // source) on Type-C-only systems if the ACPI driver is present. |
| MAINS = 1; |
| |
| // USB Type-C, including dedicated Type-C chargers. Typically >= 7.5W. |
| // Corresponds to kernel-reported types "USB_C", "USB_PD", "USB_PD_DRP", |
| // and "BrickID". |
| USB_C = 2; |
| |
| // USB Battery Charging r1.2. Typically <= 7.5W. Corresponds to |
| // kernel-reported types "USB", "USB_ACA", "USB_CDP", and "USB_DCP". |
| USB_BC_1_2 = 3; |
| |
| // Next value to use: 4 |
| } |
| |
| // Opaque ID corresponding to the device. Do not use this for any purpose |
| // beyond comparisons with |external_power_source_id| or as an argument to |
| // powerd's SetPowerSource D-Bus method. |
| optional string id = 1; |
| |
| // The charging port to which this power source is connected. |
| optional Port port = 7; |
| |
| // Power source type. |
| optional Type type = 8; |
| |
| // Raw strings read from |manufacturer| and |model_name| files in sysfs. |
| optional string manufacturer_id = 4; |
| optional string model_id = 5; |
| |
| // Maximum power this source is capable of delivering, in watts. |
| optional double max_power = 6; |
| |
| // True if the power source will automatically deliver charge to the system |
| // when connected (assuming there isn't another |active_by_default| source |
| // doing so). If false, the source will not deliver charge unless requested |
| // to do so by the user. |
| optional bool active_by_default = 3; |
| |
| // Next ID to use: 9 |
| } |
| |
| // Current state of the external power source. |
| optional ExternalPower external_power = 14; |
| |
| // ID of the PowerSource that is currently providing power to the system. |
| optional string external_power_source_id = 17; |
| |
| // Currently-connected external power sources. |
| repeated PowerSource available_external_power_source = 18; |
| |
| // Current state of the battery. |
| optional BatteryState battery_state = 15; |
| |
| // Estimated battery charge as a percent of its total capacity, in the |
| // range [0.0, 100.0]. Unset if a battery isn't present. |
| optional double battery_percent = 7 [default = -1.0]; |
| |
| // Estimated time until the battery is empty, in seconds, or zero if the |
| // battery isn't discharging. -1 if the estimated time would be huge |
| // (e.g. because the current is zero or close to zero). Unset if a battery |
| // isn't present. |
| optional int64 battery_time_to_empty_sec = 5; |
| |
| // Estimated time until the battery is full, in seconds, or zero if the |
| // battery isn't charging. -1 if the estimated time would be huge (e.g. |
| // because the current is zero or close to zero). Unset if a battery isn't |
| // present. |
| optional int64 battery_time_to_full_sec = 6; |
| |
| // True when |battery_time_to_*| can't be trusted, e.g. because the power |
| // source just changed. Unset if a battery isn't present. |
| optional bool is_calculating_battery_time = 12 [default = false]; |
| |
| // The battery discharge rate measured in W. Positive if the battery is being |
| // discharged, negative if it's being charged, or unset if a battery isn't |
| // present. |
| optional double battery_discharge_rate = 16; |
| |
| // True if it is possible for some connected devices to function as either |
| // sources or sinks (i.e. to either deliver or receive charge). |
| optional bool supports_dual_role_devices = 19; |
| |
| // Current battery voltage level. |
| optional double battery_voltage = 20; |
| |
| // Battery manufacturer reported in sysfs as either "manufacturer" or |
| // "vendor". Ex.: "SIMPLO" |
| optional string battery_vendor = 21; |
| |
| // Battery cycle count representing the total number of times all the |
| // battery's power has been used. |
| optional int64 battery_cycle_count = 22; |
| |
| // Battery serial number reported in sysfs. |
| optional string battery_serial_number = 23; |
| |
| // Battery design capacity measured in ampere-hours (Ah). |
| optional double battery_charge_full_design = 24; |
| |
| // Battery full capacity measured in ampere-hours (Ah). |
| optional double battery_charge_full = 25; |
| |
| // Battery voltage min design measured in V. |
| optional double battery_voltage_min_design = 26; |
| |
| // Current battery charge right now, measured in ampere-hours (Ah). |
| optional double battery_charge = 27; |
| |
| // Battery model name reported by |model_name|. |
| optional string battery_model_name = 28; |
| |
| // Battery current as of now, measured in amperes (A). |
| optional double battery_current = 29; |
| |
| // Battery technology read from sysfs. |
| optional string battery_technology = 30; |
| |
| // Battery status read from sysfs. |
| optional string battery_status = 31; |
| |
| // The device's preferred minimum external power input in watts (W). When |
| // requesting the user use a higher-power external power source, this value |
| // can be displayed. |
| optional double preferred_minimum_external_power = 32; |
| |
| // Next ID to use: 33 |
| } |