Android QBluetoothSocket::SocketError( 8 )
-
That is the error i get... for the last 2 weeks.
I am trying to comunicate two devices to try the new characteristic... but i cant make it work.
basically
I register one as a server
@
rfcommServer = new QBluetoothServer(QBluetoothServiceInfo::RfcommProtocol, this);
connect(rfcommServer, SIGNAL(newConnection()), this, SLOT(clientConnected()));connect(rfcommServer,SIGNAL(error(QBluetoothServer::Error)),this,SLOT(serverError(QBluetoothServer::Error)));
rfcommServer->listen(QBluetoothUuid(SERVICE_UUID),SERVICE_NAME);
@The other lookup for services... and is discovering it... and i try to connect using:
@
QBluetoothSocket* socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol);
socket->connectToService(serviceInfo);
@
but connection fails, throwing the error : QBluetoothSocket::SocketError( 8 )Any idea?
Thx!
-
Hi,
Are you using Qt 5.3 ? If not, you will need to, the bluetooth module for android has been ported for this version of Qt
-
Ok, i am going to self respond, as finally i got it working.
@
//socket->connectToService(serviceInfo);
socket->connectToService(serviceInfo.device().address(),QBluetoothUuid(SERVICE_UUID));
@Seems that call to connecToService with the serviceInfo that you got during discovering is not working. I think it must be a bug (we talk about 5.3.0beta) so i am going to leave it report. :)
Thx anyway :)
-
Might be, since you are going to create a report don't forget to post a link here so other user may easily find it :)