Qt Forum

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

    Qt4.7.4 Serial Port Linux

    Mobile and Embedded
    3
    4
    1659
    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.
    • G
      garyeholmes last edited by

      Hi,

      I need to send and transmit data on the ttyGS0 serial gadget in my embedded linux system.

      I'm a bit concerned about upgrading to qt5 just yet.

      What is my best option for using this device with my current Qt version?

      Thank you.

      1 Reply Last reply Reply Quote 0
      • K
        kuzulis Qt Champions 2020 last edited by

        You can try to build the QtSerialPort. Though, for it is declared support from Qt 4.8 and above. But you can try and Qt 4.7. If will appears a compilation errors, then, think, they can be fixed easily. Most likely the errors will be related to the QElapsedTimer, etc. which aren't present in Qt 4.7.x. It is rather simple to replace these classes with the similar from Qt 4.7.

        1 Reply Last reply Reply Quote 0
        • L
          lutzhell last edited by

          There exists an external library for communicating via serial ports:

          "QextSerialPort":http://code.google.com/p/qextserialport/

          1 Reply Last reply Reply Quote 0
          • G
            garyeholmes last edited by

            Hi, thanks for reply.

            In the end I used the low level ::read() and ::write() commands found in fcntl.h.

            The only major issue I had with this was turning off the serial ports canonical mode which appeared to be on by default with the following:

            @ //get current settings
            termios tc;
            ::tcgetattr(fd, &tc);

                //canonical mode - off
                tc.c_lflag &= ~ICANON;
            
                //save current settings
                ::tcsetattr(fd, 0, &tc);@
            

            ...again thanks for comments.

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