The QRfcommServer class provides an RFCOMM server. More...
#include <QRfcommServer>
Inherits: QObject.
This class was introduced in Qt Mobility 1.2.
QRfcommServer ( QObject * parent = 0 ) | |
~QRfcommServer () | |
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 ) |
void | newConnection () |
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.
See also QBluetoothServiceInfo and QBluetoothSocket.
Constructs an RFCOMM server with parent.
Destroys the RFCOMM server.
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 true if the operation succeeded and the RFCOMM server is listening for incoming connections; otherwise returns false.
See also isListening() and newConnection().
Returns the maximum number of pending connections.
See also setMaxPendingConnections().
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().
Returns a pointer QBluetoothSocket for the next pending connection. It is the callers responsibility to delete pointer.
Returns the Bluetooth security flags.
See also setSecurityFlags().
Returns the server address.
Returns the server's port number.
Sets the maximum number of pending connections to numConnections.
See also maxPendingConnections().
Sets the Bluetooth security flags to security. This function must be called prior to calling listen().
See also securityFlags().
© 2008-2011 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners. Privacy Policy
Licensees holding valid Qt Commercial licenses may use this document in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
Alternatively, this document may be used under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.