×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    331

    QtMobility's QBluetoothSocket connection issue.

    Hi,

    I am working in a project, where I have used QtMobility i.e. "qt-mobility-1.2.0-beta1-epoc32-symbian3-PS2" for connecting the Nokia N8 device with a hardware device through bluetooth using QBluetoothSocket API.
    But for the first time they connected and disconnected properly. Again when I tried to connect the Mobile with the Hardware Devcie, nothing happens and I am getting only the following qDebug() message like:

    Debug: void QtMobility::QBluetoothSocketPrivate::HandleConnectCompleteL(signed int) -8


    what could be the problem. Why the devices don't connect for the second time. Any ideas.
    Thanks...

  2. #2
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: QtMobility's QBluetoothSocket connection issue.

    Hi,

    Can you share a small code snippet that creates the problem. Have you checked the SocketStates changes and SocketErrors if any.. ?

  3. #3
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    331

    Re: QtMobility's QBluetoothSocket connection issue.

    Quote Originally Posted by kusumk View Post
    Hi,

    Can you share a small code snippet that creates the problem. Have you checked the SocketStates changes and SocketErrors if any.. ?
    the code snippet is:

    m_btAddress = QBluetoothAddress("00:1A:88:42:34:22");
    m_BTSocket.connectToService(m_btAddress, QIODevice::ReadWrite);

  4. #4
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: QtMobility's QBluetoothSocket connection issue.

    m_BTSocket.connectToService(m_btAddress, QIODevice::ReadWrite);

    What is the api signature, you are using for the above.. Did you try connecting to Service and not by giving the address.

  5. #5
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    331

    Re: QtMobility's QBluetoothSocket connection issue.

    I tried only the following API as I know the BluetoothAddress of the device, so it's not required to find the service and then connect, what You say?

    void connectToService(const QBluetoothAddress &address, quint16 port, OpenMode openMode = ReadWrite);

  6. #6
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    331

    Re: QtMobility's QBluetoothSocket connection issue.

    Hi there,

    I am still looking for the solution to this issue. This time I tried, by creating 2 applications i.e ClientApp and ServerApp. Through these 2 applications I am able to connect and disconnect perfectly many times without any issues. Here I haven't used any threads for communication, but in my previous posts, I am trying to connect the bluetooth device by creating a thread. Because within the same application I need to search the bluetooth devices, pair one of the devices, then connect the paired device through application, send receive data and then disconnect. The process is continued through out the application. Hence I have introduced a thread to achieve these functionalities. Because of this, the problem comes that second time when I tried to connect the mobile with the external bluetooth device, the application crashes. There might be some problem of resource deallocation internally, I guess. I have already taken care of resource deallocation for implementations. Anybody has any ideas on what are the methods Qt provides for resource deallocation on QThread or what is the theory behind the scene of resource allocation/deallocation.

    Please help me in this regard. Thanks...
    Last edited by RajeevSahu; 2012-03-26 at 12:13.

Similar Threads

  1. QtMobility's QBluetoothSocket::close() not working???
    By RajeevSahu in forum [Archived] Qt Mobility Project
    Replies: 9
    Last Post: 2011-11-18, 11:57
  2. Blocking I/O on QBluetoothSocket
    By konstantint in forum [Archived] Qt Mobility Project
    Replies: 1
    Last Post: 2011-09-18, 12:05
  3. QtMobility's class not recognized !
    By sami.mahjoub in forum [Archived] Qt SDKs and Tools
    Replies: 6
    Last Post: 2011-04-18, 10:21
  4. Connection issue
    By alonish in forum Mobile Java General
    Replies: 1
    Last Post: 2006-01-16, 18:01

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •