virtual GPS com port for vista?

Dear experts,

We have a GPS device in our hardware it will expose one serial(COM) port for GPS data updation.Here if some application opens that com port and reads data continuously for long time, no other applications can conncet to that same port because its already busy.we want the GPS data to be available for multiple applications parallay by creating some virtual GPS com ports in the system.

my approach is:

write one virtual comport driver and one com port virtualizaion application.The application will display all the free comports available in the system at that time by reading the registry values(COMDB).
And user can select the desired com port numbers for virtualization.

Now in virtual Com port driver I am trying to create FDO for each virtualized com por,and creating symnbolic
link with comport number like “COM6”,“COM8”. And when ever some application tries to open these virtual com port
and reads the data by using read file I am trying to forward this read request to actual GPS com port ( i will open the
actualcom port say for example “com3” and kepp its connction till my driver goes down) and will update the same serial data
to the application.

I have some questions on this idea:

Q1:For my problem , is this really a good idea to implement virtual gps com ports?
Q2:If this is correct, my apporach is in correct way i.e. one virtualization application for allowing the user choice of com port virtualization and virtual com port driver?
Q3:my design of virtual com port driver is correct?
my idea is very simple : in virtual com port driver just open the real physical com
port and create FDO’s for each of virtualzed com port and whenever sombody reads the data from virtual com port just issue read request to the actual com port and return the same data to the applicstion.

Please suggest me the procedure to do? I am working for windows vista.

Thanks in advance,
Are

Do you control the application(s) which are opening the GPS device? Serial ports are exclusive for a reason and making them multiplexed is fraught with error. The way you designed it, each application can read a chunk of data and if that is only partial piece of data (let us say just a header), another application can read the data associated with the header, stealing the first app’s data. I would not recommend sharing at the com port level.

Regardless of how you do this, the application should NEVER read the comdb directly. It should enumerate the com device interface using setupapi or read the SERIALCOMM key to find the currently existing com ports.

d

If you have control of the applications, this is what I would do

  1. create a service, have the service open the com port and read the data
  2. have the service register as an RPC server
  3. have each app connect to the service as an RPC client
  4. multiplex the data that you read in the service to each RPC client

OR instead of a service, install a root enumerated UMDF driver and then do the reading from the UMDF driver. Each application opens a handle to the UMDF driver and you do the muxing over each file handle.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Wednesday, December 12, 2007 6:39 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] virtual GPS com port for vista?

Dear experts,

We have a GPS device in our hardware it will expose one serial(COM) port for GPS data updation.Here if some application opens that com port and reads data continuously for long time, no other applications can conncet to that same port because its already busy.we want the GPS data to be available for multiple applications parallay by creating some virtual GPS com ports in the system.

my approach is:

write one virtual comport driver and one com port virtualizaion application.The application will display all the free comports available in the system at that time by reading the registry values(COMDB).
And user can select the desired com port numbers for virtualization.

Now in virtual Com port driver I am trying to create FDO for each virtualized com por,and creating symnbolic
link with comport number like “COM6”,“COM8”. And when ever some application tries to open these virtual com port
and reads the data by using read file I am trying to forward this read request to actual GPS com port ( i will open the
actualcom port say for example “com3” and kepp its connction till my driver goes down) and will update the same serial data
to the application.

I have some questions on this idea:

Q1:For my problem , is this really a good idea to implement virtual gps com ports?
Q2:If this is correct, my apporach is in correct way i.e. one virtualization application for allowing the user choice of com port virtualization and virtual com port driver?
Q3:my design of virtual com port driver is correct?
my idea is very simple : in virtual com port driver just open the real physical com
port and create FDO’s for each of virtualzed com port and whenever sombody reads the data from virtual com port just issue read request to the actual com port and return the same data to the applicstion.

Please suggest me the procedure to do? I am working for windows vista.

Thanks in advance,
Are


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

It is interesting problem. I don’t want to speak for Are but there is a lot of existing GPS apps which expect access to COM port and which can’t be changed (easily).

AFAIK GPS devices generate stream of text-like data with current position. It seems like stream of strings with specified format. I presume application starts reading data and ignores them until next string starts. Then it reads the whole string, processes it and so on.

The problem with original idea is as Doron said. Applications would reads chunks of data and hardly get full position string. I’d take it a bit differently. The driver should behave like virtual GPS device with several (virtual) COM ports. It should read GPS data on its own continuously and propably push them in parallel to simulated FIFOs for every virtual COM ports. Applications would open ports and read them standard way. FIFO overflow should be handled the same way as real UART built in GPS does. Well, it is just an idea and things wouldn’t be so easy (different baudrates for example). But I guess it could be possible to implement.

OTOH if application can be controlled, it’d be much easier. I’d probably write a driver or service which’d read GPS data from the device, process them internally and provide interface to get current GPS position. IOCTL or some form of interprocess call. No need to stay with COM protocol.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]


From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Doron Holan[SMTP:xxxxx@microsoft.com]
Reply To: Windows System Software Devs Interest List
Sent: Thursday, December 13, 2007 6:37 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] virtual GPS com port for vista?

Do you control the application(s) which are opening the GPS device? Serial ports are exclusive for a reason and making them multiplexed is fraught with error. The way you designed it, each application can read a chunk of data and if that is only partial piece of data (let us say just a header), another application can read the data associated with the header, stealing the first app’s data. I would not recommend sharing at the com port level.

Regardless of how you do this, the application should NEVER read the comdb directly. It should enumerate the com device interface using setupapi or read the SERIALCOMM key to find the currently existing com ports.

d

If you have control of the applications, this is what I would do

  1. create a service, have the service open the com port and read the data
  2. have the service register as an RPC server
  3. have each app connect to the service as an RPC client
  4. multiplex the data that you read in the service to each RPC client

OR instead of a service, install a root enumerated UMDF driver and then do the reading from the UMDF driver. Each application opens a handle to the UMDF driver and you do the muxing over each file handle.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Wednesday, December 12, 2007 6:39 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] virtual GPS com port for vista?

Dear experts,

We have a GPS device in our hardware it will expose one serial(COM) port for GPS data updation.Here if some application opens that com port and reads data continuously for long time, no other applications can conncet to that same port because its already busy.we want the GPS data to be available for multiple applications parallay by creating some virtual GPS com ports in the system.

my approach is:

write one virtual comport driver and one com port virtualizaion application.The application will display all the free comports available in the system at that time by reading the registry values(COMDB).>
And user can select the desired com port numbers for virtualization.

Now in virtual Com port driver I am trying to create FDO for each virtualized com por,and creating symnbolic
link with comport number like “COM6”,“COM8”. And when ever some application tries to open these virtual com port
and reads the data by using read file I am trying to forward this read request to actual GPS com port ( i will open the
actualcom port say for example “com3” and kepp its connction till my driver goes down) and will update the same serial data
to the application.

I have some questions on this idea:

Q1:For my problem , is this really a good idea to implement virtual gps com ports?
Q2:If this is correct, my apporach is in correct way i.e. one virtualization application for allowing the user choice of com port virtualization and virtual com port driver?
Q3:my design of virtual com port driver is correct?
my idea is very simple : in virtual com port driver just open the real physical com
port and create FDO’s for each of virtualzed com port and whenever sombody reads the data from virtual com port just issue read request to the actual com port and return the same data to the applicstion.

Please suggest me the procedure to do? I am working for windows vista.

Thanks in advance,
Are


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer