sensorfw: adaptors/proximityadaptor/proximityadaptor.h Source File

sensorfw

proximityadaptor.h
Go to the documentation of this file.
1
29#ifndef PROXIMITYADAPTOR_H
30#define PROXIMITYADAPTOR_H
31
32#include <QDBusInterface>
33#include "sysfsadaptor.h"
34#include "deviceadaptorringbuffer.h"
35#include "datatypes/orientationdata.h"
36
37#ifdef SENSORFW_MCE_WATCHER
38// these come from mce/mode-names.h
39// and mce/dbus-names.h
40#define MCE_SERVICE "com.nokia.mce"
41#define MCE_REQUEST_PATH "/com/nokia/mce/request"
42#define MCE_REQUEST_IF "com.nokia.mce.request"
43#endif
44
52 class ProximityAdaptor : public SysfsAdaptor
53{
54 Q_OBJECT;
55public:
56
57 enum DeviceType
58 {
59 DeviceUnknown = 0,
60 RM680,
61 RM696,
62 NCDK
63 };
64
69 static DeviceAdaptor* factoryMethod(const QString& id)
70 {
71 return new ProximityAdaptor(id);
72 }
73
74 virtual bool startSensor();
75
76 virtual void stopSensor();
77
78protected:
83 ProximityAdaptor(const QString& id);
84 ~ProximityAdaptor();
85
86private:
87 DeviceAdaptorRingBuffer<ProximityData>* proximityBuffer_;
88
96 void processSample(int pathId, int fd);
97
98 int threshold_;
99 ProximityAdaptor::DeviceType deviceType_;
100 QByteArray powerStatePath_;
101};
102
103#endif
ProximityAdaptor
Adaptor for proximity sensor.
Definition proximityadaptor.h:53
ProximityAdaptor::ProximityAdaptor
ProximityAdaptor(const QString &id)
Constructor.
ProximityAdaptor::DeviceType
DeviceType
Definition proximityadaptor.h:58
ProximityAdaptor::RM680
@ RM680
Definition proximityadaptor.h:60
ProximityAdaptor::DeviceUnknown
@ DeviceUnknown
Definition proximityadaptor.h:59
ProximityAdaptor::NCDK
@ NCDK
Definition proximityadaptor.h:62
ProximityAdaptor::RM696
@ RM696
Definition proximityadaptor.h:61
ProximityAdaptor::factoryMethod
static DeviceAdaptor * factoryMethod(const QString &id)
Factory method for gaining a new instance of ProximityAdaptor class.
Definition proximityadaptor.h:69
ProximityAdaptor::startSensor
virtual bool startSensor()
ProximityAdaptor::~ProximityAdaptor
~ProximityAdaptor()
ProximityAdaptor::stopSensor
virtual void stopSensor()
orientationdata.h
Datatypes for different filters.