Base-class for client facades of different sensor types. More...
#include <abstractsensor_i.h>
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 > | |
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 |
Base-class for client facades of different sensor types.
Definition at line 45 of file abstractsensor_i.h.
virtual AbstractSensorChannelInterface::~AbstractSensorChannelInterface | ( | ) | [virtual] |
Destructor.
AbstractSensorChannelInterface::AbstractSensorChannelInterface | ( | const QString & | path, | |
const char * | interfaceName, | |||
int | sessionId | |||
) | [protected] |
Constructor.
path | DBus object path. | |
interfaceName | DBus object name. | |
sessionId | Session ID. |
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.
unsigned int AbstractSensorChannelInterface::bufferSize | ( | ) |
Get used buffer size.
Buffer size is used to control how many samples are collected before signaling application about them.
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] |
Callback for subclasses in which they must read their expected data from socket.
Implemented in AccelerometerSensorChannelInterface, ALSSensorChannelInterface, CompassSensorChannelInterface, GyroscopeSensorChannelInterface, MagnetometerSensorChannelInterface, OrientationSensorChannelInterface, ProximitySensorChannelInterface, RotationSensorChannelInterface, and TapSensorChannelInterface.
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.
bool AbstractSensorChannelInterface::downsampling | ( | ) |
Is downsampling enabled or not.
Downsampling is used to fit requested measurement interval setInterval(int) to effective interval.
SensorError AbstractSensorChannelInterface::errorCode | ( | ) |
Get error code of occured local or remote error.
QString AbstractSensorChannelInterface::errorString | ( | ) |
Get error description of occured local or remote error.
T AbstractSensorChannelInterface::getAccessor | ( | const char * | name | ) | [protected] |
Utility for calling DBus methods from current connection which return value and take no args.
return | type. |
name | method name. |
Definition at line 481 of file abstractsensor_i.h.
IntegerRangeList AbstractSensorChannelInterface::getAvailableBufferIntervals | ( | ) |
Returns list of available buffer interval ranges.
IntegerRangeList AbstractSensorChannelInterface::getAvailableBufferSizes | ( | ) |
Returns list of available buffer sizes.
The list is ordered by efficiency of the size.
DataRangeList AbstractSensorChannelInterface::getAvailableDataRanges | ( | ) |
Get the list of available data ranges for the sensor.
DataRangeList AbstractSensorChannelInterface::getAvailableIntervals | ( | ) |
Get the list of available intervals ranges for the sensor.
DataRange AbstractSensorChannelInterface::getCurrentDataRange | ( | ) |
Get current used data range.
bool AbstractSensorChannelInterface::hwBuffering | ( | ) |
Does the sensor driver support buffering or not.
QString AbstractSensorChannelInterface::id | ( | ) |
Get 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.
bool AbstractSensorChannelInterface::isValid | ( | ) | const |
Does the current instance have valid connection established to sensor daemon.
bool AbstractSensorChannelInterface::read | ( | QVector< T > & | values | ) | [protected] |
Read data from socket into passed container.
Type | to which to convert raw data. |
values | Container for data. |
Definition at line 475 of file abstractsensor_i.h.
bool AbstractSensorChannelInterface::read | ( | void * | buffer, | |
int | size | |||
) | [protected] |
Read data from socket into buffer.
buffer | Pointer to buffer where to write. | |
size | Number of bytes to read. |
bool AbstractSensorChannelInterface::release | ( | ) |
Release the sensor instance.
void AbstractSensorChannelInterface::removeDataRangeRequest | ( | ) |
Remove set data range request.
void AbstractSensorChannelInterface::requestDataRange | ( | DataRange | range | ) |
Request data range.
Usable ranges are listed by getAvailableDataRanges().
range | requested range. |
int AbstractSensorChannelInterface::sessionId | ( | ) | const |
Get ID of the current session.
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.
argument | type. |
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().
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.
value | buffer size. |
bool AbstractSensorChannelInterface::setDataRangeIndex | ( | int | dataRangeIndex | ) |
Request data range by using index which points to the list returned by getAvailableDataRanges().
dataRangeIndex | requeted data range index. |
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.
value | enable or disable downsampling. |
void AbstractSensorChannelInterface::setInterval | ( | int | value | ) |
Set sensor sampling interval (in millisecs).
Value "0" will clear previously set interval. Supported intervals are listed by getAvailableIntervals().
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.
override | standby-override state |
bool AbstractSensorChannelInterface::standbyOverride | ( | ) |
Is standby-override enabled or not.
Standby-override is used to keep sensor enabled when display is blanked.
virtual QDBusReply<void> AbstractSensorChannelInterface::start | ( | ) | [virtual] |
Start sensor.
This will cause necessary resources to be acquired so the sensor readings can be received.
virtual QDBusReply<void> AbstractSensorChannelInterface::stop | ( | ) | [virtual] |
Stop sensor.
This will cause acquired resourced to be released.
QString AbstractSensorChannelInterface::type | ( | ) |
Textual description about sensor type.
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.