QRfcommServer
Since: 1.2
#include <QtConnectivity/QRfcommServer>
More information will be added here shortly. For now, you'll find more extensive information about this class in the Qt reference for QRfcommServer
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.
Overview
Protected Attributes Index
QRfcommServerPrivate * | d_ptr |
Public Functions Index
QRfcommServer (QObject *parent=0) | |
~QRfcommServer () | |
void | close () |
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) |
Signals Index
void | newConnection () |
Protected Attributes
QRfcommServerPrivate *
Public Functions
Constructs an RFCOMM server with parent.
Destructor.
void
Closes and resets the listening socket.
bool
Returns true if a connection is pending; otherwise returns false.
bool
Returns true if the RFCOMM server is listening for incoming connections; otherwise returns false.
bool
Start listening for incoming connections to address on port.
bool
QBluetoothSocket *
Returns a pointer QBluetoothSocket for the next pending connection.
It is the callers responsibility to delete pointer.
QBluetooth::SecurityFlags
Returns the Bluetooth security flags.
QBluetoothAddress
Returns the server address.
quint16
Returns the server's port number.
void
Sets the maximum number of pending connections to numConnections.
void
Sets the Bluetooth security flags to security.
This function must be called prior to calling listen().
Signals
void
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.
© 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.
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. Privacy Policy