Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
API doc improvements are minor refactoring.
  • Loading branch information
Antti Virtanen committed Mar 23, 2011
1 parent e33d6b7 commit 7733b62
Show file tree
Hide file tree
Showing 17 changed files with 485 additions and 184 deletions.
4 changes: 4 additions & 0 deletions debian/changelog
Expand Up @@ -26,6 +26,10 @@ sensord (0.6.41) unstable; urgency=low
- AbstractSensorChannelInterface improvements
- release() deprecated and errorCodeInt() removed.
- hiding members which were too visible.
- AbstractSensorChannelInterface subclass improvements:
- listenInterface() and controlInterface() are now deprecated.
- marked some old unused features deprecated.
- few more members are hidden which weren't supposed to be visible.
* Downsampling (which works by dropping samples) can be now enabled/disabled.
* OrientationInterpreter filter orientation_buffer_size is now configurable.
* Threshold accessors removed from OrientationFilter since those had no effect.
Expand Down
2 changes: 1 addition & 1 deletion doc/Doxyfile
Expand Up @@ -137,7 +137,7 @@ SHORT_NAMES = NO
# comments will behave just like regular Qt-style comments
# (thus requiring an explicit @brief command for a brief description.)

JAVADOC_AUTOBRIEF = NO
JAVADOC_AUTOBRIEF = YES

# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
# interpret the first line (until the first dot) of a Qt-style
Expand Down
41 changes: 26 additions & 15 deletions qt-api/accelerometersensor_i.h
Expand Up @@ -33,14 +33,9 @@
#include <datatypes/xyz.h>

