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. Qt Serial Port Read
Forum Updated to NodeBB v4.3 + New Features

Qt Serial Port Read

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

    Hi I am trying to read data from the serial port using QT serial port class and using the read method of this class. But not able to read anything over the serial port.

    Can anyone please help me what is the correct sequence or configuration needed to read from the serial port?

    I checked the serial port write part and verified with the serial port tools like hyper terminal/tera term and its happening properly

    Please let me know where is the gap or I am missing in QT Serial port read?

    Thanks in advance
    Ayush

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

      Hi,

      You should use the readyRead signal to get notified when something has arrived on the serial port and then read it.

      If you need blocking behavior (WARNING it will freeze your UI) you have an example in the documentation of QSerialPort.

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

      A 1 Reply Last reply
      0
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        hi
        If i may suggest the
        http://doc.qt.io/qt-5/qtserialport-terminal-example.html
        is s good starting point as it has a config dialog for setting up serial parameters.
        Its available directly in the Creator

        1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          You should use the readyRead signal to get notified when something has arrived on the serial port and then read it.

          If you need blocking behavior (WARNING it will freeze your UI) you have an example in the documentation of QSerialPort.

          A Offline
          A Offline
          ayush_mistral
          wrote on last edited by
          #4

          @SGaist

          Hi,

          Thanks for the help, it worked for me.

          Regards
          Ayush

          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