sensorfw
CompassSensorChannelInterface Class Reference

Client interface for accessing compass sensor. More...

#include <compasssensor_i.h>

Inheritance diagram for CompassSensorChannelInterface:
AbstractSensorChannelInterface

Signals

void dataAvailable (const Compass &value)
 Sent when compass direction or calibration level has changed. More...
 

Public Member Functions

Compass get ()
 Get latest compass reading from sensor daemon. More...
 
bool useDeclination ()
 Returns whether the sensor is applying declination correction to the output value and returning true north, or not applying it and returning magnetic north. More...
 
void setUseDeclination (bool enable)
 Sets whether the declination correction should be applied or not. More...
 
int declinationValue ()
 Returns the currently used declination correction value. More...
 
 CompassSensorChannelInterface (const QString &path, int sessionId)
 Constructor. More...
 
- Public Member Functions inherited from AbstractSensorChannelInterface
virtual ~AbstractSensorChannelInterface ()
 Destructor. More...
 
bool release ()
 Release the sensor instance. More...
 
int sessionId () const
 Get ID of the current session. More...
 
SensorError errorCode ()
 Get error code of occured local or remote error. More...
 
QString errorString ()
 Get error description of occured local or remote error. More...
 
QString description ()
 Get description of the sensor. More...
 
QString id ()
 Get ID of the sensor. More...
 
int interval ()
 Get used sensor sampling interval (in millisecs). More...
 
void setInterval (int value)
 Set sensor sampling interval (in millisecs). More...
 
bool standbyOverride ()
 Is standby-override enabled or not. More...
 
bool setStandbyOverride (bool override)
 Enable or disable standby-override. More...
 
unsigned int bufferInterval ()
 Used buffer interval. More...
 
void setBufferInterval (unsigned int value)
 Set buffer interval. More...
 
bool downsampling ()
 Is downsampling enabled or not. More...
 
bool setDownsampling (bool value)
 Enable or disable downsampling. More...
 
IntegerRangeList getAvailableBufferIntervals ()
 Returns list of available buffer interval ranges. More...
 
unsigned int bufferSize ()
 Get used buffer size. More...
 
void setBufferSize (unsigned int value)
 Set buffer size. More...
 
IntegerRangeList getAvailableBufferSizes ()
 Returns list of available buffer sizes. More...
 
QString type ()
 Textual description about sensor type. More...
 
virtual QDBusReply< void > start ()
 Start sensor. More...
 
virtual QDBusReply< void > stop ()
 Stop sensor. More...
 
DataRangeList getAvailableIntervals ()
 Get the list of available intervals ranges for the sensor. More...
 
DataRangeList getAvailableDataRanges ()
 Get the list of available data ranges for the sensor. More...
 
DataRange getCurrentDataRange ()
 Get current used data range. More...
 
void requestDataRange (DataRange range)
 Request data range. More...
 
void removeDataRangeRequest ()
 Remove set data range request. More...
 
bool setDataRangeIndex (int dataRangeIndex)
 Request data range by using index which points to the list returned by getAvailableDataRanges(). More...
 
bool hwBuffering ()
 Does the sensor driver support buffering or not. More...
 
bool isValid () const
 Does the current instance have valid connection established to sensor daemon. More...
 

Static Public Member Functions

static AbstractSensorChannelInterfacefactoryMethod (const QString &id, int sessionId)
 Create new instance of the class. More...
 
static const CompassSensorChannelInterfacelistenInterface (const QString &id)
 Request a listening interface to the sensor. More...
 
static CompassSensorChannelInterfacecontrolInterface (const QString &id)
 Request a control interface to the sensor. More...
 
static CompassSensorChannelInterfaceinterface (const QString &id)
 Request an interface to the sensor. More...
 

Static Public Attributes

static const char * staticInterfaceName
 Name of the D-Bus interface for this class. More...
 

Protected Member Functions

virtual bool dataReceivedImpl ()
 Callback for subclasses in which they must read their expected data from socket. More...
 
