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

QBluetoothRfcommServer Class Reference
[QtBluetoothModule]

The QBluetoothRfcommServer class represents an RFCOMM server socket. More...

    #include <QBluetoothRfcommServer>

Inherits QBluetoothAbstractServer.

Public Functions

Additional Inherited Members


Detailed Description

The QBluetoothRfcommServer class represents an RFCOMM server socket.

This class makes it possible to accept incoming RFCOMM connections. You can specify the address and the RFCOMM channel 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.

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 channel are available by calling serverAddress() and serverChannel().

Calling close() will make the QBluetoothRfcommServer stop listening for connections and delete all pending connections.

See also QBluetoothRfcommSocket.


Member Function Documentation

QBluetoothRfcommServer::QBluetoothRfcommServer ( QObject * parent = 0 )

Constructs a new QBluetoothRfcommServer with parent parent. The server is in the UnconnectedState.

QBluetoothRfcommServer::~QBluetoothRfcommServer ()

Destroys the server.

bool QBluetoothRfcommServer::isAuthenticated () const

Returns true if the socket is authenticated.

See also securityOptions() and isEncrypted().

bool QBluetoothRfcommServer::isEncrypted () const

Returns true if the socket is encrypted.

See also securityOptions() and isAuthenticated().

bool QBluetoothRfcommServer::listen ( const QBluetoothAddress & local, int channel )

Tells the server to listen for incoming connections on address local and channel channel.

The channel can be any value between 1 and 30.

Returns true on success; otherwise returns false.

See also isListening().

QBluetooth::SecurityOptions QBluetoothRfcommServer::securityOptions () const

Returns the security options currently active for the socket.

See also setSecurityOptions().

QBluetoothAddress QBluetoothRfcommServer::serverAddress () const

Returns the address the server is currently listening on. If the server is not listening, returns QBluetoothAddress::invalid.

See also serverChannel().

int QBluetoothRfcommServer::serverChannel () const

Returns the RFCOMM channel the server is currently listening on. If the server is not listening, returns -1.

See also serverAddress().

bool QBluetoothRfcommServer::setSecurityOptions ( QBluetooth::SecurityOptions options )

Returns true if able to set the security options of the socket to be options; otherwise returns false.

See also securityOptions().


Copyright © 2009 Nokia Trademarks
Qt Extended 4.4.3