sensorfw
lidsensoradaptor-evdev.h
Go to the documentation of this file.
1 
26 #ifndef LIDADAPTOR_EVDEV_H
27 #define LIDADAPTOR_EVDEV_H
28 
29 #include "inputdevadaptor.h"
30 #include "deviceadaptorringbuffer.h"
31 #include "datatypes/liddata.h"
32 
40 class LidSensorAdaptorEvdev : public InputDevAdaptor
41 {
42  Q_OBJECT
43 public:
44 // /* Enumerates the possible states for proximity */
45 // enum ProximityState {
46 // ProximityStateUnknown = -1, /**< Proximity state unknown */
47 // ProximityStateOpen = 0, /**< Proximity open (no target detected)*/
48 // ProximityStateClosed = 1 /**< Proximity closed (target nearby)*/
49 // };
50 
55  static DeviceAdaptor* factoryMethod(const QString& id)
56  {
57  return new LidSensorAdaptorEvdev(id);
58  }
59  virtual bool startSensor();
60 
61  virtual void stopSensor();
62 
63  virtual bool standby();
64 
65  virtual bool resume();
66  virtual void init();
67 protected:
72  LidSensorAdaptorEvdev(const QString& id);
74 
75 private:
76 
77  DeviceAdaptorRingBuffer<LidData> *lidBuffer_;
78  LidData::Type currentType_;
79  LidData::Type lastType;
80  qreal currentValue_;
81  qreal lastValue;
82  bool usingFront;
83 
84  void interpretEvent(int src, struct input_event *ev);
85  void commitOutput(struct input_event *ev);
86  void interpretSync(int src, struct input_event *ev);
87  QByteArray powerStatePath_;
88 };
89 
90 #endif
Type
Type of lid.
Definition: liddata.h:42
Adaptor for lid sensor.
virtual bool standby()
static DeviceAdaptor * factoryMethod(const QString &id)
Factory method for gaining a new instance of LidsensorAdaptorEvdev class.
virtual void init()
virtual bool startSensor()
virtual bool resume()
LidSensorAdaptorEvdev(const QString &id)
Constructor.
virtual void stopSensor()
Datatype for device tap events.