FakeGPS - Read from COM port


M

Mike Endys

I have application that reads NMEA data from COM port. It works well with
hardware devices. But I need to emulate GPS device. There is FakeGPS
utility, that works with Microsoft sample project, but I need FakeGPS to
work as HW GPS device - I need to read data by my application from COM port.
Is it possible? How to configure the FakeGPS to be able read from COM port?

I have this registry settings:

HKLM\System\CurrentControlSet\GPS Intermediate Driver
IsEnabled = 0x1 (1)

HKLM\System\CurrentControlSet\GPS Intermediate Driver\Drivers
CurrentDriver = TestGPSFile

HKLM\System\CurrentControlSet\GPS Intermediate Driver\TestGPSFile
File1 = \Program Files\FakeGPS\GPSFiles\fakegpsdata.txt
FriendlyName = TestGPSFile
InterfaceType = File
CommPort = COM2:
Baud = 0x2580 (9600)
Iterations = 0x1 (1)
MaxReadSize = 0x78 (120)
MinReadSize = 0x78 (120)
ReadInterval = 0x3E8 (1000)


When I try to open COM2 port I allways get

IOException: at System.IO.Ports.SerialStream.WinIOError(Int32 errorCode,
String str)
at System.IO.Ports.SerialStream..ctor(String portName, Int32 baudRate,
Parity parity, Int32 dataBits, StopBits stopBits, Int32 readTimeout, Int32
writeTimeout, Handshake handshake, Boolean dtrEnable, Boolean rtsEnable,
Boolean discardNull, Byte parityReplace)
at System.IO.Ports.SerialPort.Open()

What I do wrong?

Thanks for answer

Mike
 
Ad

Advertisements

P

Paul G. Tobey [eMVP]

Why not, rather than trying to shim yourself into FakeGPS, just have your
software *open* COM2 and read the GPS data from there?

Paul T.
 
Ad

Advertisements

D

Dick Grier

Hi,

I use Franson GPSTools (www.franson.com). You can "try before buy." If you
decide to purchase, I can provide it at a 30% discount from retail. See my
web site for contact information.

The other option (which I often use), is to simply record GPS data to a text
file, say 10-15 minutes worth). Then, I replay that data back by reading it
from the file and then spit it out a serial port, connected by a null modem
cable or adapter to a second serial port -- which my application opens to
read. If you need more data, simply loop through the file as many times as
needed.

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.
 

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