sensorfw: adaptors/accelerometeradaptor/accelerometeradaptor.h Source File

sensorfw

accelerometeradaptor.h
Go to the documentation of this file.
1
28#ifndef ACCELEROMETERADAPTOR_H
29#define ACCELEROMETERADAPTOR_H
30
31#include "inputdevadaptor.h"
32#include "deviceadaptorringbuffer.h"
33#include "datatypes/orientationdata.h"
34
46 class AccelerometerAdaptor : public InputDevAdaptor
47{
48 Q_OBJECT;
49public:
54 static DeviceAdaptor* factoryMethod(const QString& id)
55 {
56 return new AccelerometerAdaptor(id);
57 }
58
59 virtual bool startSensor();
60
61 virtual void stopSensor();
62 virtual bool standby();
63 virtual bool resume();
64
65protected:
70 AccelerometerAdaptor(const QString& id);
71 ~AccelerometerAdaptor();
72
73private:
74 DeviceAdaptorRingBuffer<AccelerationData>* accelerometerBuffer_;
75 AccelerationData orientationValue_;
76
77 void interpretEvent(int src, struct input_event *ev);
78 void commitOutput(struct input_event *ev);
79 void interpretSync(int src, struct input_event *ev);
80 QByteArray powerStatePath_;
81 qreal accelMultiplier;
82};
83
84#endif
AccelerometerAdaptor
Adaptor for internal accelerometer.
Definition accelerometeradaptor.h:47
AccelerometerAdaptor::resume
virtual bool resume()
AccelerometerAdaptor::startSensor
virtual bool startSensor()
AccelerometerAdaptor::factoryMethod
static DeviceAdaptor * factoryMethod(const QString &id)
Factory method for gaining a new instance of AccelerometerAdaptor class.
Definition accelerometeradaptor.h:54
AccelerometerAdaptor::~AccelerometerAdaptor
~AccelerometerAdaptor()
AccelerometerAdaptor::standby
virtual bool standby()
AccelerometerAdaptor::AccelerometerAdaptor
AccelerometerAdaptor(const QString &id)
Constructor.
AccelerometerAdaptor::stopSensor
virtual void stopSensor()
TimedXyzData
Class for vector type measurement data (timestamp, x, y, z).
Definition genericdata.h:53
orientationdata.h
Datatypes for different filters.