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