Implementing GPS Intermediate Driver Hardware IOCTLs

Send Feedback

There are two sets of IOCTLs defined by the GPS Intermediate Driver that manufacturers may be especially interested in implementing: IOCTLs that can shorten the time to make a GPS fix, and an IOCTL for directly returning location information.

Note   The GPS Intermediate Driver also natively supports a series of IOCTLs, including IOCTL_SERVICE_REFRESH, that enable applications to control its execution. These IOCTLs are listed and explained in detail in Controlling GPS Intermediate Driver Execution.

Shortening GPS Fix Time

One downside to GPS is the amount of time it can take to make an initial fix and return location information. The first time GPS hardware is turned on, it can take many minutes before the hardware has enough information from enough GPS satellites to return accurate location information.

Some GPS hardware can shorten this startup time by assuming that the GPS hardware is at the same (or close to the same) location as it was when it was last used. If this is the case, startup time is often reduced by orders of magnitude.

While it's possible for GPS hardware to perform the necessary calculations to minimize startup time in a way completely transparent to the GPS Intermediate Driver, the GPS Intermediate Driver also provides the following IOCTLs to enable manufacturers to expose functionality that can minimize startup time:

These pairs work similarly:

  1. After using the GPS Intermediate Driver for some time, an application calls IOCTL_GPS_READ_ALMANAC and/or IOCTL_GPS_READ_ASSISTED. This returns an opaque data blob that the application saves using some backing store, like flash memory or the Windows CE database (CEDB) interface.
  2. When the application starts again, before it attempts to obtain location information, it calls IOCTL_GPS_WRITE_ALMANAC and/or IOCTL_GPS_WRITE_ASSISTED and provides the information it read in the previous step. The GPS hardware can use this information to minimize startup time.

It is important to note that the data used by these IOCTLs is only meaningful to the GPS hardware. The data is completely opaque to an application using the GPS Intermediate Driver. The degree to which applications can interact with this information is limited to saving the results of IOCTL_GPS_READ_ALMANAC and IOCTL_GPS_READ_ASSISTED and then providing the saved results to the GPS hardware using IOCTL_GPS_WRITE_ALMANAC and IOCTL_GPS_WRITE_ASSISTED.

Returning Location Information Directly, without NMEA strings

The common interchange format for location information are strings that follow the NMEA standard. For more information about the NMEA standard, see this NMEA Web site.

However, the use of NMEA strings results in a common scenario where the GPS hardware forms data - like latitude and longitude - into NMEA strings, only to have these NMEA strings broken down again into their component parts as soon as the application receives the data.

Note   The GPS Intermediate Driver does not currently use the IOCTL and registry settings described in this section, and always uses ReadFile to interact with GPS hardware. This information is provided so that devices that implement this IOCTL can work with a possible future version of the GPS Intermediate Driver that provides direct access by not bypassing NMEA strings.

The GPS Intermediate Driver may in the future provide the ability to bypass NMEA strings using IOCTL_GPS_DRIVER_GET_LOCATION_V1 and the Poll input source registry settings described in GPS Intermediate Driver Poll Registry Settings.

If this is enabled, the GPS Intermediate Driver may use input sources of type Poll to retrieve location information directly, by enabling the GPS hardware to fill a GPS_POSITION structure and to return this structure when the IOCTL_GPS_DRIVER_GET_LOCATION_V1 IOCTL is handled.

See Also

Integrating GPS Hardware with the GPS Intermediate Driver

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.