WM5 GPS
Previous Topic  Next Topic 

Product

WM5 GPS

Manufacturer

Standard Satellite Forms component

Website

http://www.satelliteforms.net/

Source code provided

Yes

Platform

PocketPC (Windows Mobile 5+)

Sample project(s)

GPS

Keywords

GPS, WM5, location, longitude, latitude, satellite, navigation


The GPS extension provides easy access to GPS data on Windows Mobile 5 and higher devices, via the Windows Mobile GPS API.


Functions include:


GPS_HasGPSAPI

Check whether the current device includes the WM5 GPS API.

USAGE: bHasGPSAPI=GPS_HasGPSAPI()

Returns true or false.


GPS_OpenGPS

Open connection to GPS receiver, powering up GPS receiver if necessary.

USAGE: error=GPS_OpenGPS

Returns 0 if no error, or error code if GPS conection could not be opened.


GPS_CloseGPS

Close connection to GPS receiver, powering down GPS receiver if no other tasks are also using it.

USAGE: error=GPS_CloseGPS()

Returns 0 if no error, or error code if GPS conection could not be opened.


GPS_GetValidFields

Check whether GPS is returning valid position data.

USAGE: validfields=GPS_GetValidFields( maxdataage )

Maxdataage is the maximum age in milliseconds of GPS data that you will accept as current. If the data is older than that, it will be considered invalid.

Returns 0 if no valid position data fields, -1 if the GPS connection has not been opened, or positive value indicating which fields have valid data (each field represented by a bitfield value).

To determine if a specific data type has valid data, AND the GetValidFields value with the Other Information Type value of the data field you want to verify. For example, to verify that the longitude data is valid, do this: if (GPS_GetValidFields() AND &H4)=&H4 then 'longitude data is valid


GPS_GetPosUTCTime

Get UTC Time from GPS position data.

USAGE: UTCtime=GPS_GetPosUTCTime( maxdataage )

Maxdataage is the maximum age in milliseconds of GPS data that you will accept as current. If the data is older than that, it will be considered invalid.

Returns 0 if no valid data, -1 if the GPS connection has not been opened, or UTC Time value in system time format.


GPS_GetPosLatitude

Get Latitude in decimal degrees from GPS position data.

USAGE: latitude=GPS_GetPosLatitude( maxdataage )

Maxdataage is the maximum age in milliseconds of GPS data that you will accept as current. If the data is older than that, it will be considered invalid.

Returns 0 if no valid data, -1 if the GPS connection has not been opened, or latitude data in decimal degrees. Positive numbers indicate North latitude, negative numbers indicate South latitude.


GPS_GetPosLongitude

Get Longitude in decimal degrees from GPS position data.

USAGE: longitude=GPS_GetPosLongitude( maxdataage )

Maxdataage is the maximum age in milliseconds of GPS data that you will accept as current. If the data is older than that, it will be considered invalid.

Returns 0 if no valid data, -1 if the GPS connection has not been opened, or longitude data in decimal degrees. Positive numbers indicate East longitude, negative numbers indicate West longitude.


GPS_GetPosOther

Get other GPS position data, indicated by other information type.

USAGE: otherdata=GPS_GetPosOther( maxdataage, otherdatatype )

Maxdataage is the maximum age in milliseconds of GPS data that you will accept as current. If the data is older than that, it will be considered invalid.

Returns 0 if no valid data, -1 if the GPS connection has not been opened, or requested data value.

See main extension help or sample project for list of other information type values.


Other Information Type Values for GPS_GetPosOther:


UTC_TIME=1 or &H1

LATITUDE=2 or &H2

LONGITUDE=4 or &H4

SPEED=8 or &H8

HEADING=16 or &H10

MAGNETIC_VARIATION=32 or &H20

ALTITUDE_WRT_SEA_LEVEL=64 or &H40

ALTITUDE_WRT_ELLIPSOID=128 or &H80

POSITION_DILUTION_OF_PRECISION=256 or &H100

HORIZONTAL_DILUTION_OF_PRECISION=512 or &H200

VERTICAL_DILUTION_OF_PRECISION=1024 or &H400

SATELLITE_COUNT=2048 or &H800

SATELLITES_USED_PRNS=4096 or &H1000

SATELLITES_IN_VIEW=8192 or &H2000

SATELLITES_IN_VIEW_PRNS=16384 or &H4000

SATELLITES_IN_VIEW_ELEVATION=32768 or &H8000

SATELLITES_IN_VIEW_AZIMUTH=65536 or &H10000

SATELLITES_IN_VIEW_SIGNAL_TO_NOISE_RATIO=131072 or &H20000

GPS_FIX_QUALITY=1048576 or &H100000

GPS_FIX_TYPE=2097152 or &H200000

GPS_FIX_SELECTION=4194304 or &H400000



DocID: 10196  DocDate: 2008-05-28