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. Simple Terminal about serialport bug on mac 10.10.1
Qt 6.11 is out! See what's new in the release blog

Simple Terminal about serialport bug on mac 10.10.1

Scheduled Pinned Locked Moved General and Desktop
8 Posts 3 Posters 1.9k Views 1 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.
  • L Offline
    L Offline
    locobrian
    wrote on last edited by
    #1

    build Qt Creator "terminal" Example,and run it.
    Set Serialport baudRate:921600 Data Bits:Data8 Parity:NoParity
    then open the support serialport and send any data

    serialport recvied all 00

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      That's a bit vague, you should add which version of Qt you are running, what hardware you are using and how do you know that you get only 00

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • L Offline
        L Offline
        locobrian
        wrote on last edited by
        #3

        Thanks your answer

        This's Qt 5.4.
        Use USBtoUart connect mac anther too but the system is windows,in windows use any serialport helper listen

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Are you sure you are using the same com port parameters on both sides ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • L Offline
            L Offline
            locobrian
            wrote on last edited by
            #5

            I' m very sure! I used Qextserialport,it 's ok, but why qt does not?

            1 Reply Last reply
            0
            • L Offline
              L Offline
              locobrian
              wrote on last edited by
              #6

              I verify it that It's qt's bug and fix it .

              in qserialport_unix.cpp replice

              const qint32 unixBaudRate = QSerialPortPrivate::settingFromBaudRate(baudRate);

              const QSerialPort::SerialPortError error = (unixBaudRate > 0)
                  ? setStandardBaudRate(unixBaudRate, directions)
                  : setCustomBaudRate(baudRate, directions);
              
              if (error == QSerialPort::NoError)
                  return updateTermios();
              

              with

              if (setBaudRate_helper(baudRate,directions)==QSerialPort::NoError)
              return updateTermios();

              It's run well!!!!

              1 Reply Last reply
              0
              • K Offline
                K Offline
                kuzulis
                Qt Champions 2020
                wrote on last edited by
                #7

                A problem that on OSX/BSD (at least on v10.9.4 with XCode v6.1) the B921600 speed are not defined in termios.h. There are defined standard speeds up B0 to B230400.

                Thus, apparently, you were lucky that your modification works because in BSD/OSX, the macroes of Bxxx have values of real speeds (i.e. it is not a bit flags as in Linux). Therefore your code works with miracle. :)

                But it is strange, why it does not working via IOSSIOSPEED (as custom baud rate).

                In your case, the setBaudRate(921600) method returns true without an errors?

                PS: Perhaps, QtSerialPort need to correct somehow for specifics OSX in the future.

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kuzulis
                  Qt Champions 2020
                  wrote on last edited by
                  #8

                  bq. In your case, the setBaudRate(921600) method returns true without an errors?

                  Probably, up to Qt 5.4.0 the setBaudRate() will not return an error (this is a bug: https://qt.gitorious.org/qt/qtserialport/commit/93717299150149646d7f1546c8cc86fe54d9319e) . But in Qt 5.4.1 it is fixed (you should get an error from the Terminal example).

                  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