Results 1 to 3 of 3

Thread: QSerialPort's readyRead() signal is working strange

  1. #1
    Join Date
    Feb 2016
    Posts
    11
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Question 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!

  2. #2
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Thanks
    101
    Thanked 15 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default 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?

  3. #3
    Join Date
    Feb 2016
    Posts
    11
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: QSerialPort's readyRead() signal is working strange

    Quote Originally Posted by Cruz View Post
    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

Similar Threads

  1. QSerialPort - readyRead stops working
    By ShamusVW in forum Qt Programming
    Replies: 2
    Last Post: 22nd June 2018, 20:20
  2. readyRead signal is not emitted
    By gig-raf in forum Qt Programming
    Replies: 2
    Last Post: 16th February 2016, 09:13
  3. Replies: 10
    Last Post: 3rd January 2015, 13:25
  4. Replies: 4
    Last Post: 17th October 2014, 22:24
  5. QTcpSocket readyRead strange behavior
    By naroin in forum Qt Programming
    Replies: 46
    Last Post: 21st January 2011, 23:28

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.