1999-02-08 22:50:29 +00:00
. \" Copyright 1998, 1999 Adrian Baugh <adrian.baugh@keble.ox.ac.uk>
1999-02-08 19:57:30 +00:00
. \" based on sensors.h, part of libsensors by Frodo Looijaard
. \" libsensors is distributed under the GPL
. \"
. \" Permission is granted to make and distribute verbatim copies of this
. \" manual provided the copyright notice and this permission notice are
. \" preserved on all copies.
. \"
. \" Permission is granted to copy and distribute modified versions of this
. \" manual under the conditions for verbatim copying, provided that the
. \" entire resulting derived work is distributed under the terms of a
. \" permission notice identical to this one
. \"
. \" Since the Linux kernel and libraries are constantly changing, this
. \" manual page may be incorrect or out-of-date. The author(s) assume no
. \" responsibility for errors or omissions, or for damages resulting from
. \" the use of the information contained herein. The author(s) may not
. \" have taken the same level of care in the production of this manual,
. \" which is licensed free of charge, as they might when working
. \" professionally.
. \"
. \" Formatted or processed versions of this manual, if unaccompanied by
. \" the source, must acknowledge the copyright and authors of this work.
. \"
. \" References consulted:
. \" libsensors source code
2007-06-25 14:21:01 +00:00
.TH libsensors 3 "June 2007" "" "Linux Programmer's Manual"
1999-02-08 19:57:30 +00:00
.SH NAME
2006-10-13 19:55:41 +00:00
libsensors \- publicly accessible functions provided by the sensors library
1999-02-08 19:57:30 +00:00
.SH SYNOPSIS
.nf
2004-03-20 18:41:50 +00:00
.B #include <sensors/sensors.h>
1999-02-08 19:57:30 +00:00
.B int sensors_init(FILE *input);
.B void sensors_cleanup(void);
.B int sensors_parse_chip_name(const char *orig_name,
\fB sensors_chip_name *res);\fP
2007-08-13 20:16:03 +00:00
.B int sensors_match_chip(const sensors_chip_name *chip1,
\fB const sensors_chip_name *chip2);\fP
1999-02-08 19:57:30 +00:00
.B const char *sensors_get_adapter_name(int bus_nr);
2007-08-22 17:05:01 +00:00
.B char *sensors_get_label(const sensors_chip_name *name, int feature);\fP
2007-08-13 20:16:03 +00:00
.B int sensors_get_feature(const sensors_chip_name *name, int feature,
1999-02-08 19:57:30 +00:00
\fB double *result);\fP
2007-08-13 20:16:03 +00:00
.B int sensors_set_feature(const sensors_chip_name *name, int feature,
1999-02-08 19:57:30 +00:00
\fB double value);\fP
2007-08-13 20:16:03 +00:00
.B int sensors_do_chip_sets(const sensors_chip_name *name);
1999-02-08 19:57:30 +00:00
.B const sensors_chip_name *sensors_get_detected_chips(int *nr);
.B const sensors_feature_data *sensors_get_all_features
2007-08-13 20:16:03 +00:00
\fB (const sensors_chip_name *name, int *nr);\fP
2007-07-10 19:55:06 +00:00
.B const char *libsensors_version;
1999-02-08 19:57:30 +00:00
.fi
.SH DESCRIPTION
.B int sensors_init(FILE *input);
.br
2007-08-22 17:04:12 +00:00
Load the configuration file and the detected chips list. If this returns a
value unequal to zero, you are in trouble; you can not assume anything will
be initialized properly. If you want to reload the configuration file, call
sensors_cleanup() below before calling sensors_init() again.
1999-02-08 19:57:30 +00:00
.B void sensors_cleanup(void);
.br
2003-11-23 21:26:37 +00:00
Clean-up function: You can't access anything after this, until the next sensors_init() call!
1999-02-08 19:57:30 +00:00
.br
\fB int sensors_parse_chip_name(const char *orig_name,
sensors_chip_name *res);\fP
.br
Parse a chip name to the internal representation. Return 0 on succes, <0 on error.
2007-08-13 20:16:03 +00:00
\fB int sensors_match_chip(const sensors_chip_name *chip1,
const sensors_chip_name *chip2);\fP
1999-02-08 19:57:30 +00:00
.br
Compare two chips name descriptions, to see whether they could match. Return 0 if it does not match, return 1 if it does match.
.B const char *sensors_get_adapter_name(int bus_nr);
.br
2006-10-13 19:55:41 +00:00
This function returns the adapter name of a bus number, as used within the
sensors_chip_name structure. If it could not be found, it returns NULL.
2007-08-22 17:05:01 +00:00
\fB char *sensors_get_label(const sensors_chip_name *name, int feature);\fP
1999-02-08 19:57:30 +00:00
.br
2007-08-22 17:05:01 +00:00
Look up the label which belongs to this chip. Note that chip should not
contain wildcard values! The returned string is newly allocated (free it
yourself). On failure, NULL is returned.
If no label exists for this feature, its name is returned itself.
1999-02-08 19:57:30 +00:00
2007-08-13 20:16:03 +00:00
\fB int sensors_get_feature(const sensors_chip_name *name,
1999-02-08 19:57:30 +00:00
int feature, double *result);\fP
.br
Read the value of a feature of a certain chip. Note that chip should not contain wildcard values! This function will return 0 on success, and <0 on failure.
2007-08-13 20:16:03 +00:00
\fB int sensors_set_feature(const sensors_chip_name *name,
1999-02-08 19:57:30 +00:00
int feature, double value);\fP
.br
Set the value of a feature of a certain chip. Note that chip should not contain wildcard values! This function will return 0 on success, and <0 on failure.
2007-08-13 20:16:03 +00:00
.B int sensors_do_chip_sets(const sensors_chip_name *name);
1999-02-08 19:57:30 +00:00
.br
Execute all set statements for this particular chip. The chip may contain wildcards! This function will return 0 on success, and <0 on failure.
\fB const sensors_chip_name *sensors_get_detected_chips
(int *nr);\fP
.br
This function returns all detected chips, one by one. To start at the beginning of the list, use 0 for nr; NULL is returned if we are at the end of the list. Do not try to change these chip names, as they point to internal structures! Do not use nr for anything else.
This structure is used when you want to get all features of a specific chip.
.br
\fB typedef struct sensors_feature_data {
.br
int number;
.br
const char *name;
2007-07-19 20:46:09 +00:00
.br
sensors_feature_type type;
1999-02-08 19:57:30 +00:00
.br
int mapping;
.br
2007-07-19 20:46:09 +00:00
int compute_mapping;
1999-02-08 19:57:30 +00:00
.br
int mode;
.br
} sensors_feature_data;\fP
.br
2007-06-29 12:30:58 +00:00
The mode field can be one of:
1999-02-08 19:57:30 +00:00
.br
2007-06-29 12:30:58 +00:00
SENSORS_MODE_NO_RW, SENSORS_MODE_R, SENSORS_MODE_W or SENSORS_MODE_RW.
1999-02-08 19:57:30 +00:00
\fB const sensors_feature_data *sensors_get_all_features
2007-08-13 20:16:03 +00:00
(const sensors_chip_name *name, int *nr);\fP
2007-07-24 08:19:59 +00:00
.br
This returns all features of a specific chip. They are returned in bunches:
everything with the same mapping is returned just after each other, with
the master feature in front (that feature does not map to itself, but
has SENSORS_NO_MAPPING as mapping field). nr is an internally used variable.
Set it to zero to start again at the begin of the list. If no more features
are found NULL is returned. Do not try to change the returned structure; you
will corrupt internal data structures.
1999-02-08 19:57:30 +00:00
2007-07-10 19:55:06 +00:00
\fB const char *libsensors_version;\fP
.br
A string representing the version of libsensors.
1999-02-08 19:57:30 +00:00
.SH "CONFORMING TO"
lm_sensors-2.x
.SH SEE ALSO
sensors.conf(5)
2004-04-20 01:25:22 +00:00
.SH AUTHOR
Frodo Looijaard and the lm_sensors group
2006-09-17 21:01:35 +00:00
http://www.lm-sensors.org/
1999-02-08 19:57:30 +00:00