/**
* @brief DBus-interface for accessing raw accelerometer values.
*
* AccelerometerSensorChannelInterface acts as a proxy class for interface
* \e local.AccelerometerSensor.
*
* For details of measurement process, see #AccelerometerSensorChannel.
* Client interface for accessing accelerometer sensor.
*/
class AccelerometerSensorChannelInterface: public AbstractSensorChannelInterface
class AccelerometerSensorChannelInterface : public AbstractSensorChannelInterface
{
Q_OBJECT
Q_DISABLE_COPY(AccelerometerSensorChannelInterface)
Expand All @@ -53,37 +48,51 @@ class AccelerometerSensorChannelInterface: public AbstractSensorChannelInterface
static const char* staticInterfaceName;

/**
* Get an instance of the class.
* Create new instance of the class.
*
* @param id Sensor ID.
* @param sessionId Session ID.
* @return Pointer to new instance of the class.
*/
static AbstractSensorChannelInterface* factoryMethod(const QString& id, int sessionId);

/**
* Get latest accelerometer reading from sensor daemon.
*
* @return accelerometer reading.
*/
XYZ get();

/**
* Constructor.
*
* @param path path.
* @param sessionId session id.
* @param sessionId session ID.
*/
AccelerometerSensorChannelInterface(const QString& path, int sessionId);

/**
* Request a listening interface to the sensor.
* @param id Identifier string for the sensor.
*
* @param id sensor ID.
* @return Pointer to interface, or NULL on failure.
* @deprecated use #interface(const QString&) instead.
*/
static const AccelerometerSensorChannelInterface* listenInterface(const QString& id);

/**
* Request a control interface to the sensor.
* @param id Identifier string for the sensor.
*
* @param id sensor ID.
* @return Pointer to interface, or NULL on failure.
* @deprecated use #interface(const QString&) instead.
*/
static AccelerometerSensorChannelInterface* controlInterface(const QString& id);

/**
* Request a interface to the sensor.
* @param id Identifier string for the sensor.
* Request an interface to the sensor.
*
* @param id sensor ID.
* @return Pointer to interface, or NULL on failure.
*/
static AccelerometerSensorChannelInterface* interface(const QString& id);
Expand All @@ -93,11 +102,12 @@ class AccelerometerSensorChannelInterface: public AbstractSensorChannelInterface
virtual bool dataReceivedImpl();

private:
bool frameAvailableConnected;
bool frameAvailableConnected; /**< has applicaiton connected slot for frameAvailable signal. */

Q_SIGNALS: // SIGNALS
Q_SIGNALS:
/**
* Sent when new measurement data has become available.
*
* @param data New measurement data.
*/
void dataAvailable(const XYZ& data);
Expand All @@ -106,6 +116,7 @@ class AccelerometerSensorChannelInterface: public AbstractSensorChannelInterface
* Sent when new measurement frame has become available.
* If app doesn't connect to this signal content of frames
* will be sent through dataAvailable signal.
*
* @param frame New measurement frame.
*/
void frameAvailable(const QVector<XYZ>& frame);
Expand Down
53 changes: 38 additions & 15 deletions qt-api/alssensor_i.h
Expand Up @@ -33,58 +33,81 @@
#include "abstractsensor_i.h"

/**
* @brief DBus-interface for accessing ambient light sensor measurements.
*
* ALSSensorChannelInterface acts as proxy class for interface \c local.ALSSensor.
* Provides signal on change of measured ambient light intensity level. Previous
* measured intensity level can be queried any time. Provided values are in \e lux.
*
* For details of measurement process, see #ALSSensorChannel.
* Client interface for accessing ambient light sensor.
* Provides signal on change of measured ambient light intensity level.
* Previous measured intensity level can be queried any time. Provided
* values are in \e lux.
*/
class ALSSensorChannelInterface: public AbstractSensorChannelInterface
class ALSSensorChannelInterface : public AbstractSensorChannelInterface
{
Q_OBJECT
Q_DISABLE_COPY(ALSSensorChannelInterface)
Q_PROPERTY(Unsigned lux READ lux)

public:
/**
* Name of the D-Bus interface for this class.
*/
static const char* staticInterfaceName;

/**
* Create new instance of the class.
*
* @param id Sensor ID.
* @param sessionId Session ID.
* @return Pointer to new instance of the class.
*/
static AbstractSensorChannelInterface* factoryMethod(const QString& id, int sessionId);

/**
* Get latest ambient light reading from sensor daemon.
*
* @return ambient light reading.
*/
Unsigned lux();

public:
/**
* Constructor.
*
* @param path path.
* @param sessionId session ID.
*/
ALSSensorChannelInterface(const QString& path, int sessionId);

/**
* Request a listening interface to the sensor.
* @param id Identifier string for the sensor.
*
* @param id sensor ID.
* @return Pointer to interface, or NULL on failure.
* @deprecated use #interface(const QString&) instead.
*/
static const ALSSensorChannelInterface* listenInterface(const QString& id);

/**
* Request a control interface to the sensor.
* @param id Identifier string for the sensor.
*
* @param id sensor ID.
* @return Pointer to interface, or NULL on failure.
* @deprecated use #interface(const QString&) instead.
*/
static ALSSensorChannelInterface* controlInterface(const QString& id);

/**
* Request a interface to the sensor.
* @param id Identifier string for the sensor.
* Request an interface to the sensor.
*
* @param id sensor ID.
* @return Pointer to interface, or NULL on failure.
*/
static ALSSensorChannelInterface* interface(const QString& id);

protected:
virtual bool dataReceivedImpl();

Q_SIGNALS: // SIGNALS
Q_SIGNALS:
/**
* Sent when measured ambient light intensity has changed.
* @param value Observed ambient light intensity.
*
* @param value ambient light reading.
*/
void ALSChanged(const Unsigned& value);
};
Expand Down
65 changes: 53 additions & 12 deletions qt-api/compasssensor_i.h
Expand Up @@ -30,17 +30,12 @@
#include <QtDBus/QtDBus>

#include "abstractsensor_i.h"
#include <datatypes/orientationdata.h>
#include <datatypes/compass.h>

/**
* @brief DBus-interface for logical compass sensor using internal sensors.
*
* Acts as a proxy class \e local.CompassSensor interface.
*
* For details of measurement process, see #CompassSensorChannel.
* Client interface for accessing compass sensor.
*/
class CompassSensorChannelInterface: public AbstractSensorChannelInterface
class CompassSensorChannelInterface : public AbstractSensorChannelInterface
{
Q_OBJECT
Q_DISABLE_COPY(CompassSensorChannelInterface)
Expand All @@ -49,47 +44,93 @@ class CompassSensorChannelInterface: public AbstractSensorChannelInterface
Q_PROPERTY(int declinationvalue READ declinationValue)

public:
/**
* Name of the D-Bus interface for this class.
*/
static const char* staticInterfaceName;

/**
* Create new instance of the class.
*
* @param id Sensor ID.
* @param sessionId Session ID.
* @return Pointer to new instance of the class.
*/
static AbstractSensorChannelInterface* factoryMethod(const QString& id, int sessionId);

/**
* Get latest compass reading from sensor daemon.
*
* @return compass reading.
*/
Compass get();

/**
* Returns whether the sensor is applying declination correction to the
* output value and returning <i>true north</i>, or not applying it and
* returning <i>magnetic north</i>.
*
* @return True if decliation correction is applied, false otherwise
*/
bool useDeclination();

/**
* Sets whether the declination correction should be applied or not.
*
* @param enable If true, declination correction will be applied,
* if false, it will not be applied
*/
void setUseDeclination(bool enable);

/**
* Returns the currently used declination correction value.
*
* @return Current declination value
*/
int declinationValue();

/**
* Constructor.
*
* @param path path.
* @param sessionId session ID.
*/
CompassSensorChannelInterface(const QString& path, int sessionId);

/**
* Request a listening interface to the sensor.
* @param id Identifier string for the sensor.
*
* @param id sensor ID.
* @return Pointer to interface, or NULL on failure.
* @deprecated use #interface(const QString&) instead.
*/
static const CompassSensorChannelInterface* listenInterface(const QString& id);

/**
* Request a control interface to the sensor.
* @param id Identifier string for the sensor.
*
* @param id sensor ID.
* @return Pointer to interface, or NULL on failure.
* @deprecated use #interface(const QString&) instead.
*/
static CompassSensorChannelInterface* controlInterface(const QString& id);

/**
* Request a interface to the sensor.
* @param id Identifier string for the sensor.
* Request an interface to the sensor.
*
* @param id sensor ID.
* @return Pointer to interface, or NULL on failure.
*/
static CompassSensorChannelInterface* interface(const QString& id);

protected:
virtual bool dataReceivedImpl();

Q_SIGNALS: // SIGNALS
Q_SIGNALS:

/**
* Sent when compass direction or calibration level has changed.
*
* @param value Current compass measurement.
*/
void dataAvailable(const Compass& value);
Expand Down
5 changes: 0 additions & 5 deletions qt-api/gyroscopesensor_i.cpp
Expand Up @@ -91,11 +91,6 @@ void GyroscopeSensorChannelInterface::connectNotify(const char* signal)
dbusConnectNotify(signal);
}

QDBusReply<void> GyroscopeSensorChannelInterface::reset()
{
return call(QDBus::Block, QLatin1String("reset"));
}

XYZ GyroscopeSensorChannelInterface::get()
{
return getAccessor<AngularVelocityData>("value");
Expand Down

0 comments on commit 7733b62

Please sign in to comment.