Subject: Re: envstat -s sensor -d device
To: Iain Hibbert <plunky@rya-online.net>
From: Juan RP <juan@xtrarom.org>
List: tech-userlevel
Date: 09/23/2007 15:47:31
On Sun, 23 Sep 2007 13:34:24 +0100 (BST)
Iain Hibbert <plunky@rya-online.net> wrote:

> Hi Juan,
>         using the -s sensor option for envstat, I see the following:
> 
> galant: {1} envstat
>     acpiacad0 connected:         ON
>        acpibat0 present:         ON
>     acpibat0 design cap:      4.500 Ah
>  acpibat0 last full cap:      4.500 Ah
>     acpibat0 technology:          1
> acpibat0 design voltage:     10.800 V
>       acpibat0 warn cap:      0.090 Ah ( 2.00%)
>        acpibat0 low cap:      0.000 Ah ( 0.00%)
>        acpibat0 voltage:     11.300 V
>    acpibat0 charge rate:        N/A
> acpibat0 discharge rate:        N/A
>         acpibat0 charge:      4.500 Ah (100.00%)
>       acpibat0 charging:        OFF
>   acpibat0 charge state:     NORMAL
>        acpibat1 present:        OFF
>     acpibat1 design cap:      0.000 Wh
>  acpibat1 last full cap:      0.000 Wh
>     acpibat1 technology:          0
> acpibat1 design voltage:      0.000 V
>       acpibat1 warn cap:      0.000 Wh
>        acpibat1 low cap:      0.000 Wh
>        acpibat1 voltage:      0.000 V
>    acpibat1 charge rate:      0.000 W
> acpibat1 discharge rate:      0.000 W
>         acpibat1 charge:      0.000 Wh
>       acpibat1 charging:        OFF
>   acpibat1 charge state:    UNKNOWN
>     acpitz0 temperature:     64.000 degC
> 
> galant: {2} envstat -d acpibat0
>        acpibat0 present:         ON
>     acpibat0 design cap:      4.500 Ah
>  acpibat0 last full cap:      4.500 Ah
>     acpibat0 technology:          1
> acpibat0 design voltage:     10.800 V
>       acpibat0 warn cap:      0.090 Ah ( 2.00%)
>        acpibat0 low cap:      0.000 Ah ( 0.00%)
>        acpibat0 voltage:     11.300 V
>    acpibat0 charge rate:        N/A
> acpibat0 discharge rate:        N/A
>         acpibat0 charge:      4.500 Ah (100.00%)
>       acpibat0 charging:        OFF
>   acpibat0 charge state:     NORMAL
> 
> galant: {3} envstat -d acpibat0 -s 'design cap'
> envstat: unknown sensor `design cap' for device `acpibat0'
> 
> galant: {4} envstat -d acpibat0 -s 'acpibat0 design cap'
>     acpibat0 design cap:      4.500 Ah
> 
> is this a bug?
> 
> I'm not sure what the intention here is: the name of the sensor seems
> to contain the name of the device, but although this is done in
> dev/acpi when registering the sensors, it seems that envstat(1) does
> not print the name of the device separately in any case .. should it?

I don't think it's a bug. Device name is shown you use -D
(to list registered drivers).

The sensor description is "acpibat0 design cap" and you need to
pass the exact string to -s. As there is not naming convention
for sensor descriptions, the device writer uses what he thinks
is better.

In acpibat(4) and acpitz(4) is ok to use device name before the
real string in sensor description, otherwise you wouldn't know
what sensor is from foo0 or foo1.

Cheers,

-- 
Juan Romero Pardines 	- The NetBSD Project
http://plog.xtrarom.org/ 	- NetBSD/pkgsrc news in Spanish