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  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QL2capServer Class

The QL2capServer class allows you to connect to a service using the L2CAP protocol. More...

 #include <QL2capServer>

Inherits: QObject.

Public Functions

QL2capServer(QObject * parent = 0)
~QL2capServer()
void close()
bool hasPendingConnections() const
bool isListening() const
bool listen(const QBluetoothAddress & address = QBluetoothAddress(), quint16 port = 0)
int maxPendingConnections() const
QBluetoothSocket * nextPendingConnection()
QBluetooth::SecurityFlags securityFlags() const
QBluetoothAddress serverAddress() const
quint16 serverPort() const
void setMaxPendingConnections(int numConnections)
void setSecurityFlags(QBluetooth::SecurityFlags security)
  • 31 public functions inherited from QObject

Signals

void newConnection()

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 11 static public members inherited from QObject
  • 9 protected functions inherited from QObject

Detailed Description

The QL2capServer class allows you to connect to a service using the L2CAP protocol.

QL2capServer is used to implement Bluetooth services over L2CAP.

Start listening for incoming connections with listen(). Wait till the newConnection() signal is emitted when the connection is established, and call nextPendingConnection() to get a QBluetoothSocket for the connection.

To enable other devices to find your service, create a QBluetoothServiceInfo with the applicable attributes for your service and register it using QBluetoothServiceInfo::registerService(). Call serverPort() to get the L2CAP port number that is being used.

See also QBluetoothServiceInfo and QBluetoothSocket.

Member Function Documentation

QL2capServer::QL2capServer(QObject * parent = 0)

Constructs an L2CAP server with parent.

QL2capServer::~QL2capServer()

Destroys the L2CAP server.

void QL2capServer::close()

Closes and resets the listening socket.

bool QL2capServer::hasPendingConnections() const

Returns true if a connection is pending, otherwise false.

bool QL2capServer::isListening() const

Returns true if the L2CAP server is listening for incoming connections, otherwise false.

bool QL2capServer::listen(const QBluetoothAddress & address = QBluetoothAddress(), quint16 port = 0)

Start listening for incoming connections to address on port.

Returns true if the operation succeeded and the L2CAP server is listening for incoming connections, otherwise returns false.

See also isListening() and newConnection().

int QL2capServer::maxPendingConnections() const

Returns the maximum number of pending connections.

See also setMaxPendingConnections().

void QL2capServer::newConnection() [signal]

This signal is emitted when a new connection is available.

The connected slot should call nextPendingConnection() to get a QBluetoothSocket object to send and receive data over the connection.

See also nextPendingConnection() and hasPendingConnections().

QBluetoothSocket * QL2capServer::nextPendingConnection()

Returns a pointer to a QBluetoothSocket for the next pending connection. It is the callers responsibility to delete the pointer.

QBluetooth::SecurityFlags QL2capServer::securityFlags() const

Returns the Bluetooth security flags.

See also setSecurityFlags().

QBluetoothAddress QL2capServer::serverAddress() const

Returns the server address.

quint16 QL2capServer::serverPort() const

Returns the server port number.

void QL2capServer::setMaxPendingConnections(int numConnections)

Sets the maximum number of pending connections to numConnections.

See also maxPendingConnections().

void QL2capServer::setSecurityFlags(QBluetooth::SecurityFlags security)

Sets the Bluetooth security flags to security. This function must be called before calling listen().

See also securityFlags().

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 5.0-snapshot
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