OSDN Git Service

libsensors: Added support for Proximity sensor
[android-x86/hardware-intel-libsensors.git] / README.txt
1 = How to add/config a new board =
2
3         Look into vendor/intel/<board>/libsensors for inspiration/templates.
4 BUT don't just copy paste without understanding what you are doing. The idea
5 is to select the necessary sensors via sensor headers, fill in the sensor list
6 with each sensor's sSensorInfo, instantiate sensors in initSensors and map id's
7 in handleToDriver.
8
9 = How to add a new Sensor implementation =
10
11         What type of sensor driver are you using?
12
13 - Input device? Use SensorInputDev. The advantage of using this class is that
14 the readEvents loop exists already, only processEvent must be implemented
15 for that pourpouse. Of course, if you need a special kind of readEvents loop,
16 it can be re-implemented.
17
18 - Basic char device? use SensorCharDev. You are on your own here regarding
19 readEvent.
20
21 - Something else? This means you are using some other type of driver and a
22 new Sensor<Type>Dev class must be implementad first and then the sensor
23 implementation must inherit from that.
24
25 = Do's & Don'ts =
26
27 - For sensor implementations, don't inherit from SensorBase class directly.
28 - Don't copy paste code without understanding what it does.
29 - Do use references instead of pointers as much as possible.
30 - Do use std::string's instead of C strings. It avoids many extra dubious
31 operations.
32 - Don't use streams on sysfs entries. Streams can do impartial writes and mess
33 up the sysfs data.