sensorfw: adaptors/magnetometeradaptor-ncdk/magnetometeradaptor-ncdk.h Source File

sensorfw

magnetometeradaptor-ncdk.h
Go to the documentation of this file.
1
25 #ifndef MAGNETOMETERADAPTOR_NCDK_H
26 #define MAGNETOMETERADAPTOR_NCDK_H
27
28 #include "sysfsadaptor.h"
29 #include "deviceadaptorringbuffer.h"
30 #include "datatypes/genericdata.h"
31 #include <QString>
32 #include "datatypes/orientationdata.h"
33
34 class MagnetometerAdaptorNCDK : public SysfsAdaptor
35 {
36 Q_OBJECT;
37 public:
38
39 Q_PROPERTY(int overflowLimit READ overflowLimit WRITE setOverflowLimit);
40
45 static DeviceAdaptor* factoryMethod(const QString& id)
46 {
47 return new MagnetometerAdaptorNCDK(id);
48 }
49
50 bool startSensor();
51 void stopSensor();
52
53 protected:
58 MagnetometerAdaptorNCDK(const QString& id);
59 ~MagnetometerAdaptorNCDK();
60
61 bool setInterval(const unsigned int value, const int sessionId);
62
63 private:
64
72 void processSample(int pathId, int fd);
73
74 QByteArray powerStateFilePath_;
75 QByteArray sensAdjFilePath_;
76
77 int x_adj, y_adj, z_adj;
78 bool powerState_;
79 DeviceAdaptorRingBuffer<CalibratedMagneticFieldData>* magnetometerBuffer_;
80
81 bool setPowerState(bool value) const;
82 void getSensitivityAdjustment(int &x, int &y, int &z) const;
83 int adjustPos(const int value, const int adj) const;
84 int intervalCompensation_;
85 int overflowLimit_;
86
92 void setOverflowLimit(int limit);
93
99 int overflowLimit() const;
100 };
101
102 #endif // MAGNETOMETERADAPTOR_NCDK_H
MagnetometerAdaptorNCDK
Definition: magnetometeradaptor-ncdk.h:35
MagnetometerAdaptorNCDK::~MagnetometerAdaptorNCDK
~MagnetometerAdaptorNCDK()
MagnetometerAdaptorNCDK::setInterval
bool setInterval(const unsigned int value, const int sessionId)
MagnetometerAdaptorNCDK::overflowLimit
int overflowLimit
Definition: magnetometeradaptor-ncdk.h:36
MagnetometerAdaptorNCDK::factoryMethod
static DeviceAdaptor * factoryMethod(const QString &id)
Factory method for gaining a new instance of MagnetometerAdaptor class.
Definition: magnetometeradaptor-ncdk.h:45
MagnetometerAdaptorNCDK::startSensor
bool startSensor()
MagnetometerAdaptorNCDK::MagnetometerAdaptorNCDK
MagnetometerAdaptorNCDK(const QString &id)
Constructor.
MagnetometerAdaptorNCDK::stopSensor
void stopSensor()
genericdata.h
Basic datatypes for filters.
orientationdata.h
Datatypes for different filters.