1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

Dump current status of battery as well.

The -i code doesn't really belong here in the first place I would think,
but keep it together for now.
This commit is contained in:
Poul-Henning Kamp 2004-11-24 12:49:39 +00:00
parent 39c7a710c6
commit fdcef74733
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=138044

View File

@ -115,6 +115,14 @@ acpi_battinfo(int num)
printf("Type:\t\t\t%s\n", battio.bif.type);
printf("OEM info:\t\t%s\n", battio.bif.oeminfo);
battio.unit = num;
if (ioctl(acpifd, ACPIIO_CMBAT_GET_BST, &battio) == -1)
err(EX_IOERR, "get battery info (%d) failed", num);
printf("State:\t\t\t%d\n", battio.bst.state);
printf("Present rate:\t\t%d\n", battio.bst.rate);
printf("Remaining capacity:\t%d mWh\n", battio.bst.cap);
printf("Volt:\t\t\t%.3f V\n", battio.bst.volt * .001);
return (0);
}