GPSDriverNMEA library

agraham

Expert
Licensed User
Longtime User
This library works alongside the GPSDriver library, or standalone, and provides access to the NMEA sentences that are being parsed by the GPS Intermediate Driver. Like the GPSDriver library it will only work on devices that implement the GPS Intermediate Driver - generally Windows Mobile 5.0 or later devices fitted with an internal GPS receiver. .NET 2.0 or later needed. This library lets you cross check the results from GPSDriver and was written to help me in the development of the original GPSDriver code.

As usual demo, help and source for merging are included with the library.
 

Attachments

  • GPSDriverNMEA1.0.zip
    10.6 KB · Views: 286

derez

Expert
Licensed User
Longtime User
NMEA lib

Agraham
Thank you for providing us with this library.
Although with the excelent functionality of the new GPSDriver it seems un-necessary - I still think it is useful for debuging. I find devices which behave in a different way then others and this lib might help.

:sign0188:
 

Merlot2309

Active Member
Licensed User
Longtime User
Hello,

Yes, yes and :sign0162:
After searching, trying, reading so much finally I found this.
It works perfect on my HTC Touch Diamond 2 with a very fast fix as well.

I do thank you from the bottom of my heart.
Helen.
 

nl1007

Member
Licensed User
Longtime User
I downloaded this, but the help file displays an error:
"Navigation to the webpage was canceled"
Is there a list of its functions and properties anywhere else?

Edit: I found a mention of this problem, here: http://www.b4x.com/forum/official-updates/3268-new-gpsdriver-library.html#post18334
I 'unblocked' it, and now it works..

It would probably be more useful to be able to read the (complete) NMEA messages from the GPS Driver, particularly if you could select particular ones, e.g. GGA or RMC..
 
Last edited:

agraham

Expert
Licensed User
Longtime User
It would probably be more useful to be able to read the (complete) NMEA messages from the GPS Driver, particularly if you could select particular ones, e.g. GGA or RMC..
It would but they aren't available ready parsed as complete sentences from the Windows Intermediate Driver and, without using a serial port emulation which was the whole point of implementing GPSDriver and GPSDriverNMEA, the GPS data is only available as a read on-demand stream.

If you want the complete ready parsed sentences then use GPSSerial. This should work in conjunction with the virtual serial ports provided by the Windows Intermediate Driver, or indeed an actual serial port, except on certain devices (like some HTC and rebadged HTC devices) that are known to have problems with the .NET Serial Port class (which was the main impetus for writing GPSDriver and GPSDriverNMEA).
 

nl1007

Member
Licensed User
Longtime User
Surely the GPS driver library must assemble NMEA sentences from the stream, in order to extract the appropriate details; I was just thinking that if it (or this) made the 'last decoded' version of each message type (e.g. GGA, GSA or RMC) available, then if somebody wanted details not currently available, they could extract it from an already validated message, rather than duplicating that functionality..
I would like to get the 'Position fix indicator' value from the GGA message, so I can tell if DGPS is being used (i.e. the EGNOS satellite(s) are visible)..
 

agraham

Expert
Licensed User
Longtime User
Surely the GPS driver library must assemble NMEA sentences from the stream, in order to extract the appropriate details.
Nope. The Windows Intermediate Driver (WIM) does that and provides a structure on demand via a system call with the latest individual items of data. The GPSDriver library gets this structure from the WIM and returns the individual data items as properties. If you are interested you can see the source code for the library in GPSDriver.cs in the Libraries folder.

In order to emulate GPSDriver the GPSSerial library does have to parse the NMEA sentences and, as I said, also makes them individually available. They are not validated but do include the checksum if you want to do validation. Again you can see the source code in the library archive. GPSSerial only parses out four sentences but the raw unparsed stream is available from its NMEA port if you want to parse out any other data. Alternatively, if you have VS2005 or later you could build an enhanced library adding the parsing for extra sentences which would be a trivial exercise. If you don't have the capability I would be happy to add any sentences you wanted.
 

navman

Member
Licensed User
Longtime User
NMEA parsing request

Alternatively, if you have VS2005 or later you could build an enhanced library adding the parsing for extra sentences which would be a trivial exercise. If you don't have the capability I would be happy to add any sentences you wanted.

Hello,
I'm attempting to write some tactical yacht racing software for my use that requires NMEA input from not only a GPS but also a wind instrument. From my reading regarding GPSDriver I understand that the NMEA parsing is "closed" due to processing by the intermediate driver. I thought I would have to go back to Serial2 until I came across your newer GPSSerial 1.3 that emulates the methods from GPSDriver and means I can reuse quite a bit of newer sample code. (this is quite a learning curve for me as I last programmed in uP assembler - although I am enjoying learning the basic4ppc environment).

The one stumbling block I have would seem to be the parsing of the MWV NMEA sentence. I would be most grateful if you could extend your offer above to include this sentence in the library. If you are able to do so, I can come back with further details for you on the format of the sentence if necessary.
Many thanks in advance.
Greg
 

agraham

Expert
Licensed User
Longtime User
I've deleted the original message here because I thought of a better idea.

Try the attached. There are two new read/write properties, GETUSER1 and GETUSER2. If you write to either of them a case-sensitive prefix such as "$GPMWV" then you should be able to read from that property the last NMEA sentence received with that prefix. There is no restriction on when you can change them, they take effect any time.

Post if it works, or doesn't. There are a couple of very minor bug fixes in as well that weren't worth reposting the library for before so I'll repost it properly when it works.
 

Attachments

  • GPSSerial1.31.zip
    9.2 KB · Views: 44

navman

Member
Licensed User
Longtime User
re: NMEA parsing request

Wow - that was quick. Thanks Andrew. Looks like a good option to get additional sentences read.
I've been studying the example code again and now suspect that the "cleanest" way to be able to access the properties in the MWV sentence will be to write a "GetWindData" "method" that populates various property variables relating to that sentence. This would run after obtaining the MWV NMEA sentence. Clearly basic GPS data is but a subset of the full NMEA library and each sentence has its own format to deal with.
I also assume from the text in your help file that it is OK to have the GPSserial and NMEA ports open at the same time? The NMEA data from GPS and wind instrument is combined in an external device so all comes in on one serial (bluetooth) port. If you have other suggestions on how to approach the task, please forward.
The NMEA device is currently being installed on the boat so I'll let you know how things go when it's all up and running and I can write and test some code.
Greg
 

agraham

Expert
Licensed User
Longtime User
the "cleanest" way to be able to access the properties in the MWV sentence will be to write a "GetWindData" "method" that populates various property variables relating to that sentence.
StrSplit into a structure is probably the way to go. It is efficient and you can name the structure items appropriately.
it is OK to have the GPSserial and NMEA ports open at the same time?
It's actually necessary to have the GPS open to get NMEA. The present help is not clear on this but the next help version will clarify that.
 

icaedp

New Member
Licensed User
Sample code

Could you post a sample code about using gpsuser1 in conjuction with gpsnmea to catch latitude and longitude?
thanks
 

agraham

Expert
Licensed User
Longtime User
gpsuser1 in conjuction with gpsnmea
Presumably you mean GetUser1 not gpsuser1 but I don't know what you mean by gpsnmea. If you mean GPSDriverNMEA then GetUser1 is not appplicable as I have only added it to GPSSerial.

@Navman - I think this discussion of altering GPSSerial is out of place in the GPSDriverNMEA thread. When you repost whether it works or not please start a new thread in the "Questions and Help Needed" forum.
 
Top