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

Revision 4157, 6.5 KB (checked in by ruik, 7 years ago)

Fix the homepage address

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1.\" Copyright 1998, 1999 Adrian Baugh <adrian.baugh@keble.ox.ac.uk>
2.\" based on sensors.h, part of libsensors by Frodo Looijaard
3.\" libsensors is distributed under the GPL
4.\"
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.
8.\"
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
13.\"
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.
21.\"
22.\" Formatted or processed versions of this manual, if unaccompanied by
23.\" the source, must acknowledge the copyright and authors of this work.
24.\"
25.\" References consulted:
26.\"     libsensors source code
27.TH libsensors 3  "December 30, 1998" "" "Linux Programmer's Manual"
28.SH NAME
29libsensors \- publically accessible functions provided by the sensors library
30.SH SYNOPSIS
31.nf
32.B #include <sensors/sensors.h>
33
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 int sensors_match_chip(sensors_chip_name chip1,
39                       \fBsensors_chip_name chip2);\fP
40.B int sensors_chip_name_has_wildcards(sensors_chip_name chip);
41.B const char *sensors_get_adapter_name(int bus_nr);
42.B const char *sensors_get_algorithm_name(int bus_nr);
43.B int sensors_get_label(sensors_chip_name name, int feature,
44                      \fBchar **result);\fP
45.B int sensors_get_feature(sensors_chip_name name, int feature,
46                        \fBdouble *result);\fP
47.B int sensors_set_feature(sensors_chip_name name, int feature,
48                        \fBdouble value);\fP
49.B int sensors_do_chip_sets(sensors_chip_name name);
50.B extern int sensors_do_all_sets(void);
51.B const sensors_chip_name *sensors_get_detected_chips(int *nr);
52.B const sensors_feature_data *sensors_get_all_features
53             \fB(sensors_chip_name name, int *nr1,int *nr2);\fP
54.fi
55.SH DESCRIPTION
56.B int sensors_init(FILE *input);
57.br
58(Re)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.
59
60.B void sensors_cleanup(void);
61.br
62Clean-up function: You can't access anything after this, until the next sensors_init() call!
63.br
64
65\fBint sensors_parse_chip_name(const char *orig_name,
66                            sensors_chip_name *res);\fP
67.br
68Parse a chip name to the internal representation. Return 0 on succes, <0 on error.
69
70\fBint sensors_match_chip(sensors_chip_name chip1,
71                       sensors_chip_name chip2);\fP
72.br
73Compare two chips name descriptions, to see whether they could match. Return 0 if it does not match, return 1 if it does match.
74
75\fBint sensors_chip_name_has_wildcards
76    (sensors_chip_name chip);\fP
77.br
78Check whether the chip name is an 'absolute' name, which can only match one chip, or whether it has wildcards. Returns 0 if it is absolute, 1 if there are wildcards.
79
80.B const char *sensors_get_adapter_name(int bus_nr);
81.br
82.B const char *sensors_get_algorithm_name(int bus_nr);
83.br
84These functions return the adapter and algorithm names of a bus number, as used within the sensors_chip_name structure. If it could not be found, it returns NULL
85
86\fBint sensors_get_label(sensors_chip_name name, int feature,
87                      char **result);\fP
88.br
89Look up the label which belongs to this chip. Note that chip should not contain wildcard values! *result is newly allocated (free it yourself). This function will return 0 on success, and <0 on failure.
90
91\fBint sensors_get_feature(sensors_chip_name name,
92                        int feature, double *result);\fP
93.br
94Read 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.
95
96\fBint sensors_set_feature(sensors_chip_name name,
97                        int feature, double value);\fP
98.br
99Set 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.
100
101.B int sensors_do_chip_sets(sensors_chip_name name);
102.br
103Execute all set statements for this particular chip. The chip may contain wildcards!  This function will return 0 on success, and <0 on failure.
104
105.B int sensors_do_all_sets(void);
106.br
107Execute all set statements for all detected chips. This is the same as calling sensors_do_chip_sets with an all wildcards chip name
108
109\fBconst sensors_chip_name *sensors_get_detected_chips
110                        (int *nr);\fP
111.br
112This 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.
113
114This structure is used when you want to get all features of a specific chip.
115.br
116\fBtypedef struct sensors_feature_data {
117.br
118  int number;
119.br
120  const char *name;
121.br
122  int mapping;
123.br
124  int unused;
125.br
126  int mode;
127.br
128} sensors_feature_data;\fP
129.br
130The field sensors_feature_data can be one of:
131.br
132SENSORS_MODE_NO_RW, SENSORS_MODE_R, SENSORS_MODE_W,
133.br
134SENSORS_MODE_RW or SENSORS_NO_MAPPING.
135
136\fBconst sensors_feature_data *sensors_get_all_features
137      (sensors_chip_name name, int *nr1,int *nr2);\fP
138.br
139This 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). nr1 and nr2 are two internally used variables. Set both 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.
140
141
142.SH "CONFORMING TO"
143lm_sensors-2.x
144.SH SEE ALSO
145sensors.conf(5)
146
147.SH AUTHOR
148Frodo Looijaard and the lm_sensors group
149http://www.lm-sensors.org/
150
Note: See TracBrowser for help on using the browser.