sensorfw
hybrisproximityadaptor.h
Go to the documentation of this file.
1/****************************************************************************
2**
3** Copyright (C) 2013 Jolla Ltd
4** Contact: lorn.potter@jollamobile.com
5**
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 HYBRISPROXIMITYADAPTOR_H
22#define HYBRISPROXIMITYADAPTOR_H
23#include "hybrisadaptor.h"
24
25#include <QString>
26#include <QStringList>
27#include <linux/input.h>
28#include "deviceadaptorringbuffer.h"
30#include <QTime>
31
32
41class HybrisProximityAdaptor : public HybrisAdaptor
42{
43 Q_OBJECT
44
45public:
46 static DeviceAdaptor* factoryMethod(const QString& id) {
47 return new HybrisProximityAdaptor(id);
48 }
49 HybrisProximityAdaptor(const QString& id);
51
53 void stopSensor();
54
56
57protected:
58 void processSample(const sensors_event_t& data);
59 void init();
60
61private:
62 DeviceAdaptorRingBuffer<ProximityData>* buffer;
63 int sensorType;
64 int lastNearValue;
65 QByteArray powerStatePath;
66
67};
68#endif
Adaptor for hybris proximity sensor.
void processSample(const sensors_event_t &data)
static DeviceAdaptor * factoryMethod(const QString &id)
HybrisProximityAdaptor(const QString &id)
Datatypes for different filters.