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"
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);
53 
54  bool startSensor();
55  void stopSensor();
56 
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
Adaptor for hybris step counter sensor.
static DeviceAdaptor * factoryMethod(const QString &id)
void processSample(const sensors_event_t &data)
HybrisStepCounterAdaptor(const QString &id)
Datatypes for different filters.