Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Unsolved BluetoothDiscoveryModel.FullServiceDiscovery issue?

    QML and Qt Quick
    qml bluetooth ble
    1
    1
    531
    Loading More Posts
    • 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.
    • J
      JesperWe last edited by JesperWe

      I'm trying to use BluetoothDiscoveryModel.FullServiceDiscovery, but failing.

      Turns out the QML Bluetooth Scanner Example doesn't work either.

      I am running Qt 5.10 under WinRT. The example that uses C++ Bluetooth classes (lowenergyscanner) works fine and can discover services, so it does not seem to be an environment issue.

      BluetoothDiscoveryModel.DeviceDiscovery also works fine.

      This is the console when running QML Bluetooth Scanner Example :

      winrtrunner --device 0 --start --stop --install --wait 0 --profile appx C:/Qt/Examples/Qt-5.10.1/bluetooth/build-scanner-Qt_5_10_1_for_UWP_64bit_MSVC_2017-Debug/debug/qml_scanner.exe
      qt.winrtrunner: Using the Appx profile.
      qt.winrtrunner: Package al
      ready installed.
      qt.winrtrunner: App started with process ID 6508
      qt.winrtrunner.app: WARNING: QApplication was not created in the main() thread.
      qt.winrtrunner.app: Could not enable JIT, fallback to interpreter mode. Consider setting the code-generation capability
      qt.winrtrunner.app: JIT is disabled for QML. Property bindings and animations will be very slow. Visit https://wiki.qt.io/V4 to learn about possible solutions for your platform.
      qt.winrtrunner.app: New device: F5:2C:B5:A2:13:17
      qt.winrtrunner.app: New device: D6:8D:8C:9C:67:6A
      qt.winrtrunner.app: Discovery mode: 1
      qt.winrtrunner.app: qrc:/scanner.qml:111: TypeError: Cannot read property 'deviceAddress' of undefined
      qt.winrtrunner.app: qrc:/scanner.qml:111: TypeError: Cannot read property 'deviceAddress' of undefined
      qt.winrtrunner.app: QCoreApplication::postEvent: Unexpected null receiver
      

      As can be seen two devices are discovered in Device mode, but then something goes wrong in FullService.
      The two TypeErrors are from the line

      var str = "Address: " + s.deviceAddress;
      

      in the example code. So it looks like there is no service property on btModel?

      I was kind of thinking that the example should work, so maybe this is some bug?

      1 Reply Last reply Reply Quote 0
      • First post
        Last post