On Sun, Feb 24, 2013 at 5:40 PM, Dmitry Sarkisov <ait.ml...@gmail.com>wrote:

> Hello,
>
> I'm trying to poll cpu temperature with the following code:
>
>
> #define TEMP_MIB "hw.acpi.thermal.tz0.temperature"
>
>        size_t len;
>        int t;
>
>        len = sizeof(t);
>        bzero(temp, len);
>
>        if(sysctlbyname(TEMP_MIB, &t, &len, NULL, 0) == -1 ){
>           perror("sysctl");
>           return -1;
>         }else{
>           printf("%d\n", t);
>         }
>
> Values I'm geting are like this:
> 3732
>
> while actual is:
>
>  sysctl -n hw.acpi.thermal.tz0.temperature
> 55.0C
>

ACPI does not report temperature in degrees Celsius, but in tenths of a
degree Kelvin.  So both agree.

When ACPI was first introduced into head (v5?), the  sysctl  reported the
raw number, but the code was later modified to provide a more human
friendly value. Directly probing ACPI for temperature still returns the raw
value.
-- 
R. Kevin Oberman, Network Engineer
E-mail: rkober...@gmail.com
_______________________________________________
freebsd-acpi@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-acpi
To unsubscribe, send any mail to "freebsd-acpi-unsubscr...@freebsd.org"

Reply via email to