Retrieving and Sending GPS Data

The GPS returns the following data:

You can retrieve this data by using the StartCall method to fill PNAPI structures at specified intervals. You then access the required data from these structures. This approach supplies instant data, but the data might be obsolete if not updated frequently.

    To get data from a PNAPI structure

  1. Call StartCall to request that data be placed in PNAPI structures.

    This approach specifies which structures to update and how frequently to update them. You have the following update options:

  2. Call GetData to retrieve data as required.
  3. Call StopCall to terminate updates.

    To send data to a GPS device

  1. Use the SetData method to send data, such as time or position.
  2. Use the SetData method to send configuration data to the registry.

    Do not alter almanac data; it contains GPS satellite location data.

    To format data using the conversion utilities

  1. Retrieve data from a PNAPI structure.
  2. Convert the data to the appropriate format.

    The following table shows the conversion methods that you can use to transform data between different formats.

Method
Description
DegreesToRadians Converts latitude, longitude, and altitude data from degrees to radians
RadiansToDegrees Converts latitude, longitude, and altitude data from radians to degrees
BearingToVelocity Converts one bearing and two speeds to east, north, and up velocities
VelocityToBearing Converts east, north, and up velocities to one bearing and two speeds
PNTMToWintm Converts time from the format specified by the PNAPI PNTM structure to the format specified by the Microsoft® Windows® CE SYSTEMTIME structure
WintmToPNTM Converts time from the format specified by the Windows CE SYSTEMTIME structure to the format specified by the PNAPI PNTM structure