sensorfw
wakeupsensor.h
Go to the documentation of this file.
1/****************************************************************************
2**
3** Copyright (c) 2025 Jollyboys Ltd.
4**
5** $QT_BEGIN_LICENSE:LGPL$
6**
7** GNU Lesser General Public License Usage
8** Alternatively, this file may be used under the terms of the GNU Lesser
9** General Public License version 2.1 as published by the Free Software
10** Foundation and appearing in the file LICENSE.LGPL included in the
11** packaging of this file. Please review the following information to
12** ensure the GNU Lesser General Public License version 2.1 requirements
13** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
14**
15** $QT_END_LICENSE$
16**
17****************************************************************************/
18
19#ifndef WAKEUP_SENSOR_CHANNEL_H
20#define WAKEUP_SENSOR_CHANNEL_H
21
22#include <QObject>
23
24#include "deviceadaptor.h"
25#include "abstractsensor.h"
26#include "wakeupsensor_a.h"
27#include "dataemitter.h"
29#include "datatypes/unsigned.h"
30
31class Bin;
32template <class TYPE> class BufferReader;
33class FilterBase;
34
40 : public AbstractSensorChannel
41 , public DataEmitter<TimedUnsigned>
42{
43 Q_OBJECT
44 Q_PROPERTY(Unsigned wakeup READ wakeup NOTIFY wakeupChanged)
45
46public:
51 static AbstractSensorChannel *factoryMethod(const QString &id)
52 {
55
56 return sc;
57 }
58
67 Unsigned wakeup() const { return m_previousValue; }
68
69public Q_SLOTS:
70 bool start();
71 bool stop();
72
73signals:
78 void wakeupChanged(const Unsigned &value);
79
80protected:
81 WakeupSensorChannel(const QString &id);
83
84private:
85 TimedUnsigned m_previousValue;
86 Bin *m_filterBin;
87 Bin *m_marshallingBin;
88 DeviceAdaptor *m_wakeupAdaptor;
89 BufferReader<TimedUnsigned> *m_wakeupReader;
90 RingBuffer<TimedUnsigned> *m_outputBuffer;
91
92 void emitData(const TimedUnsigned &value);
93};
94#endif // WAKEUP_SENSOR_CHANNEL_H
Datatype for unsigned integer value with timestamp.
QObject facae for TimedUnsigned.
Definition unsigned.h:37
void wakeupChanged(const Unsigned &value)
Sent when a change in measured data is observed.
Unsigned wakeup() const
Property for accessing the measured value.
virtual ~WakeupSensorChannel()
WakeupSensorChannel(const QString &id)
static AbstractSensorChannel * factoryMethod(const QString &id)
Factory method for WakeupSensorChannel.
Datatype for unsigned values.
QObject based datatype for TimedUnsigned.