> To be able to roll back, in case your reading from the device didn't
result in
what you wanted or you got an error. See QDataStream.
Ah ok I understand.

So this minimal example
QSerialPort sPort;
sPort.open(QIODevice::ReadOnly);

if(sPort.waitForReadyRead(2000)){

  while (!device.atEnd()) {

        if (device.canReadLine()) {

                newData.push_back(device.readLine());

                linesToRead++;

        } else {

                return;

        }

        }

   ...

}

works fine, if I go trough it step by step (maybe, because enouth data
come in). But if I'm to fast it does not work.

If I'm using the signal readyRead I will have the same problem,
because new data come everytime. So I check that in the

readyRead function if a complete line come in, and if no complete line
I return without doing something otherwise I do

something with the data? Is this the right way?


Martin





Thiago Macieira <thiago.macie...@intel.com> schrieb am Di., 2. Apr. 2019,
18:02:

> On Tuesday, 2 April 2019 07:04:03 PDT Martin Marmsoler wrote:
> > Thank you Thiago for your response. But what is transactionstart for?
>
> To be able to roll back, in case your reading from the device didn't
> result in
> what you wanted or you got an error. See QDataStream.
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel System Software Products
>
>
>
> _______________________________________________
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
>
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to