Emulation of Serial Device

Hello,

i am inexperienced in driver development.
I would like to create a driver to emulate the presence of a serial device (which I don’t have).
The purpose is to be able to test my application (which should communicate with the device) without the device being physically connected to the pc.
I was thinking of using a Bus driver that emulates my device on a PDO and a VirtualSerial driver.
I would therefore like to use the FDO of the bus driver to exchange data with my application connected to the VirtualSerial driver.
is that a correct way to proceed? is there any better solution?

You don’t need the complexity of a bus driver, for gosh sakes. Just embed your device’s behavior into the VirtualSerial or VirtualSerial2 sample.

Seems like an awful lot of work for a test fixture.

Why not plug a USB serial adapter, connect it to a second machine, and write an app on that second machine that generates whatever data you expect?

Peter

1 Like

Seen this? https://damn99.com/en/2021-03-13-com0com/

The solution I am currently using is the “physical” one, using two USB serial adapters and a null modem cable to run everything on the same machine.
However, looking ahead, this solution should be run on a virtual machine server to run full automated non-regression tests on future developments ( and extend the solution to different devices).
the com0com project seems to be an optimal solution for my needs.

thanks a lot.

Simone

Most (all?) hypervisors include serial ports that can connect to either a
network socket or a named pipe (hyperv for example). You can then just
put your test program on the other end of that connection. As long as you
are not trying to exercise modem signals etc you should be able to do basic
testing.

Mark Roddy

2 Likes