QSerialPort's readyRead() signal is working strange
Greetings!
I have encountered a problem I cannot solve.
I am using the QSerialPort device to read/write data from/to my hardware device.
I am encountering problem just after sending a request to start my device's main sequence.
After getting all information my device is sending near a 370 bytes to the serial port via a RS-485->transform device->USB and I am supposed to get the readyRead() signal so I will be able to parse the data. But I do not get the signal at all. Though after I send the second request - I get the readyRead() signal and begin the parsing procedure. And this situation repeats again and again.
Can anyone help me with this?
It seems much that the problem is connected with my PC. I have made a simple terminal software and checked it on my work and at home. On my working pc the software worked well with both directions but at home this terminal is operating in the same strange way as the main software.
Thank everyone in advance!
Re: QSerialPort's readyRead() signal is working strange
Hello! It sounds to me like your problem is related to buffer sizes. 370 bytes is really not much and possibly it is not enough to fill a buffer enough for the network layer to pass on data to the application layer. Buffers can have different sizes on different machines. What happens if you artificially enlarge your packet size? Do you get the readyRead() signal then?
Re: QSerialPort's readyRead() signal is working strange
Quote:
Originally Posted by
Cruz
Hello! It sounds to me like your problem is related to buffer sizes. 370 bytes is really not much and possibly it is not enough to fill a buffer enough for the network layer to pass on data to the application layer. Buffers can have different sizes on different machines. What happens if you artificially enlarge your packet size? Do you get the readyRead() signal then?
Greetings!
I think that's not the problem. I have sent packets of different lengths and nothing ever changed.
However now I am working with a laptop and everythings goes fine...
Also I can tell that I have changed the buffer size within the driver and it did not help as well.
However I will try your advice today - thank you very much