root/lm-sensors/branches/lm-sensors-3.0.0/lib/libsensors.3 @ 4702

Revision 4702, 5.9 KB (checked in by khali, 7 years ago)

Make sensors_match_chip internal to libsensors. It is no longer used by
applications in practice.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
1.\" Copyright 1998, 1999 Adrian Baugh <>
2.\" based on sensors.h, part of libsensors by Frodo Looijaard
3.\" libsensors is distributed under the GPL
5.\" Permission is granted to make and distribute verbatim copies of this
6.\" manual provided the copyright notice and this permission notice are
7.\" preserved on all copies.
9.\" Permission is granted to copy and distribute modified versions of this
10.\" manual under the conditions for verbatim copying, provided that the
11.\" entire resulting derived work is distributed under the terms of a
12.\" permission notice identical to this one
14.\" Since the Linux kernel and libraries are constantly changing, this
15.\" manual page may be incorrect or out-of-date.  The author(s) assume no
16.\" responsibility for errors or omissions, or for damages resulting from
17.\" the use of the information contained herein.  The author(s) may not
18.\" have taken the same level of care in the production of this manual,
19.\" which is licensed free of charge, as they might when working
20.\" professionally.
22.\" Formatted or processed versions of this manual, if unaccompanied by
23.\" the source, must acknowledge the copyright and authors of this work.
25.\" References consulted:
26.\"     libsensors source code
27.TH libsensors 3  "June 2007" "lm-sensors 3" "Linux Programmer's Manual"
29libsensors \- publicly accessible functions provided by the sensors library
32.B #include <sensors/sensors.h>
34.B int sensors_init(FILE *input);
35.B void sensors_cleanup(void);
36.B int sensors_parse_chip_name(const char *orig_name,
37                            \fBsensors_chip_name *res);\fP
38.B const char *sensors_get_adapter_name(int bus_nr);
39.B char *sensors_get_label(const sensors_chip_name *name, int feature);\fP
40.B int sensors_get_value(const sensors_chip_name *name, int feature,
41                      \fBdouble *value);\fP
42.B int sensors_set_value(const sensors_chip_name *name, int feature,
43                      \fBdouble value);\fP
44.B int sensors_do_chip_sets(const sensors_chip_name *name);
45.B const sensors_chip_name *sensors_get_detected_chips(const sensors_chip_name
46                                                    \fB*match, int *nr);\fP
47.B const sensors_feature_data *sensors_get_all_features
48             \fB(const sensors_chip_name *name, int *nr);\fP
49.B const char *libsensors_version;
52.B int sensors_init(FILE *input);
54Load the configuration file and the detected chips list. If this returns a
55value unequal to zero, you are in trouble; you can not assume anything will
56be initialized properly. If you want to reload the configuration file, call
57sensors_cleanup() below before calling sensors_init() again.
59.B void sensors_cleanup(void);
61Clean-up function: You can't access anything after this, until the next sensors_init() call!
64\fBint sensors_parse_chip_name(const char *orig_name,
65                            sensors_chip_name *res);\fP
67Parse a chip name to the internal representation. Return 0 on succes, <0 on error.
69.B const char *sensors_get_adapter_name(int bus_nr);
71This function returns the adapter name of a bus number, as used within the
72sensors_chip_name structure. If it could not be found, it returns NULL.
74\fBchar *sensors_get_label(const sensors_chip_name *name, int feature);\fP
76Look up the label which belongs to this chip. Note that chip should not
77contain wildcard values! The returned string is newly allocated (free it
78yourself). On failure, NULL is returned.
79If no label exists for this feature, its name is returned itself.
81\fBint sensors_get_value(const sensors_chip_name *name,
82                      int feature, double *value);\fP
84Read 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.
86\fBint sensors_set_value(const sensors_chip_name *name,
87                      int feature, double value);\fP
89Set 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.
91.B int sensors_do_chip_sets(const sensors_chip_name *name);
93Execute all set statements for this particular chip. The chip may contain wildcards!  This function will return 0 on success, and <0 on failure.
95\fBconst sensors_chip_name *sensors_get_detected_chips(const sensors_chip_name
96                                                    *match, int *nr);\fP
98This function returns all detected chips that match a given chip name,
99one by one. If no chip name is provided, all detected chips are returned.
100To start at the beginning of the list, use 0 for nr; NULL is returned if
101we are at the end of the list. Do not try to change these chip names, as
102they point to internal structures!
104This structure is used when you want to get all features of a specific chip.
106\fBtypedef struct sensors_feature_data {
108  int number;
110  const char *name;
112  sensors_feature_type type;
114  int mapping;
116  int compute_mapping;
118  int mode;
120} sensors_feature_data;\fP
122The mode field is a bitfield, its value is a combination of
123SENSORS_MODE_R (readable) and SENSORS_MODE_W (writable).
125\fBconst sensors_feature_data *sensors_get_all_features
126      (const sensors_chip_name *name, int *nr);\fP
128This returns all features of a specific chip. They are returned in bunches:
129everything with the same mapping is returned just after each other, with
130the master feature in front (that feature does not map to itself, but
131has SENSORS_NO_MAPPING as mapping field). nr is an internally used variable.
132Set it to zero to start again at the begin of the list. If no more features
133are found NULL is returned. Do not try to change the returned structure; you
134will corrupt internal data structures.
136\fBconst char *libsensors_version;\fP
138A string representing the version of libsensors.
144Frodo Looijaard and the lm_sensors group
Note: See TracBrowser for help on using the browser.