Serial port drivers 
Author Message
 Serial port drivers

I have seen several post in regards to these questions but no answers.
Hopefully someone can point me in the right direction after the have solved
the problem.

I have two application that need similar functionality. These final
applications will public domain so I rather not purchase a driver, but any
ideas welcomed.

First I need to create a virtual serial comm port (COMx) to receive/transmit
data from another app.  Does anyone have sample code that can show me how to
create such a serial driver?

The second is on the same idea, but it  needs to modify the data stream
going to a serial port.  It could use a virtual port and then sent it to a
physical port.  I would rather have a "shim" that would intercept the data
from a physical serial port COM1, modify the data and resend to the same
port.  My first phase of this application is one-way, transmitting from the
PC.

Thanks
Philip Kubat



Sat, 27 Nov 2004 20:57:52 GMT  
 Serial port drivers

Quote:

> I have seen several post in regards to these questions but no answers.
> Hopefully someone can point me in the right direction after the have solved
> the problem.

> I have two application that need similar functionality. These final
> applications will public domain so I rather not purchase a driver, but any
> ideas welcomed.

> First I need to create a virtual serial comm port (COMx) to receive/transmit
> data from another app.  Does anyone have sample code that can show me how to
> create such a serial driver?

> The second is on the same idea, but it  needs to modify the data stream
> going to a serial port.  It could use a virtual port and then sent it to a
> physical port.  I would rather have a "shim" that would intercept the data
> from a physical serial port COM1, modify the data and resend to the same
> port.  My first phase of this application is one-way, transmitting from the
> PC.

> Thanks
> Philip Kubat

As far as creating a "Virtual" Com port... you can certainly transmit
data from one app to another using various methods such as Sockets,
Shared memory, Pipes, or Com to name a few types of IPC (Inter Process
Communication).

From a program point of view Serial communicaton is rather slow, so it
is not really the method of choice for moving data around unless you
need to talk to a serial device.  For a really versatile application I
would suggest using Sockets to transfer the data from app to app, in
the future this would allow you to do this transfer over a network or
the Internet.  See the CAsyncSocket class.

As for your second application this would receive the Socket data,
modify it and then transmit it onto the Com port.  As far as I know it
is not possible, or at least not very easy to create a "shim" to
intercept the data going to a Com port and then redirect it back to
the same Com port.  To do this type of code I would think you would
need to re-write the Uart serial device driver.
Much easier to take Socket data from the other app, process it then
send it to the serial port.  CreateFile can be used to talk to the
serial port.



Sun, 28 Nov 2004 09:43:02 GMT  
 Serial port drivers
Thanks Brad,

I like your idea and which I could control both side of this problem.
Unfortunately I am dealing with pre-existing (I have not control over)
applications.  They only send their data out via serial port and, the
addition functionality I create needs to drive a serial device.

Quote:

> As far as creating a "Virtual" Com port... you can certainly transmit
> data from one app to another using various methods such as Sockets,
> Shared memory, Pipes, or Com to name a few types of IPC (Inter Process
> Communication).

> From a program point of view Serial communicaton is rather slow, so it
> is not really the method of choice for moving data around unless you
> need to talk to a serial device.  For a really versatile application I
> would suggest using Sockets to transfer the data from app to app, in
> the future this would allow you to do this transfer over a network or
> the Internet.  See the CAsyncSocket class.

> As for your second application this would receive the Socket data,
> modify it and then transmit it onto the Com port.  As far as I know it
> is not possible, or at least not very easy to create a "shim" to
> intercept the data going to a Com port and then redirect it back to
> the same Com port.  To do this type of code I would think you would
> need to re-write the Uart serial device driver.
> Much easier to take Socket data from the other app, process it then
> send it to the serial port.  CreateFile can be used to talk to the
> serial port.



Sun, 28 Nov 2004 22:07:44 GMT  
 Serial port drivers
Hi,

The best source code that you can find to help you to develop your "virtual
serial comm port driver" is the source code for the serial driver from the
ddk 4.0 or w2k. It is the source code from which I have based my own
development for a similar virtual serial driver for NT and w2k that we use
internally.

Here are the steps that I have followed :

1. I removed all the code handling the hardware (in fact, I kept only the
code handling the win32 API).

2. I wrote some code which reads from the registry the loopback settings
(com4-com1) etc..

3. I wrote the code that send bytes, modem signals etc.. from one port to
the other.

4. I wrote a small application that configures the driver (creates a new com
port, indicates which com ports will be looped back together etc..).

