The QL2capServer class provides an L2CAP server. More...
#include <QL2capServer>
Inherits: QObject.
This class was introduced in Qt Mobility 1.2.
QL2capServer ( QObject * parent = 0 ) | |
~QL2capServer () | |
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 QL2capServer class provides an L2CAP server.
QL2capServer is used to implement Bluetooth services over L2CAP.
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 L2CAP port number that is being used.
See also QBluetoothServiceInfo and QBluetoothSocket.
Constructs an L2CAP server with parent.
Destorys the L2CAP server.
Closes and resets the listening socket.
Returns true if a connection is pending; otherwise returns false.
Returns true if the L2CAP 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 L2CAP 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 to a QBluetoothSocket for the next pending connection. It is the callers responsibility to delete the 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().