Virtual COM Port

M

MDB

Hello All,

I need to be able to create a virtual com port in order to share GPS data
between 2 applications and I have no idea where to start. Can anyone give
me any pointers?

TIA
 
P

Paul G. Tobey [eMVP]

1. Forget about managed code. You'll need to create a device driver and you
can't do that.
2. Get the source code for one of the serial drivers in Windows CE. You'll
need to export the same set of capabilities as a real serial driver, so this
is a reasonable place to start.
3. Modify the Open code in the driver so that multiple clients can have the
port open at once and so that the driver keeps track of them.
4. Implement the Open code so that, when anyone has the virtual port open,
you open the real port. You'll then have to fork off some sort of a read
thread which will periodically do a read of the real port and store that
data somewhere. You might store a copy of each new piece of data in a FIFO
for each process which has the virtual port open. This simplifies the Read
process, since all you have to do is return whatever is next in the FIFO for
the process who is doing the read.
5. Reimplement things like the Wait events so that they are fired at the
right times (when there's enough data in the FIFO for the process who called
WaitCommEvent, etc.)

Paul T.
 
D

Dick Grier

Hi,

What Paul says it on target.

However, unless you are a glutton for this sort of thing, you might want to
look into Franson GPSGate -- which creates the virtual serial port for you.
Look on www.franson.com, where you can download a fully funtional evaluation
version. If you go this route (depending on your application, the licensing
requirments may be simple or more expensive), you can contact me for a quote
on a reduced cost license.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
 
M

MDB

Thank you both for your responses.

Dick, let me take a look at it and get back with you. My goal is to make
this so that there is no user interaction required. I do not want my end
users to have to launch or configure anything.
 
P

Paul G. Tobey [eMVP]

You're going to have to have someone tell you which COM port the GPS is
on...

Paul T.
 
D

Dick Grier

Hi,

It is possible to have your application search for a GPS receiver, and if
one is found, to then close the conventional port and create the virtual
port(s).

However, at some point, I think the user will get involved in configuration
and operation -- after all, if you want some foreign application to use the
virtual port, you (or your user) will have to furnish the port number that
has been created. If you have multiple applications contending for the GPS
receiver, you are going to have trouble. These things have to be staged in
an orderly maner.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
 
M

MDB

My GPS uses COM1 so I think I will be able to set this in the
com.franson.comport.chain.1.ggxml configuration file.

I have been testing the GPSGate today and was able to get it working way I
needed it to however, now I can no longer print which happens to be on COM1
too.
 
M

MDB

While users are in their vehicles, the devices/handhelds are cradled in the
vehicles which have GPS connected to them. Then when they are not in the
vehicle, they are cradled in a printer.


"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:[email protected]...
 
D

Dick Grier

The virtual port would have to be removed if not in use with the GPS.

This sounds tricky to me.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
 
M

MDB

Thanks for your help, I am going to post my question in their forum to see
if it can be done easily.
 
E

Ed Chilada

Hello All,

I need to be able to create a virtual com port in order to share GPS data
between 2 applications and I have no idea where to start. Can anyone give
me any pointers?

Doesn't WM5 already support this? Have a look at:

http://wiki.xda-developers.com/index.php?pagename=WM5_Tweaks_Other
under "Add GPS settings icon". Once you get that, have a play with the
extra icon you get in Settings and it should make sense. I hope that's
what you need.
 
M

MDB

Unfortunately, this will not work for me since I have over 1200 devices
being used through out the country that are 2003. At this time I have no
plans on upgrading them.

Thank you for the info though.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top