root/lm-sensors/trunk/lib/libsensors.3 @ 5651

Revision 5651, 7.3 KB (checked in by khali, 4 years ago)

Reformat description section.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1.\" Copyright (C) 1998, 1999  Adrian Baugh <adrian.baugh@keble.ox.ac.uk>
2.\" Copyright (C) 2007, 2009  Jean Delvare <khali@linux-fr.org>
3.\" based on sensors.h, part of libsensors by Frodo Looijaard
4.\" libsensors is distributed under the GPL
5.\"
6.\" Permission is granted to make and distribute verbatim copies of this
7.\" manual provided the copyright notice and this permission notice are
8.\" preserved on all copies.
9.\"
10.\" Permission is granted to copy and distribute modified versions of this
11.\" manual under the conditions for verbatim copying, provided that the
12.\" entire resulting derived work is distributed under the terms of a
13.\" permission notice identical to this one
14.\"
15.\" Since the Linux kernel and libraries are constantly changing, this
16.\" manual page may be incorrect or out-of-date.  The author(s) assume no
17.\" responsibility for errors or omissions, or for damages resulting from
18.\" the use of the information contained herein.  The author(s) may not
19.\" have taken the same level of care in the production of this manual,
20.\" which is licensed free of charge, as they might when working
21.\" professionally.
22.\"
23.\" Formatted or processed versions of this manual, if unaccompanied by
24.\" the source, must acknowledge the copyright and authors of this work.
25.\"
26.\" References consulted:
27.\"     libsensors source code
28.TH libsensors 3  "February 2009" "lm-sensors 3" "Linux Programmer's Manual"
29
30.SH NAME
31libsensors \- publicly accessible functions provided by the sensors library
32
33.SH SYNOPSIS
34.nf
35.B #include <sensors/sensors.h>
36
37/* Library initialization and clean-up */
38.BI "int sensors_init(FILE *" input ");"
39.B void sensors_cleanup(void);
40.BI "const char *" libsensors_version ";"
41
42/* Chip name handling */
43.BI "int sensors_parse_chip_name(const char *" orig_name ","
44.BI "                            sensors_chip_name *" res ");"
45.BI "const char *sensors_get_adapter_name(const sensors_bus_id *" bus ");"
46
47/* Chips and features enumeration */
48.B const sensors_chip_name *
49.BI "sensors_get_detected_chips(const sensors_chip_name *" match ","
50.BI "                           int *" nr ");"
51.B const sensors_feature *
52.BI "sensors_get_features(const sensors_chip_name *" name ","
53.BI "                     int *" nr ");"
54.B const sensors_subfeature *
55.BI "sensors_get_all_subfeatures(const sensors_chip_name *" name ","
56.BI "                            const sensors_feature *" feature ","
57.BI "                            int *" nr ");"
58.B const sensors_subfeature *
59.BI "sensors_get_subfeature(const sensors_chip_name *" name ","
60.BI "                       const sensors_feature *" feature ","
61.BI "                       sensors_subfeature_type " type ");"
62
63/* Features access */
64.BI "char *sensors_get_label(const sensors_chip_name *" name ","
65.BI "                        const sensors_feature *" feature ");"
66.BI "int sensors_get_value(const sensors_chip_name *" name ", int " subfeat_nr ","
67.BI "                      double *" value ");"
68.BI "int sensors_set_value(const sensors_chip_name *" name ", int " subfeat_nr ","
69.BI "                      double " value ");"
70.BI "int sensors_do_chip_sets(const sensors_chip_name *" name ");"
71.fi
72
73.SH DESCRIPTION
74.B sensors_init()
75loads the configuration file and the detected chips list. If this returns a
76value unequal to zero, you are in trouble; you can not assume anything will
77be initialized properly. If you want to reload the configuration file, call
78sensors_cleanup() below before calling sensors_init() again.
79
80If FILE is NULL, the default configuration files are used (see the FILES
81section below). Most applications will want to do that.
82
83.B sensors_cleanup()
84cleans everything up: you can't access anything after this, until the next sensors_init() call!
85
86.B sensors_parse_chip_name()
87parses a chip name to the internal representation. Return 0 on success,
88<0 on error.
89
90.B sensors_get_adapter_name()
91returns the adapter name of a bus number, as used within the
92sensors_chip_name structure. If it could not be found, it returns NULL.
93
94.B sensors_get_label()
95looks up the label which belongs to this chip. Note that chip should not
96contain wildcard values! The returned string is newly allocated (free it
97yourself). On failure, NULL is returned.
98If no label exists for this feature, its name is returned itself.
99
100.B sensors_get_value()
101Reads the value of a subfeature of a certain chip. Note that chip should not
102contain wildcard values! This function will return 0 on success, and <0 on
103failure.
104
105.B sensors_set_value()
106sets the value of a subfeature of a certain chip. Note that chip should not
107contain wildcard values! This function will return 0 on success, and <0 on
108failure.
109
110.B sensors_do_chip_sets()
111executes all set statements for this particular chip. The chip may contain
112wildcards!  This function will return 0 on success, and <0 on failure.
113
114.B sensors_get_detected_chips()
115returns all detected chips that match a given chip name,
116one by one. If no chip name is provided, all detected chips are returned.
117To start at the beginning of the list, use 0 for nr; NULL is returned if
118we are at the end of the list. Do not try to change these chip names, as
119they point to internal structures!
120
121This structure contains information related to a given feature of a
122specific chip.
123.br
124\fBtypedef struct sensors_feature {
125.br
126        const char *name;
127.br
128        int number;
129.br
130        sensors_feature_type type;
131.br
132} sensors_feature;\fP
133.br
134There are other member not documented here, which are only meant for libsensors
135internal use.
136
137This structure contains information related to a given subfeature of a
138specific chip feature.
139.br
140\fBtypedef struct sensors_subfeature {
141.br
142        const char *name;
143.br
144        int number;
145.br
146        sensors_subfeature_type type;
147.br
148        int mapping;
149.br
150        unsigned int flags;
151.br
152} sensors_subfeature;\fP
153.br
154The flags field is a bitfield, its value is a combination of
155SENSORS_MODE_R (readable), SENSORS_MODE_W (writable) and SENSORS_COMPUTE_MAPPING
156(affected by the computation rules of the main feature).
157
158.B sensors_get_features()
159returns all main features of a specific chip. nr is an internally
160used variable. Set it to zero to start at the begin of the list. If no
161more features are found NULL is returned.
162Do not try to change the returned structure; you will corrupt internal
163data structures.
164
165.B sensors_get_all_subfeatures()
166returns all subfeatures of a given main feature. nr is an internally
167used variable. Set it to zero to start at the begin of the list. If no
168more subfeatures are found NULL is returned.
169Do not try to change the returned structure; you will corrupt internal
170data structures.
171
172.B sensors_get_subfeature()
173returns the subfeature of the given type for a given main feature,
174if it exists, NULL otherwise.
175Do not try to change the returned structure; you will corrupt internal
176data structures.
177
178.B libsensors_version
179is a string representing the version of libsensors.
180
181.SH FILES
182.I /etc/sensors3.conf
183.br
184.I /etc/sensors.conf
185.RS
186The system-wide
187.BR libsensors (3)
188configuration file. /etc/sensors3.conf is tried first, and if it doesn't exist,
189/etc/sensors.conf is used instead.
190.RE
191
192.I /etc/sensors.d
193.RS
194A directory where you can put additional libsensors configuration files.
195Files found in this directory will be processed in alphabetical order after
196the default configuration file. Files with names that start with a dot are
197ignored.
198.RE
199
200.SH SEE ALSO
201sensors.conf(5)
202
203.SH AUTHOR
204Frodo Looijaard and the lm_sensors group
205http://www.lm-sensors.org/
206
Note: See TracBrowser for help on using the browser.