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** 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"
29#include "datatypes/orientationdata.h"
30#include <QTime>
31
32
41 class 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);
50 ~HybrisProximityAdaptor();
51
52 bool startSensor();
53 void stopSensor();
54
55 void sendInitialData();
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
HybrisProximityAdaptor
Adaptor for hybris proximity sensor.
Definition: hybrisproximityadaptor.h:42
HybrisProximityAdaptor::sendInitialData
void sendInitialData()
HybrisProximityAdaptor::processSample
void processSample(const sensors_event_t &data)
HybrisProximityAdaptor::factoryMethod
static DeviceAdaptor * factoryMethod(const QString &id)
Definition: hybrisproximityadaptor.h:46
HybrisProximityAdaptor::stopSensor
void stopSensor()
HybrisProximityAdaptor::HybrisProximityAdaptor
HybrisProximityAdaptor(const QString &id)
HybrisProximityAdaptor::startSensor
bool startSensor()
HybrisProximityAdaptor::init
void init()
HybrisProximityAdaptor::~HybrisProximityAdaptor
~HybrisProximityAdaptor()
orientationdata.h
Datatypes for different filters.