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. Qt4.7.4 Serial Port Linux
QtWS25 Last Chance

Qt4.7.4 Serial Port Linux

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 3 Posters 1.9k 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.
  • G Offline
    G Offline
    garyeholmes
    wrote on last edited by
    #1

    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
    0
    • K Offline
      K Offline
      kuzulis
      Qt Champions 2020
      wrote on last edited by
      #2

      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
      0
      • L Offline
        L Offline
        lutzhell
        wrote on last edited by
        #3

        There exists an external library for communicating via serial ports:

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

        1 Reply Last reply
        0
        • G Offline
          G Offline
          garyeholmes
          wrote on last edited by
          #4

          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
          0

          • Login

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