Add socket state debug information for bluetooth server
This commit is contained in:
parent
ff66e366b4
commit
22466a9bf7
@ -106,7 +106,8 @@ void BluetoothServer::onClientConnected()
|
||||
|
||||
connect(client, SIGNAL(readyRead()), this, SLOT(readData()));
|
||||
connect(client, SIGNAL(disconnected()), this, SLOT(onClientDisconnected()));
|
||||
connect(client, SIGNAL(error(QBluetoothSocket::SocketError)), this, SLOT(onError(QBluetoothSocket::SocketError)));
|
||||
connect(client, SIGNAL(stateChanged(QBluetoothSocket::SocketState)), this, SLOT(onClientStateChanged(QBluetoothSocket::SocketState)));
|
||||
connect(client, SIGNAL(error(QBluetoothSocket::SocketError)), this, SLOT(onClientError(QBluetoothSocket::SocketError)));
|
||||
|
||||
emit clientConnected(clientId);
|
||||
}
|
||||
@ -123,11 +124,16 @@ void BluetoothServer::onClientDisconnected()
|
||||
emit clientDisconnected(clientId);
|
||||
}
|
||||
|
||||
void BluetoothServer::onError(QBluetoothSocket::SocketError error)
|
||||
void BluetoothServer::onClientError(QBluetoothSocket::SocketError error)
|
||||
{
|
||||
qCWarning(dcBluetoothServer()) << "BluetoothServer: Error occured:" << error;
|
||||
}
|
||||
|
||||
void BluetoothServer::onClientStateChanged(QBluetoothSocket::SocketState state)
|
||||
{
|
||||
qCDebug(dcBluetoothServer()) << "Client socket state changed:" << state;
|
||||
}
|
||||
|
||||
void BluetoothServer::readData()
|
||||
{
|
||||
QBluetoothSocket *client = qobject_cast<QBluetoothSocket *>(sender());
|
||||
|
||||
@ -56,7 +56,8 @@ private slots:
|
||||
|
||||
void onClientConnected();
|
||||
void onClientDisconnected();
|
||||
void onError(QBluetoothSocket::SocketError error);
|
||||
void onClientError(QBluetoothSocket::SocketError error);
|
||||
void onClientStateChanged(QBluetoothSocket::SocketState state);
|
||||
void readData();
|
||||
|
||||
public slots:
|
||||
|
||||
Reference in New Issue
Block a user