Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Android QBluetoothSocket::SocketError( 8 )
Forum Updated to NodeBB v4.3 + New Features

Android QBluetoothSocket::SocketError( 8 )

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 2 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bnogal
    wrote on last edited by
    #1

    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!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bnogal
        wrote on last edited by
        #3

        yes, i am trying the 5.3.0 beta version.
        But as it is my first time using the bluetooth module, i dont really know if i am doing something wrong or there are limitations in the android version.

        Someone got the examples working?

        1 Reply Last reply
        0
        • B Offline
          B Offline
          bnogal
          wrote on last edited by
          #4

          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 :)

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            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 :)

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved