LinksPoint GPS Toolkit Reference
GpsRegisterNotifications
Examples | gpsapi.h | Palm OS functions
Registers the wakeup and sleep notifications for a Palm OS application
Examples
// Initialize the GPS library, turn on GPS power if necessary, and open the serial port
// Also load and initialize MathLib
if (GpsInitialize(0, 4800, GPSPROTOCOL_NMEA, GPSENABLE_TRUE) != GPSERROR_NONE)
return true;
// Register wakeup and sleep notifications to we can turn the GPS power on and off
// when the device awakens and goes to sleep
GpsRegisterNotifications(GPSREGNOTIFY_TRUE, appFileCreator);
Parameters
Parameters Description
GPSREGNOTIFY grnNotify GPSREGNOTIFY_TRUE registers notifications with the operating system; GPREGNOTIFY_FALSE unregisters notifications from the operating system
UInt32 uiCreator The Creator ID of the user application using the GPS Library

Return Value
If the Creator ID is successfully registered, then the return value will be GPSERROR_NONE.
Remarks
If the GPS unit is on a Symbol handheld device, the power to the communications port needs to be turned on and off when the unit wakes up or goes to sleep. If you do not turn off the power when the unit goes to sleep, the GPS device remains on and will drain the battery of the device quickly. When grnNotigy is set to GPSREGNOTIFY_TRUE, the GpsRegisterNotifications function tells the Palm OS to notify the application with the Creator ID of uiCreator when the device goes to sleep or wakes up. The application must trap these message codes and call the GpsHandleNotificationEvents function, which will correctly turn on or off the power to the serial port if the device is a Symbol handheld. This function is also used unregister the notifications from the operating system when the grnNotify parameter is set to GPSREGNOTIFY_FALSE. Notifications should be unregistered before terminating the application. If they are not unregistered, the GpsTerminate function will automatically unregister the notifications.
Group
Declaration
GPSERROR GPSAPI GpsRegisterNotifications(GPSREGNOTIFY grnNotify, UInt32 uiCreator);
File
Links
Copyright ©1998-2005 Links Point Inc.