Public Member Functions | Protected Member Functions | Properties

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

virtual AbstractSensorChannelInterface::~AbstractSensorChannelInterface (  )  [virtual]

Destructor.

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

Constructor.

Parameters:
path DBus object path.
interfaceName DBus object name.
sessionId Session ID.

Member Function Documentation

unsigned int AbstractSensorChannelInterface::bufferInterval (  ) 

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.
unsigned int AbstractSensorChannelInterface::bufferSize (  ) 

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.

virtual bool AbstractSensorChannelInterface::dataReceivedImpl (  )  [protected, pure virtual]
void AbstractSensorChannelInterface::dbusConnectNotify ( const char *  signal  )  [protected]

Wrapper for function of QDBusAbstractInterface.

For more details see QDBusAbstractInterface docs.

QString AbstractSensorChannelInterface::description (  ) 

Get description of the sensor.

Returns:
description of the sensor.
bool AbstractSensorChannelInterface::downsampling (  ) 

Is downsampling enabled or not.

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

Returns:
downsampling state.
SensorError AbstractSensorChannelInterface::errorCode (  ) 

Get error code of occured local or remote error.

Returns:
error code.
QString AbstractSensorChannelInterface::errorString (  ) 

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:
return type.
Parameters:
name method name.
Returns:
called method return value.

Definition at line 481 of file abstractsensor_i.h.

IntegerRangeList AbstractSensorChannelInterface::getAvailableBufferIntervals (  ) 

Returns list of available buffer interval ranges.

Returns:
The list of supported buffer interval ranges.
IntegerRangeList AbstractSensorChannelInterface::getAvailableBufferSizes (  ) 

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.
DataRangeList AbstractSensorChannelInterface::getAvailableDataRanges (  ) 

Get the list of available data ranges for the sensor.

Returns:
List of available data ranges.
DataRangeList AbstractSensorChannelInterface::getAvailableIntervals (  ) 

Get the list of available intervals ranges for the sensor.

Returns:
List of available intervals ranges.
DataRange AbstractSensorChannelInterface::getCurrentDataRange (  ) 

Get current used data range.

Returns:
currently used data range.
bool AbstractSensorChannelInterface::hwBuffering (  ) 

Does the sensor driver support buffering or not.

Returns:
Does the sensor driver support buffering or not.
QString AbstractSensorChannelInterface::id (  ) 

Get ID of the sensor.

Returns:
ID of the sensor.
int AbstractSensorChannelInterface::interval (  ) 

Get used sensor sampling interval (in millisecs).

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

Returns:
used sampling interval (in millisecs)
bool AbstractSensorChannelInterface::isValid (  )  const

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

Returns:
is the established connection valid.
template<typename T >
bool AbstractSensorChannelInterface::read ( QVector< T > &  values  )  [protected]

Read data from socket into passed container.

Template Parameters:
Type to which to convert raw data.
Parameters:
values Container for data.
Returns:
was read successful.

Definition at line 475 of file abstractsensor_i.h.

bool AbstractSensorChannelInterface::read ( void *  buffer,
int  size 
) [protected]

Read data from socket into buffer.

Parameters:
buffer Pointer to buffer where to write.
size Number of bytes to read.
bool AbstractSensorChannelInterface::release (  ) 

Release the sensor instance.

Returns:
true always.
Deprecated:
Session lifecycle ends by destructing this object.
void AbstractSensorChannelInterface::removeDataRangeRequest (  ) 

Remove set data range request.

void AbstractSensorChannelInterface::requestDataRange ( DataRange  range  ) 

Request data range.

Usable ranges are listed by getAvailableDataRanges().

Parameters:
range requested range.
int AbstractSensorChannelInterface::sessionId (  )  const

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:
argument type.
Parameters:
name method name.
value method argument.

Definition at line 493 of file abstractsensor_i.h.

void AbstractSensorChannelInterface::setBufferInterval ( unsigned int  value  ) 

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:
value interval in millisecs.
void AbstractSensorChannelInterface::setBufferSize ( unsigned int  value  ) 

Set buffer size.

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

Parameters:
value buffer size.
bool AbstractSensorChannelInterface::setDataRangeIndex ( int  dataRangeIndex  ) 

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

Parameters:
dataRangeIndex requeted data range index.
Returns:
false if given index is invalid.
bool AbstractSensorChannelInterface::setDownsampling ( bool  value  ) 

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:
value enable or disable downsampling.
Returns:
was downsampling state succesfully changed.
void AbstractSensorChannelInterface::setInterval ( int  value  ) 

Set sensor sampling interval (in millisecs).

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

Parameters:
value sampling interval (in millisecs).
bool AbstractSensorChannelInterface::setStandbyOverride ( bool  override  ) 

Enable or disable standby-override.

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

Parameters:
override standby-override state
Returns:
true if succesfully set.
bool AbstractSensorChannelInterface::standbyOverride (  ) 

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.
QString AbstractSensorChannelInterface::type (  ) 

Textual description about sensor type.

Returns:
sensor type description.

Property Documentation

QString AbstractSensorChannelInterface::description [read]

Definition at line 46 of file abstractsensor_i.h.

bool AbstractSensorChannelInterface::downsampling [read, write]

Definition at line 54 of file abstractsensor_i.h.

SensorError AbstractSensorChannelInterface::errorCode [read]

Definition at line 44 of file abstractsensor_i.h.

QString AbstractSensorChannelInterface::errorString [read]

Definition at line 45 of file abstractsensor_i.h.

bool AbstractSensorChannelInterface::hwBuffering [read]

Definition at line 53 of file abstractsensor_i.h.

QString AbstractSensorChannelInterface::id [read]

Definition at line 47 of file abstractsensor_i.h.

unsigned AbstractSensorChannelInterface::int [read, write]

Definition at line 51 of file abstractsensor_i.h.

int AbstractSensorChannelInterface::interval [read, write]

Definition at line 48 of file abstractsensor_i.h.

int AbstractSensorChannelInterface::sessionId [read]

Definition at line 43 of file abstractsensor_i.h.

bool AbstractSensorChannelInterface::standbyOverride [read, write]

Definition at line 49 of file abstractsensor_i.h.

QString AbstractSensorChannelInterface::type [read]

Definition at line 50 of file abstractsensor_i.h.


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