sensorfw
AbstractSensorChannelInterface Class Reference

Base-class for client facades of different sensor types. More...

#include <abstractsensor_i.h>

Inheritance diagram for AbstractSensorChannelInterface:
AccelerometerSensorChannelInterface ALSSensorChannelInterface CompassSensorChannelInterface GyroscopeSensorChannelInterface MagnetometerSensorChannelInterface OrientationSensorChannelInterface ProximitySensorChannelInterface RotationSensorChannelInterface TapSensorChannelInterface

List of all members.

Public Member Functions

virtual ~AbstractSensorChannelInterface ()
 Destructor.
bool release ()
 Release the sensor instance.
int sessionId () const
 Get ID of the current session.
SensorError errorCode ()
 Get error code of occured local or remote error.
QString errorString ()
 Get error description of occured local or remote error.
QString description ()
 Get description of the sensor.
QString id ()
 Get ID of the sensor.
int interval ()
 Get used sensor sampling interval (in millisecs).
void setInterval (int value)
 Set sensor sampling interval (in millisecs).
bool standbyOverride ()
 Is standby-override enabled or not.
bool setStandbyOverride (bool override)
 Enable or disable standby-override.
unsigned int bufferInterval ()
 Used buffer interval.
void setBufferInterval (unsigned int value)
 Set buffer interval.
bool downsampling ()
 Is downsampling enabled or not.
bool setDownsampling (bool value)
 Enable or disable downsampling.
IntegerRangeList getAvailableBufferIntervals ()
 Returns list of available buffer interval ranges.
unsigned int bufferSize ()
 Get used buffer size.
void setBufferSize (unsigned int value)
 Set buffer size.
IntegerRangeList getAvailableBufferSizes ()
 Returns list of available buffer sizes.
QString type ()
 Textual description about sensor type.
virtual QDBusReply< void > start ()
 Start sensor.
virtual QDBusReply< void > stop ()
 Stop sensor.
DataRangeList getAvailableIntervals ()
 Get the list of available intervals ranges for the sensor.
DataRangeList getAvailableDataRanges ()
 Get the list of available data ranges for the sensor.
DataRange getCurrentDataRange ()
 Get current used data range.
void requestDataRange (DataRange range)
 Request data range.
void removeDataRangeRequest ()
 Remove set data range request.
bool setDataRangeIndex (int dataRangeIndex)
 Request data range by using index which points to the list returned by getAvailableDataRanges().
bool hwBuffering ()
 Does the sensor driver support buffering or not.
bool isValid () const
 Does the current instance have valid connection established to sensor daemon.

Protected Member Functions

 AbstractSensorChannelInterface (const QString &path, const char *interfaceName, int sessionId)
 Constructor.
bool read (void *buffer, int size)
 Read data from socket into buffer.
template<typename T >
bool read (QVector< T > &values)
 Read data from socket into passed container.
virtual bool dataReceivedImpl ()=0
 Callback for subclasses in which they must read their expected data from socket.
template<typename T >
getAccessor (const char *name)
 Utility for calling DBus methods from current connection which return value and take no args.
template<typename T >
void setAccessor (const char *name, const T &value)
 Utility for calling DBus methods from current connection which return nothing and take one arg.
QDBusMessage call (QDBus::CallMode mode, const QString &method, const QVariant &arg1=QVariant(), const QVariant &arg2=QVariant(), const QVariant &arg3=QVariant(), const QVariant &arg4=QVariant(), const QVariant &arg5=QVariant(), const QVariant &arg6=QVariant(), const QVariant &arg7=QVariant(), const QVariant &arg8=QVariant())
 Wrapper for function of QDBusAbstractInterface.
QDBusMessage callWithArgumentList (QDBus::CallMode mode, const QString &method, const QList< QVariant > &args)
 Wrapper for function of QDBusAbstractInterface.
void dbusConnectNotify (const char *signal)
 Wrapper for function of QDBusAbstractInterface.

Properties

int sessionId
SensorError errorCode
QString errorString
QString description
QString id
int interval
bool standbyOverride
QString type
unsigned int
bool hwBuffering
bool downsampling

Detailed Description

Base-class for client facades of different sensor types.

Definition at line 45 of file abstractsensor_i.h.


Constructor & Destructor Documentation

AbstractSensorChannelInterface::AbstractSensorChannelInterface ( const QString &  path,
const char *  interfaceName,
int  sessionId 
) [protected]

Constructor.

Parameters:
pathDBus object path.
interfaceNameDBus object name.
sessionIdSession ID.

Member Function Documentation

Used buffer interval.

Buffer interval defines the timeout for buffered data to be flushed unless the buffer is filled before it.

Returns:
interval in millisecs.

Get used buffer size.

Buffer size is used to control how many samples are collected before signaling application about them.

Returns:
used buffer size.
QDBusMessage AbstractSensorChannelInterface::call ( QDBus::CallMode  mode,
const QString &  method,
const QVariant &  arg1 = QVariant(),
const QVariant &  arg2 = QVariant(),
const QVariant &  arg3 = QVariant(),
const QVariant &  arg4 = QVariant(),
const QVariant &  arg5 = QVariant(),
const QVariant &  arg6 = QVariant(),
const QVariant &  arg7 = QVariant(),
const QVariant &  arg8 = QVariant() 
) [protected]

Wrapper for function of QDBusAbstractInterface.

For more details see QDBusAbstractInterface docs.

