Loscas
Loscas

Reputation: 561

How to emulate a serial port for testing

I neeed to write a device emulator for testing purposes that connects through a serial port. I know there are some apps out there to do this, but that doesn't really help my curiousity, lol. I would like to know how in .net I could write a sniffer to watch the traffic in and out on a serial port. I'm also interested in what suggestions anyone has to accomplish my testing, but I want something in .net and not a 3rd party download.

Upvotes: 1

Views: 3260

Answers (1)

Jim Brissom
Jim Brissom

Reputation: 32969

You can always write a virtual serial port in software and connect your application to that port. There is GPL driver source code out there that should give you a head start on how to do it:

http://com0com.sourceforge.net/

I might have to add, writing a virtual device usually involves writing a driver, something you obviously can't do in a managed language.

Upvotes: 3

Related Questions