Be carefull, it is not as easy as it seems because the win32 serial api is
quite complex (lots of call to supports). There's lots of tests to do to be
sure that the virtual serial port will work with different applications.
They all use different APIs and in many different ways.

good luck

Frederic Gauthier


Remove _NO_SPAM from the E-mai address


Quote:
> I have seen several post in regards to these questions but no answers.
> Hopefully someone can point me in the right direction after the have
solved
> the problem.

> I have two application that need similar functionality. These final
> applications will public domain so I rather not purchase a driver, but any
> ideas welcomed.

> First I need to create a virtual serial comm port (COMx) to
receive/transmit
> data from another app.  Does anyone have sample code that can show me how
to
> create such a serial driver?

> The second is on the same idea, but it  needs to modify the data stream
> going to a serial port.  It could use a virtual port and then sent it to a
> physical port.  I would rather have a "shim" that would intercept the data
> from a physical serial port COM1, modify the data and resend to the same
> port.  My first phase of this application is one-way, transmitting from
the
> PC.

> Thanks
> Philip Kubat



Mon, 29 Nov 2004 03:39:35 GMT  
 Serial port drivers

Quote:

> Thanks Brad,

> I like your idea and which I could control both side of this problem.
> Unfortunately I am dealing with pre-existing (I have not control over)
> applications.  They only send their data out via serial port and, the
> addition functionality I create needs to drive a serial device.

I can't help with what you're looking for, but I thought I'd mention
another possible solution.  The last time I needed something like this I
just wired COM1 to COM2 and wrote an application to pass the COM2
traffic over winsock.  The pre-existing app on COM1 then worked normally
to a remote device.

--
Scott McPhillips [VC++ MVP]



Mon, 29 Nov 2004 08:21:18 GMT  
 Serial port drivers
Hi all,

I am a beginner for driver development. I am now also want to write a
"Virtual serial comm port driver", is there any doc. / sources / help to
give me more details ?

Thanks


Quote:
> Hi,

> The best source code that you can find to help you to develop your
"virtual
> serial comm port driver" is the source code for the serial driver from the
> ddk 4.0 or w2k. It is the source code from which I have based my own
> development for a similar virtual serial driver for NT and w2k that we use
> internally.

> Here are the steps that I have followed :

> 1. I removed all the code handling the hardware (in fact, I kept only the
> code handling the win32 API).

> 2. I wrote some code which reads from the registry the loopback settings
> (com4-com1) etc..

> 3. I wrote the code that send bytes, modem signals etc.. from one port to
> the other.

> 4. I wrote a small application that configures the driver (creates a new
com
> port, indicates which com ports will be looped back together etc..).

> Be carefull, it is not as easy as it seems because the win32 serial api is
> quite complex (lots of call to supports). There's lots of tests to do to
be
> sure that the virtual serial port will work with different applications.
> They all use different APIs and in many different ways.

> good luck

> Frederic Gauthier


> Remove _NO_SPAM from the E-mai address



> > I have seen several post in regards to these questions but no answers.
> > Hopefully someone can point me in the right direction after the have
> solved
> > the problem.

> > I have two application that need similar functionality. These final
> > applications will public domain so I rather not purchase a driver, but
any
> > ideas welcomed.

> > First I need to create a virtual serial comm port (COMx) to
> receive/transmit
> > data from another app.  Does anyone have sample code that can show me
how
> to
> > create such a serial driver?

> > The second is on the same idea, but it  needs to modify the data stream
> > going to a serial port.  It could use a virtual port and then sent it to
a
> > physical port.  I would rather have a "shim" that would intercept the
data
> > from a physical serial port COM1, modify the data and resend to the same
> > port.  My first phase of this application is one-way, transmitting from
> the
> > PC.

> > Thanks
> > Philip Kubat



Sat, 11 Dec 2004 00:56:02 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Vxd, serial port driver

2. Reliable serial port driver for PC?

3. VxD, Serial port driver

4. Serial port drivers

5. Device Drivers for the Serial and Parallel Ports

6. Serial port to serial port copying software

7. Challenge: Virtual serial ports from real serial port

8. System Tray ICON for Serial PC card: uses standard serial driver

9. using PC/104 serial expansion board with WinCE, 4 serial ports total

10. Parallel port/ Serial port

11. I want open the COM1 Port (serial Port)

12. Serial I/O Device Driver

 

 
Powered by phpBB® Forum Software