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. How to read TxD and RxD line states in Rs232 communication with QSerialPort::PinoutSignals?

How to read TxD and RxD line states in Rs232 communication with QSerialPort::PinoutSignals?

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 3.9k 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
    mstankie
    wrote on last edited by
    #1

    Hi! I'm using QSerialPort in my Rs-232 communication app. I'm trying to show in statusBar all the pinout states (DTR, RTS, CTS, ...) and this works fine, but the TxD and RxD states do not change while transmitting or receiving data. Is it a QSerialPort or Windows implementation problem, or do I do something wrong?

    @QSerialPort::PinoutSignals s = serial->pinoutSignals();
    QSerialPort::PinoutSignals txd = QSerialPort::TransmittedDataSignal
    if(txd&s) txdlabel->setStyleSheet("QLabel{ color: black; background-color: yellow;}");
    else txdlabel->setStyleSheet("QLabel{color: gray; background-color: lightgray;}");@

    MaciekS

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kuzulis
      Qt Champions 2020
      wrote on last edited by
      #2

      It is an Windows restrictions. Though, seems and on Linux (with use a POSIX abi) it is impossible to got it.

      So, just skip it. :)

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mstankie
        wrote on last edited by
        #3

        Thanks for fast reply! This time I can skip it, as this is not important for my current task. But - for future reference - how to get that working? It's definetely possible -I saw it in many apps in Windows...

        MaciekS

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kuzulis
          Qt Champions 2020
          wrote on last edited by
          #4

          I never heard about such opportunity (e.g. Windows drivers do not provide this API) and didn't see applications which got a state of TxD/RxD lines. IMHO, it is impossible, but if you can provide an examples (e.g. the mentioned applications that can do it?) then we can try to make something.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mstankie
            wrote on last edited by
            #5

            OK ;) If I have to name the apps, the only one I remember is RealTerm (http://realterm.sourceforge.net/), but it's working there.

            MaciekS

            1 Reply Last reply
            0
            • K Offline
              K Offline
              kuzulis
              Qt Champions 2020
              wrote on last edited by
              #6

              Most likely the RealTerm displays a "fake" status of lines, i.e. simply EV_TXEMPTY and/or EV_RXCHAR events in process of I/O (or something like). Because API for getting state of the TXD/RXD pins doesn't exist.

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mstankie
                wrote on last edited by
                #7

                Thanks for explanation, kuzulis!

                MaciekS

                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