Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-36726

SerialPort::flush() sends all the data written to port again and again like its buffer is never cleaned

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4: Low
    • Resolution: Cannot Reproduce
    • Affects Version/s: 5.2.1
    • Fix Version/s: 4.8.x, 5.4.0
    • Component/s: Serial Port
    • Labels:
      None
    • Environment:
      Windows 7;
      Tested with real serial port and with "VSPE" emulator by Eterlogic.

      Description

      Following piece of code:

      QSerialPort * port = new QSerialPort(this);
      port->setPortName("COM1");
      port->open(QIODevice::ReadWrite);
      port->write("12");
      port->write("3");
      port->flush();

      port->close();
      port->open(QIODevice::WriteOnly);

      port->write("4");
      port->flush();
      port->flush();
      port->close();

      Sends in fact the following string: "12123444".

      In my opinion, this looks like SerialPort's buffer isn't cleaned after ultimate submission of its data.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            kuzulis Denis Shienkov
            Reporter:
            moskupols Feodor Alekseev
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes