1 .\" $OpenBSD: sensor_attach.9,v 1.4 2007/03/22 16:55:31 deraadt Exp $
2 .\" $DragonFly: src/share/man/man9/sensor_attach.9,v 1.3 2007/10/26 08:22:00 swildner Exp $
4 .\" Copyright (c) 2006 Michael Knudsen <mk@openbsd.org>
5 .\" Copyright (c) 2006 Constantine A. Murenin <cnst+openbsd@bugmail.mojo.ru>
6 .\" All rights reserved.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. The name of the author may not be used to endorse or promote products
15 .\" derived from this software without specific prior written permission.
17 .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
18 .\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
19 .\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
20 .\" THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 .\" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 .\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 .\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 .\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 .Nm sensordev_install ,
35 .Nm sensordev_deinstall ,
36 .Nm sensor_task_register ,
37 .Nm sensor_task_unregister
42 .Fn "sensordev_install" "struct ksensordev *sensdev"
44 .Fn "sensordev_deinstall" "struct ksensordev *sensdev"
46 .Fn "sensor_attach" "struct ksensordev *sensdev" "struct ksensor *sens"
48 .Fn "sensor_detach" "struct ksensordev *sensdev" "struct ksensor *sens"
50 .Fn "sensor_task_register" "void *arg" "void (*func)(void *)" "int period"
52 .Fn "sensor_task_unregister" "void *arg"
56 framework API provides a mechanism for manipulation of hardware sensors
57 that are available under the
64 function adds the sensor specified by the
66 argument to the sensor device specified by the
71 function can be used to remove sensors previously added by
76 function registers the sensor device specified by the
78 argument so that all sensors that are attached to the device become
79 accessible via the sysctl interface.
81 .Fn sensordev_deinstall
82 function can be used to remove sensor devices previously registered by
83 .Fn sensordev_install .
85 Drivers are responsible for retrieving, interpreting and normalising
86 sensor values and updating the sensor struct periodically.
87 If the driver needs process context, for example to sleep, it can
88 register a task with the sensor framework.
91 .Fn sensor_task_register
92 function is used to register a periodic task to update sensors.
95 argument is a pointer to the function to run with an interval of
100 parameter is the argument given to the
104 .Fn sensor_task_unregister
105 function removes all tasks previously registered with
106 .Fn sensor_task_register
112 .Fn sensor_task_register
114 .Fn sensor_task_unregister
115 functions that are included in
118 are not compatible with
121 includes an implementation that is similar and compatible
122 with an earlier version of
125 functions that was available from
130 Drivers that only call
131 .Fn sensor_task_register
132 and do not check its return value are not affected by this
134 compatibility notice.
141 The sensor framework was written by
142 .An Alexander Yurchenko Aq grange@openbsd.org
143 and first appeared in
145 .An David Gwynne Aq dlg@openbsd.org
146 later extended it for
148 .An Constantine A. Murenin Aq cnst+openbsd@bugmail.mojo.ru
149 extended it even further by introducing the concept of sensor devices in
152 The framework was ported to
155 .An Constantine A. Murenin
156 as a Google Summer of Code 2007 project.