- Protected Member Functions inherited from AbstractSensorChannelInterface
 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 >
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...
 

Properties

Compass value
 
bool usedeclination
 
int declinationvalue
 
- Properties inherited from AbstractSensorChannelInterface
int sessionId
 
SensorError errorCode
 
QString errorString
 
QString description
 
QString id
 
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 setBufferIntervalFinished (QDBusPendingCallWatcher *watch)
 
void setBufferSizeFinished (QDBusPendingCallWatcher *watch)
 
void setStandbyOverrideFinished (QDBusPendingCallWatcher *watch)
 
void setDownsamplingFinished (QDBusPendingCallWatcher *watch)
 
void setDataRangeIndexFinished (QDBusPendingCallWatcher *watch)
 

Detailed Description

Client interface for accessing compass sensor.

Definition at line 38 of file compasssensor_i.h.

Constructor & Destructor Documentation

◆ CompassSensorChannelInterface()

CompassSensorChannelInterface::CompassSensorChannelInterface ( const QString &  path,
int  sessionId 
)

Constructor.

Parameters
pathpath.
sessionIdsession ID.

Member Function Documentation

◆ controlInterface()

static CompassSensorChannelInterface * CompassSensorChannelInterface::controlInterface ( const QString &  id)
static

Request a control interface to the sensor.

Parameters
idsensor ID.
Returns
Pointer to interface, or NULL on failure.
Deprecated:
use interface(const QString&) instead.

◆ dataAvailable

void CompassSensorChannelInterface::dataAvailable ( const Compass value)
signal

Sent when compass direction or calibration level has changed.

Parameters
valueCurrent compass measurement.

◆ dataReceivedImpl()

virtual bool CompassSensorChannelInterface::dataReceivedImpl ( )
protectedvirtual

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

Returns
was read successful.

Implements AbstractSensorChannelInterface.

◆ declinationValue()

int CompassSensorChannelInterface::declinationValue ( )

Returns the currently used declination correction value.

Returns
Current declination value

◆ factoryMethod()

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

Create new instance of the class.

Parameters
idSensor ID.
sessionIdSession ID.
Returns
Pointer to new instance of the class.

◆ get()

Compass CompassSensorChannelInterface::get ( )

Get latest compass reading from sensor daemon.

Returns
compass reading.

◆ interface()

static CompassSensorChannelInterface * CompassSensorChannelInterface::interface ( const QString &  id)
static

Request an interface to the sensor.

Parameters
idsensor ID.
Returns
Pointer to interface, or NULL on failure.

◆ listenInterface()

static const CompassSensorChannelInterface * CompassSensorChannelInterface::listenInterface ( const QString &  id)
static

Request a listening interface to the sensor.

Parameters
idsensor ID.
Returns
Pointer to interface, or NULL on failure.
Deprecated:
use interface(const QString&) instead.

◆ setUseDeclination()

void CompassSensorChannelInterface::setUseDeclination ( bool  enable)

Sets whether the declination correction should be applied or not.

Parameters
enableIf true, declination correction will be applied, if false, it will not be applied

◆ useDeclination()

bool CompassSensorChannelInterface::useDeclination ( )

Returns whether the sensor is applying declination correction to the output value and returning true north, or not applying it and returning magnetic north.

Returns
True if decliation correction is applied, false otherwise

Member Data Documentation

◆ staticInterfaceName

const char* CompassSensorChannelInterface::staticInterfaceName
static

Name of the D-Bus interface for this class.

Definition at line 50 of file compasssensor_i.h.

Property Documentation

◆ declinationvalue

int CompassSensorChannelInterface::declinationvalue
read

Definition at line 1 of file compasssensor_i.h.

◆ usedeclination

bool CompassSensorChannelInterface::usedeclination
readwrite

Definition at line 1 of file compasssensor_i.h.

◆ value

Compass CompassSensorChannelInterface::value
read

Definition at line 1 of file compasssensor_i.h.


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