The QRfcommServer class provides an RFCOMM server.
QRfcommServer is used to implement Bluetooth services over RFCOMM.
Start listening for incoming connections with listen(). The newConnection() signal is emitted when a new connection is established. Call nextPendingConnection() to get a QBluetoothSocket for the new connection.
To enable other devices to find your service create a QBluetoothServiceInfo with the applicable attributes for your service and register it with QBluetoothServiceInfo::registerService(). Call serverPort() to get the RFCOMM channel number that is being used.
Protected Attributes Index
Public Functions Index
|QRfcommServer (QObject *parent=0)|
|bool||hasPendingConnections () const|
|bool||isListening () const|
|bool||listen (const QBluetoothAddress &address=QBluetoothAddress(), quint16 port=0)|
|bool||listen (const QBluetoothUuid uuid, QString serviceName)|
|int||maxPendingConnections () const|
|QBluetoothSocket *||nextPendingConnection ()|
|QBluetooth::SecurityFlags||securityFlags () const|
|QBluetoothAddress||serverAddress () const|
|quint16||serverPort () const|
|void||setMaxPendingConnections (int numConnections)|
|void||setSecurityFlags (QBluetooth::SecurityFlags security)|
Constructs an RFCOMM server with parent.
Closes and resets the listening socket.
Returns true if a connection is pending; otherwise returns false.
Returns true if the RFCOMM server is listening for incoming connections; otherwise returns false.
Start listening for incoming connections to address on port.
Returns the maximum number of pending connections.
Returns a pointer QBluetoothSocket for the next pending connection.
It is the callers responsibility to delete pointer.
Returns the Bluetooth security flags.
Returns the server address.
Returns the server's port number.
Sets the maximum number of pending connections to numConnections.
Sets the Bluetooth security flags to security.
This function must be called prior to calling listen().
© 2013 Digia Plc and/or its subsidiaries. Documentation contributions included herein are the copyrights of their respective owners.
The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.
Documentation sources may be obtained from www.qt-project.org.