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. QSerialPort setting echo flags
Qt 6.11 is out! See what's new in the release blog

QSerialPort setting echo flags

Scheduled Pinned Locked Moved Solved General and Desktop
qserialport
2 Posts 2 Posters 1.7k 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.
  • M Offline
    M Offline
    matone1
    wrote on last edited by
    #1

    I am attempting to migrate to use QSerialPort for my serial device from termios calls. The existing code is

    struct termios options;
    tcgetattr(file, &options);
    cfmakeraw(&options);
    options.c_cflag |= CS8 | CSTOPB | CREAD | CLOCAL;
    options.c_lflag &= ~(ECHO | ECHOE);
    tcsetattr(file, TCSANOW, &options);

    and it works. For the QSerialPort, I can set all the options but the ECHO flags. The QSerialPort connects to the device but cannot read it. When I compare the stty settings, between the old code and the QSerialPort, the only difference is the ECHO settings.

    Any idea how to set them? If I manually set them, QSerialPort rests them.

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

      Hi,

      You can get the native handle with QSerialPort::handle and then modify its properties.

      Hope it helps

      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
      1

      • Login

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