Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Bluetooth examples = btscanner and btchat

Bluetooth examples = btscanner and btchat

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 543 Views
  • 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on 6 Feb 2022, 17:46 last edited by Anonymous_Banned275 2 Nov 2022, 15:38
    #1

    I would like to talk to someone with REAL EXPERIENCE with these examples.

    I can get “btscanner” to “find” nearby Bluetooth devices – posting “device discovered” .

    I cannot get same results from “btchat” “scanning”.
    It posts “finished” after abut 30 seconds – hence it is timing out
    without errors or “service discovered “ .

    They both use QbluetoothServiceDiscoveryAgent.
    Tracing thru QbluetoothServiceDiscoveryAgent
    (btchat) I cannot see anything different from btscanner.

    I did not find where the “finished” timeout is set.

    I am not sure about my implementation of “error” is correct.
    I would also like to know to to emulate “error” to
    verify that my “error connect” code is correct.

    Thanks

    Addendum
    It appears that btchat example is incomplete hence I like to close this post.

    P 1 Reply Last reply 6 Feb 2022, 19:20
    0
    • M Offline
      M Offline
      mnbv
      wrote on 6 Feb 2022, 18:32 last edited by mnbv 2 Jun 2022, 18:37
      #2

      Qt version?
      OS / platform version?
      Build kit (e.g. MinGW vs MSVC on Windows, etc.)?

      What is "error"? Are you talking about a slot you've connected to the QBluetoothServiceDiscoveryAgent "error()" signal? What is your implementation of it and what is making you question its correctness?

      What is "error connect"?

      For the timeout you can only set it for BTLE searches (see also); there's a setter for it, documented here or in your Qt version's specific docs. I suggest reading the rest of the component documentation, as well, and giving more specifics in your question (also it could be good to edit your subject to be more of a brief summary of your issue).

      A 1 Reply Last reply 6 Feb 2022, 19:59
      1
      • A Anonymous_Banned275
        6 Feb 2022, 17:46

        I would like to talk to someone with REAL EXPERIENCE with these examples.

        I can get “btscanner” to “find” nearby Bluetooth devices – posting “device discovered” .

        I cannot get same results from “btchat” “scanning”.
        It posts “finished” after abut 30 seconds – hence it is timing out
        without errors or “service discovered “ .

        They both use QbluetoothServiceDiscoveryAgent.
        Tracing thru QbluetoothServiceDiscoveryAgent
        (btchat) I cannot see anything different from btscanner.

        I did not find where the “finished” timeout is set.

        I am not sure about my implementation of “error” is correct.
        I would also like to know to to emulate “error” to
        verify that my “error connect” code is correct.

        Thanks

        Addendum
        It appears that btchat example is incomplete hence I like to close this post.

        P Offline
        P Offline
        piervalli
        wrote on 6 Feb 2022, 19:20 last edited by
        #3

        @AnneRanch
        The Bluetooth support works better with Msvc. I used 5.15.2 and Msvc 2019 on Windows 10. Well support I'with Android.

        A 1 Reply Last reply 6 Feb 2022, 20:13
        0
        • M mnbv
          6 Feb 2022, 18:32

          Qt version?
          OS / platform version?
          Build kit (e.g. MinGW vs MSVC on Windows, etc.)?

          What is "error"? Are you talking about a slot you've connected to the QBluetoothServiceDiscoveryAgent "error()" signal? What is your implementation of it and what is making you question its correctness?

          What is "error connect"?

          For the timeout you can only set it for BTLE searches (see also); there's a setter for it, documented here or in your Qt version's specific docs. I suggest reading the rest of the component documentation, as well, and giving more specifics in your question (also it could be good to edit your subject to be more of a brief summary of your issue).

          A Offline
          A Offline
          Anonymous_Banned275
          wrote on 6 Feb 2022, 19:59 last edited by
          #4

          @mnbv
          AnneRanch about 2 hours ago

          I would like to talk to someone with REAL EXPERIENCE with these examples.

          Before getting into sideline of evaluation of which version / OS - can you answer the above as a question ?

          Do you have REAL EXPERIENCE with these examples?

          Questioning my usage of " error " leads me to ask the question.

          M 1 Reply Last reply 7 Feb 2022, 21:34
          0
          • P piervalli
            6 Feb 2022, 19:20

            @AnneRanch
            The Bluetooth support works better with Msvc. I used 5.15.2 and Msvc 2019 on Windows 10. Well support I'with Android.

            A Offline
            A Offline
            Anonymous_Banned275
            wrote on 6 Feb 2022, 20:13 last edited by
            #5

            @piervalli Different OS is not an option - I am on Ubuntu and can select any QT version, but currently using 15,x. Did not find much "bluetooth examples" in 6.x
            Irregardless of version QT / OS - why do two implementation of "agent" acts two different ways?
            Simple answer - btchat implementation of QBluetoothServiceDiscoveryAgent, does not work , hence I should ditch the btchat version / code and rebuild my own implementation of QBluetoothServiceDiscoveryAgent, using btscanner as a template.

            However, QBluetoothServiceDiscoveryAgent has a nasty feature - does not clear last scan and consequently does not really scan - only uses existing data. Not sure it is worth to work with it.

            1 Reply Last reply
            0
            • A Anonymous_Banned275
              6 Feb 2022, 19:59

              @mnbv
              AnneRanch about 2 hours ago

              I would like to talk to someone with REAL EXPERIENCE with these examples.

              Before getting into sideline of evaluation of which version / OS - can you answer the above as a question ?

              Do you have REAL EXPERIENCE with these examples?

              Questioning my usage of " error " leads me to ask the question.

              M Offline
              M Offline
              mnbv
              wrote on 7 Feb 2022, 21:34 last edited by mnbv 2 Jul 2022, 21:49
              #6

              @AnneRanch Yes, I do. And there are multiple valid contexts for the word "error" (for example, overriding QBluetoothServiceDiscoveryAgent's implementation, handling the signal by the same name, or just referring to the general idea of an error -- we can't tell, because we aren't sitting next to you).

              Also version and OS is not a sideline. It's directly relevant to any quirks that you may be running into, and also to any advice (e.g. varying support by build kit, the version of the example itself, etc.). It's also fairly basic information to provide when asking a question about an API of any sort.

              So, please, either state your question clearly, or don't get any help. And above all, be nice. The people here volunteer to spend time helping strangers.

              1 Reply Last reply
              3

              4/6

              6 Feb 2022, 19:59

              • Login

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