Some newer lithium-polymer batteries in 2015 have a max at 4.35V instead of 4.2V. ON BKG: Lithium BatteriesĪlmost all Li-Ion batteries have a max / charging voltage of 4.2V. Because of this, the mapping of your /sys filesystem (SysFS) might not be the same if you upgrade your phone. Android M is in developer preview as of this writing, and Android 5.1.1 has been released already. (That the CV source runs at 4.2V, the asymptotic high end of the power curve for a Li-Ion battery.) SysFS I say this because of the datasheet for the chip lists it as a battery charger, which would explain why it has a constant voltage (CV). The SMB347, also listed as a fuel gauge on the same documentation, even though, is probably a battery charger. Nexus 10:įor your Nexus 10, you should use the Dallas Semiconductor DS2784, according to this official documentation from on Measuring Android Device Power. Your question was about which source to use, and presumably how to determine it programmatically.įor all android devices, you should use the fuel gauge. temp or batt_temp (in tenth of ☌): 305 for 30.5☌.health (string): Cold, Death, Good, Overheat, Over voltage, Unspecified failure, Unknown.status: Charging, Discharging, Not charging, Full, Unknown.Did you already cat the type file for all the 3 sysfs entries? for all the 3 you get 'Battery'?Ĭonsidering that Android expects several parameters from the battery (see below), i may guess that they are split in those 3 sysfs files you got.įor example the fuel gauge is the hardware component that reads the current flow from/to the battery and calculate the remaining capacity, thus reading the capacity file from it should give you the %, but probably the voltage is read from another file.īattery params (i.e.: /sys/class/power_supply/my_batt/status): On android devices you may have more than one battery, like the backup for RTC or for other peripherals. emphasize that type=Battery for all three devices.how do I distinguish them in a general way?.why are there multiple entries here with type=battery?.I see a similar effect when I compare ds2784-fuelgauge/current_now and smb347-battery/current_now. it changes when I start a compute-heavy task), but smb347-battery/voltage_now seems to be fixed. For example, for ds2784-fuelgauge/voltage_now and smb347-battery/voltage_now: $ cat ds2784-fuelgauge/voltage_nowĭs2784-fuelgauge/voltage_now seems to be updated regularly (e.g. However, on my Nexus 10 they have different values. In the Android BatteryManager code they just iterate through the battery devices and take the first one that has the entry they want ( ). For example: $ cat /sys/class/power_supply/ds2784-fuelgauge/type On a Nexus 10 with KitKat 4.4.4 I see: $ ls /sys/class/power_supply My difficulty is that I find multiple entries with type "Battery" and I don't know which one to use. The only way I know to accomplish this is to read the values out /sys/class/power_supply. I am trying to read battery information from an NDK app.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |