Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QCommDeviceController Class Reference
[QtBaseModule]

The QCommDeviceController class provides facilities to control the power state of a hardware communications device More...

    #include <QCommDeviceController>

Inherits QObject.

Public Types

Public Functions

Signals

Additional Inherited Members


Detailed Description

The QCommDeviceController class provides facilities to control the power state of a hardware communications device

Using the QCommDeviceController class it is possible to control the power state of a Bluetooth or Infrared hardware device. This class is generally useful only to settings applications which need to control the device state directly. For typical useage, please see the QCommDeviceSession class.

The device can be in four power states: on, off, on for one item, and on for a period of time.

See also QCommDeviceSession.


Member Type Documentation

enum QCommDeviceController::PowerState

The current state of the device.

ConstantValueDescription
QCommDeviceController::On0The device is on permanently.
QCommDeviceController::Off1The device is off.
QCommDeviceController::OnOneItem2The device is on until the last device session is closed.
QCommDeviceController::OnTimed3The device is on for a specified period of time, at which time it is either turned off if there are no sessions open, or enters the OnOneItem state.


Member Function Documentation

QCommDeviceController::QCommDeviceController ( const QByteArray & devId, QObject * parent = 0 )

Constructs a new QCommDeviceController object. The devId specifies the device id. This is usually equivalent to the hardware device id of the device. E.g. irdaX for Infrared devices and hciX for Bluetooth devices.

The parent parameter is passed to the QObject constructor.

See also deviceId().

QCommDeviceController::~QCommDeviceController ()

Destructor.

void QCommDeviceController::bringDown ()

Brings down the device. The device will attempt to enter the Off mode.

See also bringUp().

void QCommDeviceController::bringUp ()

Brings up the device. The device will attempt to enter the On mode.

See also bringDown(), bringUpTimed(), and bringUpOneItem().

void QCommDeviceController::bringUpOneItem ()

Brings up the device for one item. The device will attempt to enter the OnOneItem mode.

See also bringUp() and bringUpTimed().

void QCommDeviceController::bringUpTimed ( int secs )

Brings up the device in timed mode. The device will attempt to enter the OnTimed mode. The device will remain in this mode for secs seconds.

See also bringUp() and bringUpOneItem().

const QByteArray & QCommDeviceController::deviceId () const

Returns the id of the device.

void QCommDeviceController::down ()   [signal]

This signal is emitted when the device is turned off.

See also bringDown().

bool QCommDeviceController::isUp () const

Returns true if the device is currently turned on. E.g. it is in On, OnTimed or OnOneItem mode.

See also bringUp(), bringDown(), and powerState().

PowerState QCommDeviceController::powerState () const

Returns the current power state of the device.

See also isUp().

void QCommDeviceController::powerStateChanged ( QCommDeviceController::PowerState state )   [signal]

This signal is emitted when a device's power state has been changed. The state parameter holds the new power state.

See also powerState().

bool QCommDeviceController::sessionsActive () const

Returns true if there are applications using this device.

void QCommDeviceController::up ()   [signal]

This signal is emitted when the device is turned on.

See also bringUp().


Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3