×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jun 2010
    Posts
    21

    QBluetooth problem

    Hi

    Did somebody use this library before ?? I use this library to control bluetooth, but I get many problems.

    When I use the function of 'startDiscovery' to search a service for bt device, it always return the error code '0'. This error code means 'Service Discovery Not Able To Complete', but I don't know how to solve this problem. The following is the code which used to searching device service.

    QBtServiceDiscoverer* serviceDisc;
    serviceDisc = new QBtServiceDiscoverer(this);

    connect(serviceDisc, SIGNAL(newServiceFound(const QBtDevice&, const QBtService&)),
    this, SLOT(newServiceFound(const QBtDevice&, const QBtService&)));
    connect(serviceDisc, SIGNAL(error (QBtServiceDiscoverer::ServiceDiscoveryError)),
    this, SLOT(GetError (QBtServiceDiscoverer::ServiceDiscoveryError)));

    serviceDisc->startDiscovery(DVBtDev, QBtConstants::SerialPort ); // 'DVBtDev' is device information form 'QBtDeviceDiscoverer' function.

    Thanks for the help

    Tzeng

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2009
    Posts
    1,024

    Re: QBluetooth problem

    Did you compiled it with the following capabilities?

    TARGET.CAPABILITY = LocalServices \
    NetworkServices \
    ReadUserData \
    UserEnvironment \
    WriteUserData

  3. #3
    Registered User
    Join Date
    Jun 2010
    Posts
    21

    Re: QBluetooth problem

    Thanks for replay

    I have added that to *.pro file.

    I try to use the below function to know if the discovery is started. But the slot function of 'DiscoveryStart' will not be executed. I also have used the function of 'QBtDevicesDiscovery' to search device, and it works fine. So I am confused by this question. Anyone can provide better advises ??

    QObject::connect(serviceDisc, SIGNAL(discoveryStarted()),this, SLOT(DiscoveryStart()));

  4. #4
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: QBluetooth problem

    Quote Originally Posted by jwzeng0312 View Post
    Thanks for replay

    I have added that to *.pro file.

    I try to use the below function to know if the discovery is started. But the slot function of 'DiscoveryStart' will not be executed. I also have used the function of 'QBtDevicesDiscovery' to search device, and it works fine. So I am confused by this question. Anyone can provide better advises ??

    QObject::connect(serviceDisc, SIGNAL(discoveryStarted()),this, SLOT(DiscoveryStart()));

    You must see this discussion in the wiki article of QBluetooth.

    http://wiki.forum.nokia.com/index.ph...etooth_library

    Best regards,

Posting Permissions

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