QDBusMessage AbstractSensorChannelInterface::callWithArgumentList ( QDBus::CallMode  mode,
const QString &  method,
const QList< QVariant > &  args 
) [protected]

Wrapper for function of QDBusAbstractInterface.

For more details see QDBusAbstractInterface docs.

void AbstractSensorChannelInterface::dbusConnectNotify ( const char *  signal) [protected]

Wrapper for function of QDBusAbstractInterface.

For more details see QDBusAbstractInterface docs.

Get description of the sensor.

Returns:
description of the sensor.

Is downsampling enabled or not.

Downsampling is used to fit requested measurement interval setInterval(int) to effective interval.

Returns:
downsampling state.

Get error code of occured local or remote error.

Returns:
error code.

Get error description of occured local or remote error.

Returns:
error description.
template<typename T >
T AbstractSensorChannelInterface::getAccessor ( const char *  name) [protected]

Utility for calling DBus methods from current connection which return value and take no args.

Template Parameters:
returntype.
Parameters:
namemethod name.
Returns:
called method return value.

Definition at line 481 of file abstractsensor_i.h.

Returns list of available buffer interval ranges.

Returns:
The list of supported buffer interval ranges.

Returns list of available buffer sizes.

The list is ordered by efficiency of the size.

Returns:
The list of supported buffer sizes ordered by efficiency.

Get the list of available data ranges for the sensor.

Returns:
List of available data ranges.

Get the list of available intervals ranges for the sensor.

Returns:
List of available intervals ranges.

Get current used data range.

Returns:
currently used data range.

Does the sensor driver support buffering or not.

Returns:
Does the sensor driver support buffering or not.

Get ID of the sensor.

Returns:
ID of the sensor.

Get used sensor sampling interval (in millisecs).

If sensor has been started (by start()) effective interval is returned.

Returns:
used sampling interval (in millisecs)

Does the current instance have valid connection established to sensor daemon.

Returns:
is the established connection valid.
bool AbstractSensorChannelInterface::read ( void *  buffer,
int  size 
) [protected]

Read data from socket into buffer.

Parameters:
bufferPointer to buffer where to write.
sizeNumber of bytes to read.
template<typename T >
bool AbstractSensorChannelInterface::read ( QVector< T > &  values) [protected]

Read data from socket into passed container.

Template Parameters:
Typeto which to convert raw data.
Parameters:
valuesContainer for data.
Returns:
was read successful.

Definition at line 475 of file abstractsensor_i.h.

Release the sensor instance.

Returns:
true always.
Deprecated:
Session lifecycle ends by destructing this object.

Remove set data range request.

Request data range.

Usable ranges are listed by getAvailableDataRanges().

Parameters:
rangerequested range.

Get ID of the current session.

Returns:
current session ID.
template<typename T >
void AbstractSensorChannelInterface::setAccessor ( const char *  name,
const T &  value 
) [protected]

Utility for calling DBus methods from current connection which return nothing and take one arg.

Template Parameters:
argumenttype.
Parameters:
namemethod name.
valuemethod argument.

Definition at line 493 of file abstractsensor_i.h.

Set buffer interval.

Buffer interval defines the timeout for buffered data to be flushed unless the buffer is filled before it. Supported intervals are listed by getAvailableBufferIntervals().

Parameters:
valueinterval in millisecs.

Set buffer size.

Buffer size is used to control how many samples are collected before signaling application about them.

Parameters:
valuebuffer size.

Request data range by using index which points to the list returned by getAvailableDataRanges().

Parameters:
dataRangeIndexrequeted data range index.
Returns:
false if given index is invalid.

Enable or disable downsampling.

Downsampling is used to fit requested measurement interval setInterval(int) to effective interval. Not all sensors support downsampling so the call will fail for those.

Parameters:
valueenable or disable downsampling.
Returns:
was downsampling state succesfully changed.

Set sensor sampling interval (in millisecs).

Value "0" will clear previously set interval. Supported intervals are listed by getAvailableIntervals().

Parameters:
valuesampling interval (in millisecs).

Enable or disable standby-override.

Standby-override is used to keep sensor enabled when display is blanked.

Parameters:
overridestandby-override state
Returns:
true if succesfully set.

Is standby-override enabled or not.

Standby-override is used to keep sensor enabled when display is blanked.

Returns:
enabled or not.
virtual QDBusReply<void> AbstractSensorChannelInterface::start ( ) [virtual]

Start sensor.

This will cause necessary resources to be acquired so the sensor readings can be received.

Returns:
object from which the success of call can be seen.
virtual QDBusReply<void> AbstractSensorChannelInterface::stop ( ) [virtual]

Stop sensor.

This will cause acquired resourced to be released.

Returns:
object from which the success of call can be seen.

Textual description about sensor type.

Returns:
sensor type description.

Property Documentation

Definition at line 52 of file abstractsensor_i.h.

Definition at line 60 of file abstractsensor_i.h.

Definition at line 51 of file abstractsensor_i.h.

Definition at line 59 of file abstractsensor_i.h.

Definition at line 53 of file abstractsensor_i.h.

unsigned AbstractSensorChannelInterface::int [read, write]

Definition at line 57 of file abstractsensor_i.h.

Definition at line 54 of file abstractsensor_i.h.

Definition at line 55 of file abstractsensor_i.h.

Definition at line 56 of file abstractsensor_i.h.


The documentation for this class was generated from the following file: