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