sensorfw: adaptors/hybrisstepcounteradaptor/hybrisstepcounteradaptor.h Source File

sensorfw

hybrisstepcounteradaptor.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2013 Jolla Ltd
4 **
5 ** Copyright (C) 2016 kimmoli
6 **
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 **
10 ** GNU Lesser General Public License Usage
11 ** Alternatively, this file may be used under the terms of the GNU Lesser
12 ** General Public License version 2.1 as published by the Free Software
13 ** Foundation and appearing in the file LICENSE.LGPL included in the
14 ** packaging of this file. Please review the following information to
15 ** ensure the GNU Lesser General Public License version 2.1 requirements
16 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17 **
18 ** $QT_END_LICENSE$
19 **
20 ****************************************************************************/
21
22 #ifndef HYBRISSTEPCOUNTERADAPTOR_H
23 #define HYBRISSTEPCOUNTERADAPTOR_H
24 #include "hybrisadaptor.h"
25
26 #include <QString>
27 #include <QStringList>
28 #include <linux/input.h>
29 #include "deviceadaptorringbuffer.h"
30 #include "datatypes/orientationdata.h"
31 #include <QTime>
32
43 class HybrisStepCounterAdaptor : public HybrisAdaptor
44 {
45 Q_OBJECT
46
47 public:
48 static DeviceAdaptor* factoryMethod(const QString& id) {
49 return new HybrisStepCounterAdaptor(id);
50 }
51 HybrisStepCounterAdaptor(const QString& id);
52 ~HybrisStepCounterAdaptor();
53
54 bool startSensor();
55 void stopSensor();
56
57 void sendInitialData();
58
59 protected:
60 void processSample(const sensors_event_t& data);
61 void init();
62
63 private:
64 DeviceAdaptorRingBuffer<TimedUnsigned>* buffer;
65 QByteArray powerStatePath;
66
67 };
68 #endif
HybrisStepCounterAdaptor
Adaptor for hybris step counter sensor.
Definition: hybrisstepcounteradaptor.h:44
HybrisStepCounterAdaptor::factoryMethod
static DeviceAdaptor * factoryMethod(const QString &id)
Definition: hybrisstepcounteradaptor.h:48
HybrisStepCounterAdaptor::processSample
void processSample(const sensors_event_t &data)
HybrisStepCounterAdaptor::init
void init()
HybrisStepCounterAdaptor::~HybrisStepCounterAdaptor
~HybrisStepCounterAdaptor()
HybrisStepCounterAdaptor::sendInitialData
void sendInitialData()
HybrisStepCounterAdaptor::startSensor
bool startSensor()
HybrisStepCounterAdaptor::stopSensor
void stopSensor()
HybrisStepCounterAdaptor::HybrisStepCounterAdaptor
HybrisStepCounterAdaptor(const QString &id)
orientationdata.h
Datatypes for different filters.