root/lm-sensors/tags/V2-10-4/lib/libsensors.3

Revision 4524, 6.6 kB (checked in by khali, 1 year ago)

Fix the description of the mode field.

  • 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  "October 2006" "" "Linux Programmer's Manual"
28 .SH NAME
29 libsensors \- publicly 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 int sensors_get_label(sensors_chip_name name, int feature,
43                       \fBchar **result);\fP
44 .B int sensors_get_feature(sensors_chip_name name, int feature,
45                         \fBdouble *result);\fP
46 .B int sensors_set_feature(sensors_chip_name name, int feature,
47                         \fBdouble value);\fP
48 .B int sensors_do_chip_sets(sensors_chip_name name);
49 .B extern int sensors_do_all_sets(void);
50 .B const sensors_chip_name *sensors_get_detected_chips(int *nr);
51 .B const sensors_feature_data *sensors_get_all_features
52              \fB(sensors_chip_name name, int *nr1,int *nr2);\fP
53 .fi
54 .SH DESCRIPTION
55 .B int sensors_init(FILE *input);
56 .br
57 (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.
58
59 .B void sensors_cleanup(void);
60 .br
61 Clean-up function: You can't access anything after this, until the next sensors_init() call!
62 .br
63
64 \fBint sensors_parse_chip_name(const char *orig_name,
65                             sensors_chip_name *res);\fP
66 .br
67 Parse a chip name to the internal representation. Return 0 on succes, <0 on error.
68
69 \fBint sensors_match_chip(sensors_chip_name chip1,
70                        sensors_chip_name chip2);\fP
71 .br
72 Compare two chips name descriptions, to see whether they could match. Return 0 if it does not match, return 1 if it does match.
73
74 \fBint sensors_chip_name_has_wildcards
75     (sensors_chip_name chip);\fP
76 .br
77 Check 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.
78
79 .B const char *sensors_get_adapter_name(int bus_nr);
80 .br
81 This function returns the adapter name of a bus number, as used within the
82 sensors_chip_name structure. If it could not be found, it returns NULL.
83
84 .B const char *sensors_get_algorithm_name(int bus_nr);
85 .br
86 This function used to return the algorithm name of a bus number.
87 It is now deprecated and returns an arbitrary string. It will be dropped
88 in a later version of the library so you should stop using it.
89
90 \fBint sensors_get_label(sensors_chip_name name, int feature,
91                       char **result);\fP
92 .br
93 Look 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.
94
95 \fBint sensors_get_feature(sensors_chip_name name,
96                         int feature, double *result);\fP
97 .br
98 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.
99
100 \fBint sensors_set_feature(sensors_chip_name name,
101                         int feature, double value);\fP
102 .br
103 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.
104
105 .B int sensors_do_chip_sets(sensors_chip_name name);
106 .br
107 Execute all set statements for this particular chip. The chip may contain wildcards!  This function will return 0 on success, and <0 on failure.
108
109 .B int sensors_do_all_sets(void);
110 .br
111 Execute all set statements for all detected chips. This is the same as calling sensors_do_chip_sets with an all wildcards chip name
112
113 \fBconst sensors_chip_name *sensors_get_detected_chips
114                         (int *nr);\fP
115 .br
116 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.
117
118 This structure is used when you want to get all features of a specific chip.
119 .br
120 \fBtypedef struct sensors_feature_data {
121 .br
122   int number;
123 .br
124   const char *name;
125 .br
126   int mapping;
127 .br
128   int unused;
129 .br
130   int mode;
131 .br
132 } sensors_feature_data;\fP
133 .br
134 The mode field can be one of:
135 .br
136 SENSORS_MODE_NO_RW, SENSORS_MODE_R, SENSORS_MODE_W or SENSORS_MODE_RW.
137
138 \fBconst sensors_feature_data *sensors_get_all_features
139       (sensors_chip_name name, int *nr1,int *nr2);\fP
140 .br
141 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). 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.
142
143
144 .SH "CONFORMING TO"
145 lm_sensors-2.x
146 .SH SEE ALSO
147 sensors.conf(5)
148
149 .SH AUTHOR
150 Frodo Looijaard and the lm_sensors group
151 http://www.lm-sensors.org/
152
Note: See TracBrowser for help on using the browser.