How to send data in QserialPort thread
-
Then move the complete serial port handling to that thread and communicate information back to the main thread when appropriate but there shouldn't be any need to sleeping or blocking.
-
Then move the complete serial port handling to that thread and communicate information back to the main thread when appropriate but there shouldn't be any need to sleeping or blocking.
@SGaist Well, how should I communicate with the serial port thread? Signals/Slots or Concurrency? Which better? You say to shouldn't block, but while writing the send buffer, have to wait in order to be writtenBytes. Then how can I check whether it was written a byte?
-
@SGaist Well, how should I communicate with the serial port thread? Signals/Slots or Concurrency? Which better? You say to shouldn't block, but while writing the send buffer, have to wait in order to be writtenBytes. Then how can I check whether it was written a byte?
-
Please be a bit more patient before bumping your own thread. This is a community forum and people answering here may not live in the same timezone as you.
Signals/Slots, concurrency has nothing to do with inter thread communication.
Why do you have to wait when writing to your serial port ?
-
Please be a bit more patient before bumping your own thread. This is a community forum and people answering here may not live in the same timezone as you.
Signals/Slots, concurrency has nothing to do with inter thread communication.
Why do you have to wait when writing to your serial port ?
-
Are you mixing RS232 and CAN ?
-
-
These are two different buffers so you should get data even if you are writing something to it.
-
You can send that using signals and slots or QMetaObject::invokeMethod.