Implementing GPS Intermediate Driver Hardware IOCTLs (Windows Embedded CE 6.0)
There are two sets of IOCTLs defined by the GPS Intermediate Driver (GPSID) 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.
|The GPSID also natively supports a series of IOCTLs that enable applications to control its execution. These IOCTLs are listed and explained in detail in Controlling GPS Intermediate Driver Execution.|
The first time GPS hardware is turned on; it can take several minutes to return accurate location fix information.
Some GPS hardware can shorten this startup time, by orders of magnitude, by assuming that the GPS hardware is at the same (or close to the same) location as it was when it was last used.
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 (GPSID), the GPSID also recognizes the following IOCTLs to enable manufacturers to expose functionality that can minimize startup time:
IOCTL_GPS_READ_ALMANAC and IOCTL_GPS_WRITE_ALMANAC - GPS almanac information.
IOCTL_GPS_READ_ASSISTED and IOCTL_GPS_WRITE_ASSISTED - Other location information; for example, mobile phone towers.
These pairs work similarly:
After using the GPSID 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 Embedded CE database (CEDB) interface.
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 opaque data blob 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 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.