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;
37public:
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
53protected:
58 MagnetometerAdaptorNCDK(const QString& id);
59 ~MagnetometerAdaptorNCDK();
60
61 bool setInterval(const int sessionId, const unsigned int interval_us);
62
63private:
64
72 void processSample(int pathId, int fd);
73
74 QByteArray m_powerStateFilePath;
75 QByteArray m_sensAdjFilePath;
76
77 int m_x_adj;
78 int m_y_adj;
79 int m_z_adj;
80 bool m_powerState;
81
82 DeviceAdaptorRingBuffer<CalibratedMagneticFieldData> *m_magnetometerBuffer;
83
84 bool setPowerState(bool value) const;
85 void getSensitivityAdjustment(int &x, int &y, int &z) const;
86
87 int adjustPos(const int value, const int adj) const;
88 int m_intervalCompensation_us;
89 int m_overflowLimit;
90
96 void setOverflowLimit(int limit);
97
103 int overflowLimit() const;
104};
105
106#endif // MAGNETOMETERADAPTOR_NCDK_H
MagnetometerAdaptorNCDK
Definition magnetometeradaptor-ncdk.h:35
MagnetometerAdaptorNCDK::~MagnetometerAdaptorNCDK
~MagnetometerAdaptorNCDK()
MagnetometerAdaptorNCDK::overflowLimit
int overflowLimit
Definition magnetometeradaptor-ncdk.h:39
MagnetometerAdaptorNCDK::startSensor
bool startSensor()
MagnetometerAdaptorNCDK::MagnetometerAdaptorNCDK
MagnetometerAdaptorNCDK(const QString &id)
Constructor.
MagnetometerAdaptorNCDK::factoryMethod
static DeviceAdaptor * factoryMethod(const QString &id)
Factory method for gaining a new instance of MagnetometerAdaptor class.
Definition magnetometeradaptor-ncdk.h:45
MagnetometerAdaptorNCDK::setInterval
bool setInterval(const int sessionId, const unsigned int interval_us)
MagnetometerAdaptorNCDK::stopSensor
void stopSensor()
genericdata.h
Basic datatypes for filters.
orientationdata.h
Datatypes for different filters.