sensorfw: adaptors/hybrisproximityadaptor/hybrisproximityadaptor.h Source File

sensorfw

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