<div dir="ltr"><div dir="ltr">On Thu, Apr 4, 2019 at 6:42 PM Jérôme Godbout <<a href="mailto:godboutj@amotus.ca">godboutj@amotus.ca</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-CA">
<div class="gmail-m_-2723485760183703851WordSection1">
<p class="gmail-m_-2723485760183703851MsoPlainText">You jus did the same loop into your slot, the function I did made can be called as slot to the connect you just told, I agree the serial_port->waitForReadyRead(5); is not necessary, just often the transmission have partial or bunch of
 data by small burst (USB VCOM) and was handy for me, but it is not ncessary in any way.</p></div></div></blockquote><div>A similar loop yes, however your loop goes until there's something to read on the port, mine is run a few times only when the port already has some information pending in its buffer. The QSerialPort class already knows if data has arrived and buffers it*, so what would be the point to loop over the port when there's no data? When you talk with someone do you ask every 5ms if [s]he has something to say to you? I really doubt it. You'd normally just wait for something to be said to decide if and how to respond to it.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-CA"><div class="gmail-m_-2723485760183703851WordSection1">
<p class="gmail-m_-2723485760183703851MsoPlainText">Side note: ReadLines made it less general purpose, you will need a protocol that use endline to signal end of message which is not always the case.</p></div></div></blockquote><div>Involving realistic protocol handling is another kettle of fish. It would require much more thought and effort and is beyond the scope of what was asked initially.<br><br>* Unless it's in unbuffered mode, as Thiago already noted.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-CA"><div class="gmail-m_-2723485760183703851WordSection1"><div><div><div>
</div>
</div>
</div>
</div>
</div>

</blockquote></div></div>