sensorfw
pressureadaptor.h
Go to the documentation of this file.
1 
25 #ifndef PRESSUREADAPTOR_H
26 #define PRESSUREADAPTOR_H
27 
28 #include "inputdevadaptor.h"
29 #include "deviceadaptorringbuffer.h"
31 #include <QTime>
32 
33 class PressureAdaptor : public InputDevAdaptor
34 {
35  Q_OBJECT
36 public:
41  static DeviceAdaptor* factoryMethod(const QString& id)
42  {
43  return new PressureAdaptor(id);
44  }
45 
46  virtual bool startSensor();
47 
48  virtual void stopSensor();
49 
50  virtual bool standby();
51 
52  virtual bool resume();
53 
54 protected:
59  PressureAdaptor(const QString& id);
61 
65  virtual unsigned int evaluateIntervalRequests(int& sessionId) const;
66 
67 private:
68  DeviceAdaptorRingBuffer<TimedUnsigned>* pressureBuffer_;
69 
70  unsigned pressureValue_;
71 
72  void interpretEvent(int src, struct input_event *ev);
73  void commitOutput(struct input_event *ev);
74  void interpretSync(int src, struct input_event *ev);
75  QByteArray powerStatePath_;
76 
77 };
78 
79 #endif
virtual bool standby()
virtual bool startSensor()
virtual void stopSensor()
virtual bool resume()
static DeviceAdaptor * factoryMethod(const QString &id)
Factory method for gaining a new instance of AccelerometerAdaptor class.
PressureAdaptor(const QString &id)
Constructor.
virtual unsigned int evaluateIntervalRequests(int &sessionId) const
Reimplement to allow for 0 interval to be the slowest entry.
Datatypes for different filters.