sensorfw: RotationSensorChannelInterface Class Reference

sensorfw

Signals | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Properties | List of all members
RotationSensorChannelInterface Class Reference

Client interface for listening device rotation changes. More...

`#include <rotationsensor_i.h>`

Inheritance diagram for RotationSensorChannelInterface:

## Signals
void | dataAvailable (const XYZ &data)
| Sent when device rotation has changed.
void | frameAvailable (const QVector< XYZ > &frame)
| Sent when new measurement frame has become available.

## Public Member Functions
XYZ | rotation ()
| Get latest rotation reading from sensor daemon.
bool | hasZ ()
| Does reported readings include Z coordinate.
| RotationSensorChannelInterface (const QString &path, int sessionId)
| Constructor.
Public Member Functions inherited from AbstractSensorChannelInterface
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).
double | dataRate ()
void | setInterval (int interval_ms)
| Set sensor sampling interval (in millisecs).
void | setDataRate (double dataRate_Hz)
| Set sensor sampling frequency (in Hertz).
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 interval_ms)
| 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.

## Static Public Member Functions
static AbstractSensorChannelInterface * | factoryMethod (const QString &id, int sessionId)
| Create new instance of the class.
static const RotationSensorChannelInterface * | listenInterface (const QString &id)
| Request a listening interface to the sensor.
static RotationSensorChannelInterface * | controlInterface (const QString &id)
| Request a control interface to the sensor.
static RotationSensorChannelInterface * | interface (const QString &id)
| Request an interface to the sensor.

## Static Public Attributes
static const char * | staticInterfaceName
| Get name of the D-Bus interface for this class.

## Protected Member Functions
virtual void | connectNotify (const QMetaMethod &signal)
virtual bool | dataReceivedImpl ()
| Callback for subclasses in which they must read their expected data from socket.
Protected Member Functions inherited from AbstractSensorChannelInterface
| 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.
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 QMetaMethod &signal)
| Wrapper for function of QDBusAbstractInterface.

## Properties
XYZ | rotation
bool | hasZ
Properties inherited from AbstractSensorChannelInterface
int | sessionId
SensorError | errorCode
QString | errorString
QString | description
QString | id
int | dataRate
int | interval
bool | standbyOverride
QString | type
unsigned int | bufferInterval
unsigned int | bufferSize
bool | hwBuffering
bool | downsampling

## Additional Inherited Members
Protected Slots inherited from AbstractSensorChannelInterface
void | startFinished (QDBusPendingCallWatcher *watch)
void | stopFinished (QDBusPendingCallWatcher *watch)
void | setIntervalFinished (QDBusPendingCallWatcher *watch)
void | setDataRateFinished (QDBusPendingCallWatcher *watch)
void | setBufferIntervalFinished (QDBusPendingCallWatcher *watch)
void | setBufferSizeFinished (QDBusPendingCallWatcher *watch)
void | setStandbyOverrideFinished (QDBusPendingCallWatcher *watch)
void | setDownsamplingFinished (QDBusPendingCallWatcher *watch)
void | setDataRangeIndexFinished (QDBusPendingCallWatcher *watch)

## Detailed Description

Client interface for listening device rotation changes.

Definition at line 39 of file rotationsensor_i.h.

## Constructor & Destructor Documentation

## ◆ RotationSensorChannelInterface()

RotationSensorChannelInterface::RotationSensorChannelInterface | ( | const QString & | path,
|  | int | sessionId )

Constructor.

Parameters

  path | path.
  sessionId | session id.

## Member Function Documentation

## ◆ connectNotify()

virtual void RotationSensorChannelInterface::connectNotify | ( | const QMetaMethod & | signal | ) |
| protectedvirtual

## ◆ controlInterface()

static RotationSensorChannelInterface * RotationSensorChannelInterface::controlInterface | ( | const QString & | id | ) |
| static

Request a control interface to the sensor.

Parameters

  id | sensor ID.

Returns
  Pointer to interface, or NULL on failure.

Deprecated
  use interface(const QString&) instead.

## ◆ dataAvailable

void RotationSensorChannelInterface::dataAvailable | ( | const XYZ & | data | ) |
| signal

Sent when device rotation has changed.

Parameters

  data | Current device rotation.

## ◆ dataReceivedImpl()

virtual bool RotationSensorChannelInterface::dataReceivedImpl | ( |  | ) |
| protectedvirtual

Callback for subclasses in which they must read their expected data from socket.

Returns
  was read successful.

Implements AbstractSensorChannelInterface.

## ◆ factoryMethod()

static AbstractSensorChannelInterface * RotationSensorChannelInterface::factoryMethod | ( | const QString & | id,
|  | int | sessionId )
| static

Create new instance of the class.

Parameters

  id | Sensor ID.
  sessionId | Session ID.

Returns
  Pointer to new instance of the class.

## ◆ frameAvailable

void RotationSensorChannelInterface::frameAvailable | ( | const QVector< XYZ > & | frame | ) |
| signal

Sent when new measurement frame has become available.

If app doesn't connect to this signal content of frames will be sent through dataAvailable signal.

Parameters

  frame | New measurement frame.

## ◆ hasZ()

bool RotationSensorChannelInterface::hasZ | ( |  | ) |

Does reported readings include Z coordinate.

Returns
  Does reported readings include Z coordinate.

## ◆ interface()

static RotationSensorChannelInterface * RotationSensorChannelInterface::interface | ( | const QString & | id | ) |
| static

Request an interface to the sensor.

Parameters

  id | sensor ID.

Returns
  Pointer to interface, or NULL on failure.

## ◆ listenInterface()

static const RotationSensorChannelInterface * RotationSensorChannelInterface::listenInterface | ( | const QString & | id | ) |
| static

Request a listening interface to the sensor.

Parameters

  id | sensor ID.

Returns
  Pointer to interface, or NULL on failure.

Deprecated
  use interface(const QString&) instead.

## ◆ rotation()

XYZ RotationSensorChannelInterface::rotation | ( |  | ) |

Get latest rotation reading from sensor daemon.

Returns
  rotation reading.

## Member Data Documentation

## ◆ staticInterfaceName

const char* RotationSensorChannelInterface::staticInterfaceName
| static

Get name of the D-Bus interface for this class.

Returns
  Name of the interface.

Definition at line 52 of file rotationsensor_i.h.

## Property Documentation

## ◆ hasZ

bool RotationSensorChannelInterface::hasZ
| read

Definition at line 44 of file rotationsensor_i.h.

## ◆ rotation

XYZ RotationSensorChannelInterface::rotation
| read

Definition at line 43 of file rotationsensor_i.h.

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

- qt-api/rotationsensor_i.h