sensorfw: adaptors/hybrisalsadaptor/hybrisalsadaptor.h Source File

sensorfw

hybrisalsadaptor.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 HYBRISALSADAPTOR_H
22#define HYBRISALSADAPTOR_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
42 class HybrisAlsAdaptor : public HybrisAdaptor
43{
44 Q_OBJECT
45
46public:
47 static DeviceAdaptor* factoryMethod(const QString& id) {
48 return new HybrisAlsAdaptor(id);
49 }
50 HybrisAlsAdaptor(const QString& id);
51 ~HybrisAlsAdaptor();
52
53 bool startSensor();
54 void stopSensor();
55
56 void sendInitialData();
57
58protected:
59 void processSample(const sensors_event_t& data);
60 void init();
61
62private:
63 DeviceAdaptorRingBuffer<TimedUnsigned>* buffer;
64 unsigned lastLightValue;
65 QByteArray powerStatePath;
66
67};
68#endif
HybrisAlsAdaptor
Adaptor for hybris ambient light sensor.
Definition: hybrisalsadaptor.h:43
HybrisAlsAdaptor::sendInitialData
void sendInitialData()
HybrisAlsAdaptor::startSensor
bool startSensor()
HybrisAlsAdaptor::init
void init()
HybrisAlsAdaptor::factoryMethod
static DeviceAdaptor * factoryMethod(const QString &id)
Definition: hybrisalsadaptor.h:47
HybrisAlsAdaptor::processSample
void processSample(const sensors_event_t &data)
HybrisAlsAdaptor::~HybrisAlsAdaptor
~HybrisAlsAdaptor()
HybrisAlsAdaptor::HybrisAlsAdaptor
HybrisAlsAdaptor(const QString &id)
HybrisAlsAdaptor::stopSensor
void stopSensor()
orientationdata.h
Datatypes for different filters.