Recent

Author Topic: WinCE GPS Handling  (Read 4880 times)

BioHazard

  • Jr. Member
  • **
  • Posts: 57
  • Starless...
WinCE GPS Handling
« on: April 19, 2012, 09:07:12 pm »
[Skip this intro for main subject:] In this days I tried GPS on my windows mobile 6.5 while traveling. I was at night in some dangerous place so I found GPS with google maps quite useful for calculating distance left to safe place and so on. Garmin has not detailed maps in my country and seems will never have. Google maps uses internet connection and runs battery down in 3-4 hours. So i decided i need an ultimate app with pre caching Google maps for some area and using GPS.

For the beginning I need to get latitude and longitude for some point to try to calculate distance walked by me.

So how to get my coordinates.

I know there is some dll in windows mobile for working with gps.

But are there some units for higher level to work with gps ?

Or does anybody have some examples ?

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7510
Re: WinCE GPS Handling
« Reply #1 on: April 19, 2012, 09:54:58 pm »
Afaik Tomtom used to communicate with GPS over serial?

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: WinCE GPS Handling
« Reply #2 on: April 20, 2012, 02:04:03 pm »
Yes, AFAIR, in Windows Mobile 6.x the internal GPS is represented as a COM/serial port which you can presumably read out using e.g. synaser, then presumably parse the NMEA output to get position info.
Have no experience with this though...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

BioHazard

  • Jr. Member
  • **
  • Posts: 57
  • Starless...
Re: WinCE GPS Handling
« Reply #3 on: April 20, 2012, 02:45:07 pm »
Afaik Tomtom used to communicate with GPS over serial?
It seems wince has gps intermediate driver called gpsapi.dll.

It has 4 main methods for opening and closing avaliable gps device if any exists on platform and for getting position and for checking device state.

GPSGetPosition method returns following structure:

http://msdn.microsoft.com/en-us/library/bb202062.aspx

typedef struct _GPS_POSITION {
  DWORD dwVersion;
  DWORD dwSize;
  DWORD dwValidFields;
  DWORD dwFlags;
  SYSTEMTIME stUTCTime;
  double dblLatitude;
  double dblLongitude;
  float  flSpeed;
  float  flHeading;
  double dblMagneticVariation;
  float  flAltitudeWRTSeaLevel;
  float  flAltitudeWRTEllipsoid;
  GPS_FIX_QUALITY     FixQuality;
  GPS_FIX_TYPE        FixType;
  GPS_FIX_SELECTION   SelectionType;
  float flPositionDilutionOfPrecision;
  float flHorizontalDilutionOfPrecision;
  float flVerticalDilutionOfPrecision;
  DWORD dwSatelliteCount;
  DWORD rgdwSatellitesUsedPRNs[GPS_MAX_SATELLITES];
  DWORD dwSatellitesInView;
  DWORD rgdwSatellitesInViewPRNs[GPS_MAX_SATELLITES];
  DWORD rgdwSatellitesInViewElevation[GPS_MAX_SATELLITES];
  DWORD rgdwSatellitesInViewAzimuth[GPS_MAX_SATELLITES];
  DWORD rgdwSatellitesInViewSignalToNoiseRatio[GPS_MAX_SATELLITES];
} GPS

this structure contains all useful information

so i have to make good unit for that dll and thats all.