Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QCommDeviceSession Class Reference
[QtBaseModule]

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

    #include <QCommDeviceSession>

Inherits QObject.

Public Types

  • enum WaitType { Block, BlockWithEventLoop }

Public Functions

  • 29 public functions inherited from QObject

Signals

Static Public Members

  • QCommDeviceSession * session ( const QByteArray & deviceId, WaitType type = BlockWithEventLoop, QObject * parent = 0 )
  • 4 static public members inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public type inherited from QObject
  • 7 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

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().

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtextended4.4
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web