Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QBluetoothL2CapServer class represents an L2CAP server socket. More...
#include <QBluetoothL2CapServer>
Inherits QBluetoothAbstractServer.
The QBluetoothL2CapServer class represents an L2CAP server socket.
This class makes it possible to accept incoming L2CAP connections. You can specify the address and the L2CAP PSM to listen on.
Call listen() to make the server listen for new connections. The newConnection() signal will be emmited each time a client connects to the server. The MTU to use should be specified during the listen() call.
Security options controlling the authentication and encryption of the Bluetooth link on the socket can be specified at any time by calling setSecurityOptions(). Currently this will only affect all future connections, not connections which are active or pending.
Call nextPendingConnection() to accept the pending client connection.
When listening for connections, server address and PSM are available by calling serverAddress() and serverPsm().
Calling close() will make the QBluetoothL2CapServer stop listening for connections and delete all pending connections.
// Create a new L2CapServer on PSM 25 QBluetoothL2CapServer *server = new QBluetoothL2CapServer; server->listen(QBluetoothAddress::any, 25); // wait for newConnection() signal QBluetoothL2CapSocket *sock = qobject_cast<QBluetoothL2CapSocket *>( sock->nextPendingConnection() ); server->close();
See also QBluetoothL2CapSocket.
Constructs a new QBluetoothL2CapServer with parent parent. The server is in the UnconnectedState.
Destroys the server.
Returns true if the socket is authenticated.
See also securityOptions() and isEncrypted().
Returns true if the socket is encrypted.
See also securityOptions() and isAuthenticated().
Tells the server to listen for incoming connections on address local and PSM psm. The mtu parameter holds the MTU to use for the server.
PSM stands for Port and Service Multiplexer. The PSM value can be any odd value the range of 1-32765. For more information please see Bluetooth Specification Version 2.0 + EDR [vol 4] page 45.
Returns true if the server successfully started listening; otherwise returns false. If the server was already listening, returns false.
See also isListening().
Returns the MTU that should be used for this server. By default the MTU is set to be 672 bytes. If the socket is not listening, or an error occurred, returns -1.
Returns the security options currently active for the socket.
See also setSecurityOptions().
Returns the address the server is currently listening on. If the server is not listening, returns QBluetoothAddress::invalid.
See also serverPsm().
Returns the L2CAP PSM the server is currently listening on. If the server is not listening, returns -1.
See also serverAddress().
Returns true if able to set the security options of the socket to be options; otherwise returns false. Note that under the current Linux implementation only new connections will be affected by the change in security options. Existing and pending connections will not be affected.
See also securityOptions().
Copyright © 2009 Trolltech | Trademarks | Qt Extended 4.4.3 |