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. QBluetoothSocket baud rate
Forum Updated to NodeBB v4.3 + New Features

QBluetoothSocket baud rate

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 446 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.
  • ocgltdO Offline
    ocgltdO Offline
    ocgltd
    wrote on last edited by
    #1

    I am planning to use a QBluetoothSocket (SPP) connection to a device. At the moment I setup the rfcomm connection to the bluetooth device in Linux, and then my app uses QSerialPort to connect to the bluetooth device.

    With QSerialPort (over rfcomm) I still need to set the right baud rate in order for the device to respond. But with QBluetoothSocket there does not appear to be any wan to set the baud rate! Why?

    Why would serial over bluetooth (/dev/rfcomm) require setting a baud rate, and serial over bluetooth (spp) not allow setting a baud rate?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      @ocgltd said in QBluetoothSocket baud rate:

      At the moment I setup the rfcomm connection to the bluetooth device in Linux, and then my app uses QSerialPort to connect to the bluetooth device.

      What has QSerialPort got to do with it?
      SPP over RFCOMM emulates a serial port in that data in one end comes out the other. It does not create a new serial port device on the client that you then open separately. If you have a QBluetoothSocket connected to a RFCOMM server then you have everything needed to send and receive bytes through the generic QIODevice interface, e.g. read(), write(), and the readyRead() signal.
      See the docs here and the example here

      ocgltdO 1 Reply Last reply
      0
      • C ChrisW67

        @ocgltd said in QBluetoothSocket baud rate:

        At the moment I setup the rfcomm connection to the bluetooth device in Linux, and then my app uses QSerialPort to connect to the bluetooth device.

        What has QSerialPort got to do with it?
        SPP over RFCOMM emulates a serial port in that data in one end comes out the other. It does not create a new serial port device on the client that you then open separately. If you have a QBluetoothSocket connected to a RFCOMM server then you have everything needed to send and receive bytes through the generic QIODevice interface, e.g. read(), write(), and the readyRead() signal.
        See the docs here and the example here

        ocgltdO Offline
        ocgltdO Offline
        ocgltd
        wrote on last edited by
        #3

        @ChrisW67 In linux you can establish the bluetooth connection to a device, and this will create a /dev/rfcom1 tty device. Then in Qt you can open that device using QSerialPort.

        That is an alternative way to establish a serial over bluetooth connection. One way allows setting baud rate, the other does not.

        1 Reply Last reply
        0
        • Kent-DorfmanK Offline
          Kent-DorfmanK Offline
          Kent-Dorfman
          wrote on last edited by
          #4

          bluetooth is a generic protocol stack that nests services. socket APIs don't understand the concept of "baud rate". They are not applicable and the comms uses what bandwidth/speed is available. When you tunnel a "serial port" session, that type of connection has an inherent baud rate associated with it, but it's up to the bluetooth stack to decide whether it cares about about that parameter, either transferring data as fast as the medium will allow for, or inserting idle time in the serial stream to give the effect of the slower baud rate.

          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