Base-class for client facades of different sensor types.
More...
#include <abstractsensor_i.h>
|
| AbstractSensorChannelInterface (const QString &path, const char *interfaceName, int sessionId) |
| Constructor. More...
|
|
bool | read (void *buffer, int size) |
| Read data from socket into buffer. More...
|
|
template<typename T > |
bool | read (QVector< T > &values) |
| Read data from socket into passed container. More...
|
|
virtual bool | dataReceivedImpl ()=0 |
| Callback for subclasses in which they must read their expected data from socket. More...
|
|
template<typename T > |
T | getAccessor (const char *name) |
| Utility for calling DBus methods from current connection which return value and take no args. More...
|
|
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. More...
|
|
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. More...
|
|
QDBusMessage | callWithArgumentList (QDBus::CallMode mode, const QString &method, const QList< QVariant > &args) |
| Wrapper for function of QDBusAbstractInterface. More...
|
|
void | dbusConnectNotify (const QMetaMethod &signal) |
| Wrapper for function of QDBusAbstractInterface. More...
|
|
Base-class for client facades of different sensor types.
Definition at line 45 of file abstractsensor_i.h.
◆ ~AbstractSensorChannelInterface()
virtual AbstractSensorChannelInterface::~AbstractSensorChannelInterface |
( |
| ) |
|
|
virtual |
◆ AbstractSensorChannelInterface()
AbstractSensorChannelInterface::AbstractSensorChannelInterface |
( |
const QString & |
path, |
|
|
const char * |
interfaceName, |
|
|
int |
sessionId |
|
) |
| |
|
protected |
Constructor.
- Parameters
-
path | DBus object path. |
interfaceName | DBus object name. |
sessionId | Session ID. |
◆ bufferInterval()
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.
◆ bufferSize()
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.
◆ call()
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.
◆ callWithArgumentList()
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.
◆ dataReceivedImpl()
virtual bool AbstractSensorChannelInterface::dataReceivedImpl |
( |
| ) |
|
|
protectedpure virtual |
Callback for subclasses in which they must read their expected data from socket.
- Returns
- was read successful.
Implemented in AccelerometerSensorChannelInterface, ALSSensorChannelInterface, CompassSensorChannelInterface, GyroscopeSensorChannelInterface, HrmSensorChannelInterface, HumiditySensorChannelInterface, LidSensorChannelInterface, MagnetometerSensorChannelInterface, OrientationSensorChannelInterface, PressureSensorChannelInterface, ProximitySensorChannelInterface, RotationSensorChannelInterface, StepCounterSensorChannelInterface, TapSensorChannelInterface, and TemperatureSensorChannelInterface.
◆ dbusConnectNotify()
void AbstractSensorChannelInterface::dbusConnectNotify |
( |
const QMetaMethod & |
signal | ) |
|
|
protected |
Wrapper for function of QDBusAbstractInterface.
For more details see QDBusAbstractInterface docs.
◆ description()
QString AbstractSensorChannelInterface::description |
( |
| ) |
|
Get description of the sensor.
- Returns
- description of the sensor.
◆ downsampling()
bool AbstractSensorChannelInterface::downsampling |
( |
| ) |
|
Is downsampling enabled or not.
Downsampling is used to fit requested measurement interval setInterval(int) to effective interval.
- Returns
- downsampling state.
◆ errorCode()
SensorError AbstractSensorChannelInterface::errorCode |
( |
| ) |
|
Get error code of occured local or remote error.
- Returns
- error code.
◆ errorString()
QString AbstractSensorChannelInterface::errorString |
( |
| ) |
|
Get error description of occured local or remote error.
- Returns
- error description.
◆ getAccessor()
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
-
- Parameters
-
- Returns
- called method return value.
Definition at line 495 of file abstractsensor_i.h.
◆ getAvailableBufferIntervals()
IntegerRangeList AbstractSensorChannelInterface::getAvailableBufferIntervals |
( |
| ) |
|
Returns list of available buffer interval ranges.
- Returns
- The list of supported buffer interval ranges.
◆ 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.
◆ getAvailableDataRanges()
DataRangeList AbstractSensorChannelInterface::getAvailableDataRanges |
( |
| ) |
|
Get the list of available data ranges for the sensor.
- Returns
- List of available data ranges.
◆ getAvailableIntervals()
DataRangeList AbstractSensorChannelInterface::getAvailableIntervals |
( |
| ) |
|
Get the list of available intervals ranges for the sensor.
- Returns
- List of available intervals ranges.
◆ getCurrentDataRange()
DataRange AbstractSensorChannelInterface::getCurrentDataRange |
( |
| ) |
|
Get current used data range.
- Returns
- currently used data range.
◆ hwBuffering()
bool AbstractSensorChannelInterface::hwBuffering |
( |
| ) |
|
Does the sensor driver support buffering or not.
- Returns
- Does the sensor driver support buffering or not.
◆ id()
QString AbstractSensorChannelInterface::id |
( |
| ) |
|
Get ID of the sensor.
- Returns
- ID of the sensor.
◆ interval()
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)
◆ isValid()
bool AbstractSensorChannelInterface::isValid |
( |
| ) |
const |
Does the current instance have valid connection established to sensor daemon.
- Returns
- is the established connection valid.
◆ read() [1/2]
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 489 of file abstractsensor_i.h.
◆ read() [2/2]
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. |
◆ release()
bool AbstractSensorChannelInterface::release |
( |
| ) |
|
Release the sensor instance.
- Returns
- true always.
- Deprecated:
- Session lifecycle ends by destructing this object.
◆ removeDataRangeRequest()
void AbstractSensorChannelInterface::removeDataRangeRequest |
( |
| ) |
|
Remove set data range request.
◆ requestDataRange()
void AbstractSensorChannelInterface::requestDataRange |
( |
DataRange |
range | ) |
|
◆ sessionId()
int AbstractSensorChannelInterface::sessionId |
( |
| ) |
const |
Get ID of the current session.
- Returns
- current session ID.
◆ setAccessor()
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
-
- Parameters
-
name | method name. |
value | method argument. |
Definition at line 507 of file abstractsensor_i.h.
◆ setBufferInterval()
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. |
◆ setBufferIntervalFinished
void AbstractSensorChannelInterface::setBufferIntervalFinished |
( |
QDBusPendingCallWatcher * |
watch | ) |
|
|
protectedslot |
◆ setBufferSize()
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
-
◆ setBufferSizeFinished
void AbstractSensorChannelInterface::setBufferSizeFinished |
( |
QDBusPendingCallWatcher * |
watch | ) |
|
|
protectedslot |
◆ setDataRangeIndex()
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.
◆ setDataRangeIndexFinished
void AbstractSensorChannelInterface::setDataRangeIndexFinished |
( |
QDBusPendingCallWatcher * |
watch | ) |
|
|
protectedslot |
◆ setDownsampling()
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.
◆ setDownsamplingFinished
void AbstractSensorChannelInterface::setDownsamplingFinished |
( |
QDBusPendingCallWatcher * |
watch | ) |
|
|
protectedslot |
◆ setInterval()
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). |
◆ setIntervalFinished
void AbstractSensorChannelInterface::setIntervalFinished |
( |
QDBusPendingCallWatcher * |
watch | ) |
|
|
protectedslot |
◆ setStandbyOverride()
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.
◆ setStandbyOverrideFinished
void AbstractSensorChannelInterface::setStandbyOverrideFinished |
( |
QDBusPendingCallWatcher * |
watch | ) |
|
|
protectedslot |
◆ standbyOverride()
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.
◆ start()
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.
◆ startFinished
void AbstractSensorChannelInterface::startFinished |
( |
QDBusPendingCallWatcher * |
watch | ) |
|
|
protectedslot |
◆ stop()
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.
◆ stopFinished
void AbstractSensorChannelInterface::stopFinished |
( |
QDBusPendingCallWatcher * |
watch | ) |
|
|
protectedslot |
◆ type()
QString AbstractSensorChannelInterface::type |
( |
| ) |
|
Textual description about sensor type.
- Returns
- sensor type description.
◆ bufferInterval
unsigned int AbstractSensorChannelInterface::bufferInterval |
|
readwrite |
◆ bufferSize
unsigned int AbstractSensorChannelInterface::bufferSize |
|
readwrite |
◆ description
QString AbstractSensorChannelInterface::description |
|
read |
◆ downsampling
bool AbstractSensorChannelInterface::downsampling |
|
readwrite |
◆ errorCode
◆ errorString
QString AbstractSensorChannelInterface::errorString |
|
read |
◆ hwBuffering
bool AbstractSensorChannelInterface::hwBuffering |
|
read |
◆ id
QString AbstractSensorChannelInterface::id |
|
read |
◆ interval
int AbstractSensorChannelInterface::interval |
|
readwrite |
◆ sessionId
int AbstractSensorChannelInterface::sessionId |
|
read |
◆ standbyOverride
bool AbstractSensorChannelInterface::standbyOverride |
|
readwrite |
◆ type
QString AbstractSensorChannelInterface::type |
|
read |
The documentation for this class was generated from the following file: