sensorfw
proximityadaptor-evdev.h
Go to the documentation of this file.
1
29#ifndef PROXIMITYADAPTOR_EVDEV_H
30#define PROXIMITYADAPTOR_EVDEV_H
31
32#include "inputdevadaptor.h"
33#include "deviceadaptorringbuffer.h"
35
43class ProximityAdaptorEvdev : public InputDevAdaptor
44{
45 Q_OBJECT;
46public:
47 /* Enumerates the possible states for proximity */
52 };
53
58 static DeviceAdaptor* factoryMethod(const QString& id)
59 {
60 return new ProximityAdaptorEvdev(id);
61 }
62 virtual bool startSensor();
63
64 virtual void stopSensor();
65
66 virtual bool standby();
67
68 virtual bool resume();
69protected:
74 ProximityAdaptorEvdev(const QString& id);
76
77private:
78
79 DeviceAdaptorRingBuffer<ProximityData>* proximityBuffer_;
80 ProximityState currentState_;
81
82 void interpretEvent(int src, struct input_event *ev);
83 void commitOutput(struct input_event *ev);
84 void interpretSync(int src, struct input_event *ev);
85 QByteArray powerStatePath_;
86};
87
88#endif
Adaptor for proximity sensor.
virtual bool resume()
@ ProximityStateOpen
Proximity open (no target detected)
@ ProximityStateUnknown
Proximity state unknown.
@ ProximityStateClosed
Proximity closed (target nearby)
static DeviceAdaptor * factoryMethod(const QString &id)
Factory method for gaining a new instance of ProximityAdaptorEvdev class.
virtual bool standby()
virtual bool startSensor()
ProximityAdaptorEvdev(const QString &id)
Constructor.
virtual void stopSensor()
Datatypes for different filters.