LinksPoint GPS Toolkit Reference
GPSNOTIFYPROC
Examples | gpsapi.h | Notifications | See Also
An application-defined callback function used for communications between the GPS Toolkit and the application
Examples
extern "C" void GpsNotification(GPSNOTIFYCODE gncCode, long lParam1, long lParam2, long lParam3)
{
    switch (gncCode)
    {
        case GPSNOTIFY_DATA_CHANGED:
        {
            GPSPOSITION gpPos;
            gpPos = GpsGetPosition(GPSFORMAT_DEGREES);
            printf("Latitude %lf, Longitude %lf, HDOP %.1lfn", gpPos.dLatitude,
            gpPos.dLongitude, GpsGetHDOP());
        }
        break;
        default:
            printf("%sn", (LPSTR)lParam2);
    }
}

int main(int argc, char* argv[])
{
        GpsSetNotificationCallback((GPSNOTIFYPROC)GpsNotification, 0);

        if (GpsInitialize(0, 4800, GPSPROTOCOL_UNKNOWN, GPSENABLE_FALSE) != GPSERROR_NONE)
        {
            printf("GPS failed to initializen");
            return 0;
        }

        printf("Press enter to start the GPS...n");

        getchar();

        // Start up the GPS Engine

        GpsEnable(GPSENABLE_TRUE);

        printf("Press enter to stop the GPS...n");

        getchar();

        // Shut down everything

        GpsTerminate();

        return 0;
}
Remarks
The GPSNOTIFYPROC type defines a pointer to an application defined callback function.To receive notifications, specify this function with GpsSetNotificationCallback. The function is then called by the GPS Toolkit whenever the status changes in the GPS engine during processing of GPS data.
See Also
Group
Declaration
typedef long (* GPSNOTIFYPROC)(GPSNOTIFYCODE sNotifyCode, long lParam1, long lParam2, long lParam3);
File
Links
Copyright ©1998-2005 Links Point Inc.