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

QCommDeviceSession Class Reference
[QtBaseModule]

The QCommDeviceSession class provides facilities to initiate a device session. More...

    #include <QCommDeviceSession>

Inherits QObject.

Public Types

Public Functions

Signals

Static Public Members

Additional Inherited Members


Detailed Description

The QCommDeviceSession class provides facilities to initiate a device session.

The QCommDeviceSession class provides facilities to initiate a new session on a hardware device. The system will attempt to keep the device open for the duration of the open session, unless the user explicitly shuts it down or another unexpected event occurs.

Sessions are thus used by applications to give a hint to the device manager that the device is currently in use. E.g. a client that is trying to send a vCard over bluetooth to a remote device would wrap all Bluetooth related operations by using the QCommDeviceSession object with a given Bluetooth device.

See also QCommDeviceController.


Member Type Documentation

enum QCommDeviceSession::WaitType

ConstantValueDescription
QCommDeviceSession::Block0Block, not using the event loop.
QCommDeviceSession::BlockWithEventLoop1Block, but using the event loop.


Member Function Documentation

QCommDeviceSession::QCommDeviceSession ( const QByteArray & deviceId, QObject * parent = 0 )

Constructs a new QCommDeviceSession object. The he deviceId 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().

QCommDeviceSession::~QCommDeviceSession ()

Destructor.

const QByteArray & QCommDeviceSession::deviceId () const

Returns the id of the device.

void QCommDeviceSession::endSession ()

Closes the current session.

See also startSession() and sessionClosed().

QCommDeviceSession * QCommDeviceSession::session ( const QByteArray & deviceId, WaitType type = BlockWithEventLoop, QObject * parent = 0 )   [static]

Returns a new session for device given by deviceId. The type of wait to use (blocking or recursive event loop) is specified by type. The parent is used to specify the QObject parent of the created session.

If the session could not be established, a NULL is returned.

void QCommDeviceSession::sessionClosed ()   [signal]

This signal is emitted whenever the session has been terminated (perhaps forcefully)

See also endSession().

void QCommDeviceSession::sessionFailed ()   [signal]

This signal is emitted when there was a problem opening the device session.

See also startSession().

void QCommDeviceSession::sessionOpen ()   [signal]

This signal is emitted whenever a session has been opened successfully and it is safe to use the device.

See also startSession().

void QCommDeviceSession::startSession ()

Attempts to initiate a session. Once the session is established, the sessionOpen() signal will be sent. Otherwise sessionFailed() signal will be sent.

See also sessionOpen(), sessionFailed(), and endSession().


Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3