diff options
author | phk <phk@FreeBSD.org> | 2004-11-24 12:49:39 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-11-24 12:49:39 +0000 |
commit | 897db391de70ffe5dfb9d09119e3de97db55a3ea (patch) | |
tree | 405cd6b2face2035b1ad1a3a69441d49077b5d03 /usr.sbin/acpi | |
parent | ccede841b51fa454e2d973eae5f73bf0b4e129d2 (diff) | |
download | FreeBSD-src-897db391de70ffe5dfb9d09119e3de97db55a3ea.zip FreeBSD-src-897db391de70ffe5dfb9d09119e3de97db55a3ea.tar.gz |
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.
Diffstat (limited to 'usr.sbin/acpi')
-rw-r--r-- | usr.sbin/acpi/acpiconf/acpiconf.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/usr.sbin/acpi/acpiconf/acpiconf.c b/usr.sbin/acpi/acpiconf/acpiconf.c index cf1034b..5ff4cb2 100644 --- a/usr.sbin/acpi/acpiconf/acpiconf.c +++ b/usr.sbin/acpi/acpiconf/acpiconf.c @@ -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); } |