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"
30#include <QTime>
31
42class 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);
52
54 void stopSensor();
55
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
Adaptor for hybris ambient light sensor.
void sendInitialData()
static DeviceAdaptor * factoryMethod(const QString &id)
void processSample(const sensors_event_t &data)
HybrisAlsAdaptor(const QString &id)
Datatypes for different filters.