Go to the documentation of this file.
29 #ifndef ABSTRACTSENSOR_I_H
30 #define ABSTRACTSENSOR_I_H
32 #include <QtDBus/QtDBus>
53 Q_PROPERTY(QString
id READ
id)
237 virtual QDBusReply<void>
stop();
318 void displayStateChanged(
bool displayState);
402 bool read(
void* buffer,
int size);
412 bool read(QVector<T>& values);
442 void setAccessor(
const char* name,
const T& value);
448 QDBusMessage
call(QDBus::CallMode mode,
449 const QString& method,
450 const QVariant& arg1 = QVariant(),
451 const QVariant& arg2 = QVariant(),
452 const QVariant& arg3 = QVariant(),
453 const QVariant& arg4 = QVariant(),
454 const QVariant& arg5 = QVariant(),
455 const QVariant& arg6 = QVariant(),
456 const QVariant& arg7 = QVariant(),
457 const QVariant& arg8 = QVariant());
483 struct AbstractSensorChannelInterfaceImpl;
485 AbstractSensorChannelInterfaceImpl* pimpl_;
491 return getSocketReader().
read(values);
497 QDBusReply<T> reply(
call(QDBus::Block, QLatin1String(name)));
500 qDebug() <<
"Failed to get '" << name <<
"' from sensord: " << reply.error().message();
503 return reply.value();
509 QDBusReply<void> reply(
call(QDBus::NoBlock, QLatin1String(name), qVariantFromValue(value)));
512 qDebug() <<
"Failed to set '" << name <<
" = " << value <<
"' to sensord: " << reply.error().message();
bool release()
Release the sensor instance.
IntegerRangeList getAvailableBufferSizes()
Returns list of available buffer sizes.
QDBusMessage callWithArgumentList(QDBus::CallMode mode, const QString &method, const QList< QVariant > &args)
Wrapper for function of QDBusAbstractInterface.
void setAccessor(const char *name, const T &value)
Utility for calling DBus methods from current connection which return nothing and take one arg.
DataRange getCurrentDataRange()
Get current used data range.
void setBufferInterval(unsigned int value)
Set buffer interval.
QList< DataRange > DataRangeList
virtual bool dataReceivedImpl()=0
Callback for subclasses in which they must read their expected data from socket.
QString id()
Get ID of the sensor.
void setStandbyOverrideFinished(QDBusPendingCallWatcher *watch)
T getAccessor(const char *name)
Utility for calling DBus methods from current connection which return value and take no args.
bool read(void *buffer, int size)
Attempt to read given number of bytes from the socket.
int interval()
Get used sensor sampling interval (in millisecs).
Datatype for storing sensor data range information.
DataRangeList getAvailableIntervals()
Get the list of available intervals ranges for the sensor.
Base-class for client facades of different sensor types.
bool setDownsampling(bool value)
Enable or disable downsampling.
void startFinished(QDBusPendingCallWatcher *watch)
SensorError
Enumeration about sensor error states.
void setBufferIntervalFinished(QDBusPendingCallWatcher *watch)
virtual ~AbstractSensorChannelInterface()
Destructor.
bool hwBuffering()
Does the sensor driver support buffering or not.
bool downsampling()
Is downsampling enabled or not.
virtual QDBusReply< void > start()
Start sensor.
unsigned int bufferInterval
bool setDataRangeIndex(int dataRangeIndex)
Request data range by using index which points to the list returned by getAvailableDataRanges().
virtual QDBusReply< void > stop()
Stop sensor.
void dbusConnectNotify(const QMetaMethod &signal)
Wrapper for function of QDBusAbstractInterface.
DataRangeList getAvailableDataRanges()
Get the list of available data ranges for the sensor.
SocketReader helper class for sensor interface.
void setInterval(int value)
Set sensor sampling interval (in millisecs).
void setBufferSize(unsigned int value)
Set buffer size.
QList< IntegerRange > IntegerRangeList
Datatype containing sensor data range and resolution.
int sessionId() const
Get ID of the current session.
Sensor service information.
void requestDataRange(DataRange range)
Request data range.
bool isValid() const
Does the current instance have valid connection established to sensor daemon.
::AbstractSensorChannelInterface AbstractSensor
void setIntervalFinished(QDBusPendingCallWatcher *watch)
QString type()
Textual description about sensor type.
bool read(void *buffer, int size)
Read data from socket into buffer.
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.
void setBufferSizeFinished(QDBusPendingCallWatcher *watch)
unsigned int bufferInterval()
Used buffer interval.
SensorError errorCode()
Get error code of occured local or remote error.
void stopFinished(QDBusPendingCallWatcher *watch)
unsigned int bufferSize()
Get used buffer size.
IntegerRangeList getAvailableBufferIntervals()
Returns list of available buffer interval ranges.
QString description()
Get description of the sensor.
void setDownsamplingFinished(QDBusPendingCallWatcher *watch)
AbstractSensorChannelInterface(const QString &path, const char *interfaceName, int sessionId)
Constructor.
Helper class for reading socket datachannel from sensord.
bool setStandbyOverride(bool override)
Enable or disable standby-override.
void removeDataRangeRequest()
Remove set data range request.
bool standbyOverride()
Is standby-override enabled or not.
void setDataRangeIndexFinished(QDBusPendingCallWatcher *watch)
QString errorString()
Get error description of occured local or remote error.