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. QBluetooth: can we define custom serial protocol?
Forum Updated to NodeBB v4.3 + New Features

QBluetooth: can we define custom serial protocol?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
7 Posts 2 Posters 628 Views 2 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.
  • ahsan737A Offline
    ahsan737A Offline
    ahsan737
    wrote on last edited by
    #1

    Greetings,
    I am using QBluetooth class to communicate with HC-05 Bluetooth using the android app. I have got a question that how can we define the custom serial mode (baud, data bits, stop bit, even or odd parity)?

    Looking forward to your kind response.

    Best Regards,
    Ahsan

    1 Reply Last reply
    0
    • mrdebugM Offline
      mrdebugM Offline
      mrdebug
      wrote on last edited by
      #2

      Hi. Bluetooth (in my modest opinion), is similar at a tcp connection so you can't define baud rate and it is not necessary.
      You can define your custom protocol without any problem.
      In the past I have implemented bluetooth connection in Linux, Windows (not necessaary because after pairing you will have a virtual com port so you can use the device easely using the standar com port object) and Android.
      I haven't use the Qt bluetooth stack, I have created a component in java for Android and a wrapper for bluetooth library for Linux.
      It was more easely than use the Qt cluetooth stack.

      Need programmers to hire?
      www.labcsp.com
      www.denisgottardello.it
      GMT+1
      Skype: mrdebug

      ahsan737A 1 Reply Last reply
      2
      • mrdebugM mrdebug

        Hi. Bluetooth (in my modest opinion), is similar at a tcp connection so you can't define baud rate and it is not necessary.
        You can define your custom protocol without any problem.
        In the past I have implemented bluetooth connection in Linux, Windows (not necessaary because after pairing you will have a virtual com port so you can use the device easely using the standar com port object) and Android.
        I haven't use the Qt bluetooth stack, I have created a component in java for Android and a wrapper for bluetooth library for Linux.
        It was more easely than use the Qt cluetooth stack.

        ahsan737A Offline
        ahsan737A Offline
        ahsan737
        wrote on last edited by
        #3

        @mrdebug thank you for the considerate reply. Does that mean I can send the data via Bluetooth (connected to Arduino) using any baud rate, 1 or 2 stop bit(s) and parity? and Qt Bluetooth will automatically adapt to it?

        1 Reply Last reply
        0
        • mrdebugM Offline
          mrdebugM Offline
          mrdebug
          wrote on last edited by
          #4

          Which arduino adapter are you using?
          If you are using an uart to bluetooth adapter, Arduino side you have to set the arduino baud rate according with the bluetooth adapter. Such as a gprs modem.
          When your byte stream in entered in the bluetooth tube the baud rate, stop bit and parity have no sense.

          Need programmers to hire?
          www.labcsp.com
          www.denisgottardello.it
          GMT+1
          Skype: mrdebug

          ahsan737A 1 Reply Last reply
          2
          • mrdebugM mrdebug

            Which arduino adapter are you using?
            If you are using an uart to bluetooth adapter, Arduino side you have to set the arduino baud rate according with the bluetooth adapter. Such as a gprs modem.
            When your byte stream in entered in the bluetooth tube the baud rate, stop bit and parity have no sense.

            ahsan737A Offline
            ahsan737A Offline
            ahsan737
            wrote on last edited by
            #5

            @mrdebug I am using Arduino DUE with HC-05 SPP Bluetooth. The current serial mode is 38400, 8-n-1.

            1 Reply Last reply
            0
            • mrdebugM Offline
              mrdebugM Offline
              mrdebug
              wrote on last edited by mrdebug
              #6

              Perfect, it is a AT commands based device.
              As first step I suggest you to pair it with a Windows machine.
              After tah you will have a new virtual com port in the WIndows machine.
              As second step, using a software such as putty you can open the new virtual com port. The baud rate Windows side will be ignored.
              Now you can excange data betwneen arduino and Windows.
              As third step you can start to implement a your custom protocol and to manage the bluetooth connection directly in your software.

              Need programmers to hire?
              www.labcsp.com
              www.denisgottardello.it
              GMT+1
              Skype: mrdebug

              ahsan737A 1 Reply Last reply
              2
              • mrdebugM mrdebug

                Perfect, it is a AT commands based device.
                As first step I suggest you to pair it with a Windows machine.
                After tah you will have a new virtual com port in the WIndows machine.
                As second step, using a software such as putty you can open the new virtual com port. The baud rate Windows side will be ignored.
                Now you can excange data betwneen arduino and Windows.
                As third step you can start to implement a your custom protocol and to manage the bluetooth connection directly in your software.

                ahsan737A Offline
                ahsan737A Offline
                ahsan737
                wrote on last edited by ahsan737
                #7

                @mrdebug thank you so much. for the sake of clarification, I do not need to define baud rate, parity, start/stop bits in Qt.

                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