All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] Using libsensors in custom application
Date: Sat, 14 Jul 2007 19:47:39 +0000	[thread overview]
Message-ID: <20070714214739.3dc110ee@hyperion.delvare> (raw)
In-Reply-To: <000001c7bf4e$d7dce200$0500a8c0@LSSDESIGN>

Hi John,

On Thu, 5 Jul 2007 16:52:52 -0500, John Beavers wrote:
> I'm trying to develop an application that can get the temperature of the CPU
> / MB and send it to another machine on the network for remote temperature
> monitoring.  I've managed to compile and run a program that successfully
> sends test data over the network, reads chip data like sensors (using the
> same code), but I cannot get it to do both together.  Basically, I cannot
> tell where / how sensors is getting the information it is outputting to the
> screen.  I've tracked it down to m->fn(&name); in the do_a_print() function,
> but I cannot see how that line prints out the chip information.

The callback function (m->fn) is chip-specific. The "matches" array
gives the correspondence between a chip name and its printing function.
All the printing functions are in a different source file (chips.c).
Yes, it's a mess.

>                                                                  My question
> is, is there a tutorial of how to use libsensors in an application
> somewhere,

sensors' source code is the tutorial. And you have the libsensors man
page for reference, too.

>            or can you give me a brief explanation of how to get the CPU  &
> MB temp from libsensors?

libsensors can't give you that, because it has no knowledge of what
sensor measures what. In its current incarnation, it doesn't even
know which sensors are temperature sensors, and which are, say, fan
sensors. This will be much better in the next (major) version, but for
now, libsensors is heavily chip-specific.

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

      reply	other threads:[~2007-07-14 19:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-05 21:52 [lm-sensors] Using libsensors in custom application John Beavers
2007-07-14 19:47 ` Jean Delvare [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070714214739.3dc110ee@hyperion.delvare \
    --to=khali@linux-fr.org \
    --cc=lm-sensors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.