Incorrect Truncation of Battery-Type report
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
acpitool (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: acpitool
In the source for acpitool 0.4.7, the definition of Battery_
$ acpitool -Bv
Battery #1 : present
Remaining capacity : 15510 mWh, 26.87%
Design capacity : 57720 mWh
Last full capacity : 57720 mWh
Present rate : unknown
Charging state : discharging
Battery type : non-recharge, LiOn
At or around line 36 of src/acpitool.h:
struct Battery_Info {
int Battery_Present;
char Charging_State[12];
char Remaining_Cap[10];
char Design_Cap[10];
char LastFull_Cap[10];
char Present_Rate[10];
char Technology[13];
char Model[13];
char Serial[13];
char Bat_Type[13];
};
This limits the reported battery-technology to 13 bytes which will in particular truncate the report of "non-rechargeable" to "non-recharge".
The reporting line in battery.cpp then displays the truncated message:
cout<<" Battery type : "<<Batt_
On the face if it this looks cosmetic but when trying to diagnose an ACPI problem where ACPI battery-technology is reported as "non-recharge" but hal reports the battery as rechargeable, this truncation caused confusion over where the reported string was originating and diverted effort into determining where the various reports originated from.
Upstream report at SourceForge
http:// sourceforge. net/tracker/ index.php? func=detail& aid=1738351& group_id= 111358& atid=659017