sensorfw: adaptors/proximityadaptor-evdev/proximityadaptor-evdev.h Source File

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"
34 #include "datatypes/orientationdata.h"
35
43 class ProximityAdaptorEvdev : public InputDevAdaptor
44 {
45 Q_OBJECT;
46 public:
47 /* Enumerates the possible states for proximity */
48 enum ProximityState {
49 ProximityStateUnknown = -1,
50 ProximityStateOpen = 0,
51 ProximityStateClosed = 1
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();
69 protected:
74 ProximityAdaptorEvdev(const QString& id);
75 ~ProximityAdaptorEvdev();
76
77 private:
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
ProximityAdaptorEvdev
Adaptor for proximity sensor.
Definition: proximityadaptor-evdev.h:44
ProximityAdaptorEvdev::resume
virtual bool resume()
ProximityAdaptorEvdev::~ProximityAdaptorEvdev
~ProximityAdaptorEvdev()
ProximityAdaptorEvdev::ProximityState
ProximityState
Definition: proximityadaptor-evdev.h:48
ProximityAdaptorEvdev::ProximityStateOpen
@ ProximityStateOpen
Proximity open (no target detected)
Definition: proximityadaptor-evdev.h:50
ProximityAdaptorEvdev::ProximityStateUnknown
@ ProximityStateUnknown
Proximity state unknown.
Definition: proximityadaptor-evdev.h:49
ProximityAdaptorEvdev::ProximityStateClosed
@ ProximityStateClosed
Proximity closed (target nearby)
Definition: proximityadaptor-evdev.h:51
ProximityAdaptorEvdev::standby
virtual bool standby()
ProximityAdaptorEvdev::startSensor
virtual bool startSensor()
ProximityAdaptorEvdev::ProximityAdaptorEvdev
ProximityAdaptorEvdev(const QString &id)
Constructor.
ProximityAdaptorEvdev::stopSensor
virtual void stopSensor()
ProximityAdaptorEvdev::factoryMethod
static DeviceAdaptor * factoryMethod(const QString &id)
Factory method for gaining a new instance of ProximityAdaptorEvdev class.
Definition: proximityadaptor-evdev.h:58
orientationdata.h
Datatypes for different filters.