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