> On 28 Mar 2017, at 00:48, Murphy, Sean <smur...@walbro.com> wrote:
> 
> I've got a class that inherits from QSerialPort. The bulk of the code in the 
> class is parsing that I'm doing in a slot that is connected to QSerialPort's 
> readyRead() signal. I want to inject known data  into this class as if it's 
> actually coming across the serial port to validate my parsing code, is there 
> any way to do that? Ideally I'd be able to write data in and have it trigger 
> the readyRead() signal, but I'm not seeing any way to do that.
> 
> I know I could write a separate application that writes out one serial port, 
> and then I could cable that back to my other serial port, but I was just 
> looking for a way to do it all in code.
> 
> Sean
> 
> _______________________________________________
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

Hi,

What about writing a “virtual serial port” ?

QSerialPort is a QIODevice, so one thing you can do is to replace it with a 
custom QIODevice where you can write what you from e.g. a “console widget” to 
evaluate what you want from your application.

Cheers
Samuel

Attachment: signature.asc
Description: Message signed with OpenPGP

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to