Reputation: 23236
I am using a combination of hardware and virtual serial ports in a ANSI C Windows 7 environment. In this project, there will be two applications: The first application is being developed and will be connected both to a hardware COM port and to a virtual COM port. The second is a legacy application (has already been developed and cannot be changed) It will be connected only to the same virtual COM port via a virtual NULL modem.
In the first application, COM event handlers can be used for listening to and handling messages generated from a serial message generator connected to the hardware COM port. However, virtual COM ports do not generate COM events, and so I am limited to using timing loops to periodically check the simulated in and out queues of the virtual port. This is fine for controlling COM traffic in the first application, but the second application will need to see a COM event to enable it to process incoming serial traffic.
Is there a way to generate Windows COM (RS232) events programmatically in one application such that a legacy application that is expecting COM events, can see them?
By events, I am referring to those recognized by a typical comcallback, such as: LWRS_RXCHAR, LWRS_RXFLAG, LWRS_TXEMPTY, LWRS_CTS, etc.
Upvotes: 0
Views: 575
Reputation: 23236
Just closing the loop here (a little late), Thanks for the attempt @Evert.
The solution was to select the right vendor. We needed a good kernel mode driver to produce the right configuration of virtual com port. Eltima (www.eltima.com) provided a product that did just that. Great product with a usable API. Problem solved
Upvotes: 0
Reputation: 593
I don't know if this will work, but you can try to make a loopback on the legacy COM interface? Then you can write to it and it will trigger COM events.
Upvotes: 0