Skip to content

Commit

Permalink
fix up a few things in lidsensors
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorn Potter committed Nov 11, 2016
1 parent 9fccc9b commit 79e88d6
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 32 deletions.
1 change: 1 addition & 0 deletions core/core.pro
Expand Up @@ -6,6 +6,7 @@ TARGET = sensorfw
include( ../common-config.pri )

CONFIG += link_pkgconfig
VERSION = 0.9.0

SENSORFW_INCLUDEPATHS = .. \
../include \
Expand Down
1 change: 1 addition & 0 deletions datatypes/liddata.h
Expand Up @@ -62,4 +62,5 @@ class LidData : public TimedData {
TimedData(timestamp), type_(type), value_(0) {}
};

Q_DECLARE_METATYPE(LidData)
#endif // LidData_H
16 changes: 8 additions & 8 deletions qt-api/lidsensor_i.cpp
@@ -1,6 +1,6 @@
/**
@file alssensor_i.cpp
@brief Interface for ALSSensor
@file lidsensor_i.cpp
@brief Interface for LidSensor
<p>
Copyright (C) 2016 Canonical, Ltd.
Expand Down Expand Up @@ -62,15 +62,15 @@ LidSensorChannelInterface* LidSensorChannelInterface::interface(const QString& i

bool LidSensorChannelInterface::dataReceivedImpl()
{
QVector<TimedUnsigned> values;
if (!read<TimedUnsigned>(values))
QVector<LidData> values;
if (!read<LidData>(values))
return false;
foreach(const TimedUnsigned& data, values)
emit LidChanged(data);
foreach(const LidData &data, values)
emit lidChanged(data);
return true;
}

Unsigned LidSensorChannelInterface::closed()
LidData LidSensorChannelInterface::closed()
{
return getAccessor<Unsigned>("closed");
return getAccessor<LidData>("closed");
}
8 changes: 4 additions & 4 deletions qt-api/lidsensor_i.h
Expand Up @@ -28,7 +28,7 @@

#include <QtDBus/QtDBus>

#include "datatypes/unsigned.h"
#include "datatypes/liddata.h"
#include "abstractsensor_i.h"

/**
Expand All @@ -38,7 +38,7 @@ class LidSensorChannelInterface : public AbstractSensorChannelInterface
{
Q_OBJECT
Q_DISABLE_COPY(LidSensorChannelInterface)
Q_PROPERTY(Unsigned closed READ closed)
Q_PROPERTY(LidData closed READ closed)

public:
/**
Expand All @@ -60,7 +60,7 @@ class LidSensorChannelInterface : public AbstractSensorChannelInterface
*
* @return lid reading.
*/
Unsigned closed();
LidData closed();

/**
* Constructor.
Expand Down Expand Up @@ -105,7 +105,7 @@ class LidSensorChannelInterface : public AbstractSensorChannelInterface
*
* @param value ambient light reading.
*/
void LidChanged(const Unsigned& value);
void lidChanged(const LidData& value);
};

namespace local {
Expand Down
2 changes: 1 addition & 1 deletion sensors/humiditysensor/humiditysensor_a.h
@@ -1,5 +1,5 @@
/**
@file alssensor_a.h
@file humiditysensor_a.h
@brief D-Bus adaptor for ALSSensor
<p>
Expand Down
2 changes: 1 addition & 1 deletion sensors/lidsensor/lidplugin.cpp
Expand Up @@ -42,7 +42,7 @@ void LidPlugin::Init(class Loader& l)
}

QStringList LidPlugin::Dependencies() {
return QString("lidsensor").split(":", QString::SkipEmptyParts);
return QString("lidsensoradaptor").split(":", QString::SkipEmptyParts);
}

#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
Expand Down
4 changes: 2 additions & 2 deletions sensors/lidsensor/lidsensor.cpp
@@ -1,6 +1,6 @@
/**
@file alssensor.cpp
@brief ALSSensor
@file lidsensor.cpp
@brief LidSensor
<p>
Copyright (C) 2016 Canonical, Ltd.
Expand Down
4 changes: 2 additions & 2 deletions sensors/lidsensor/lidsensor.h
@@ -1,6 +1,6 @@
/**
@file alssensor.h
@brief ALSSensor
@file lidsensor.h
@brief LidSensor
<p>
Copyright (C) 2016 Canonical, Ltd.
Expand Down
4 changes: 2 additions & 2 deletions sensors/lidsensor/lidsensor_a.cpp
@@ -1,6 +1,6 @@
/**
@file alssensor_a.cpp
@brief D-Bus adaptor for ALSSensor
@file lidsensor_a.cpp
@brief D-Bus adaptor for LidSensor
<p>
Copyright (C) 2016 Canonical, Ltd.
Expand Down
8 changes: 4 additions & 4 deletions sensors/lidsensor/lidsensor_a.h
@@ -1,6 +1,6 @@
/**
@file alssensor_a.h
@brief D-Bus adaptor for ALSSensor
@file lidsensor_a.h
@brief D-Bus adaptor for LidSensor
<p>
Copyright (C) 2016 Canonical, Ltd.
Expand Down Expand Up @@ -36,7 +36,7 @@ class LidSensorChannelAdaptor : public AbstractSensorChannelAdaptor
{
Q_OBJECT
Q_DISABLE_COPY(LidSensorChannelAdaptor)
Q_CLASSINFO("D-Bus Interface", "local.lidsensor")
Q_CLASSINFO("D-Bus Interface", "local.LidSensor")
Q_PROPERTY(Unsigned closed READ closed)

public:
Expand All @@ -46,7 +46,7 @@ public Q_SLOTS:
Unsigned closed() const;

Q_SIGNALS:
void LidChanged(bool value);
void lidChanged(bool value);
};

#endif
4 changes: 2 additions & 2 deletions sensors/pressuresensor/pressuresensor.cpp
@@ -1,6 +1,6 @@
/**
@file alssensor.cpp
@brief ALSSensor
@file pressuresensor.cpp
@brief PressureSensor
<p>
Copyright (C) 2016 Canonical LTD.
Expand Down
4 changes: 2 additions & 2 deletions sensors/pressuresensor/pressuresensor.h
@@ -1,6 +1,6 @@
/**
@file alssensor.h
@brief ALSSensor
@file pressuresensor.h
@brief PressureSensor
<p>
Copyright (C) 2016 Canonical LTD.
Expand Down
4 changes: 2 additions & 2 deletions sensors/pressuresensor/pressuresensor_a.cpp
@@ -1,6 +1,6 @@
/**
@file alssensor_a.cpp
@brief D-Bus adaptor for ALSSensor
@file pressuresensor_a.cpp
@brief D-Bus adaptor for PressureSensor
<p>
Copyright (C) 2016 Canonical LTD.
Expand Down
4 changes: 2 additions & 2 deletions sensors/pressuresensor/pressuresensor_a.h
@@ -1,6 +1,6 @@
/**
@file alssensor_a.h
@brief D-Bus adaptor for ALSSensor
@file pressuresensor_a.h
@brief D-Bus adaptor for PressureSensor
<p>
Copyright (C) 2016 Canonical LTD.
Expand Down

0 comments on commit 79e88d6

Please sign in to comment.