Trimble Outdoors 44326-00-ENG GPS Receiver User Manual


 
A
Using the FirstGPS API
64
FirstGPS Starter Kit User Guide
Trimble recommends that the application have a task dedicated
exclusively to retrieving and processing FirstGPS events. For example,
the entry point of such a task would be:
void eventHandlerTask (void)
{
U32 ulEvent, ulEventData;
+/ Loop forever...
while (1)
{
// Retrieve the FirstGPS event
if (navGetEvent (&gtEventHandlerTask,
&ulEvent,
&ulEventData,
EVENT_WAIT_FOREVER,
EVENT_GET_FIRST) == NAV_OK)
{
processEvent (ulEvent, ulEventData);
}
// Here, sleep a little letting other tasks to complete.
// This is optional, and may not be required by the
// application.
Sleep (10);
}
}
Note In the above example:
(1) gtEventHandlerTask is assumed to be a global variable of the task
control block type relevant to a native RTOS.
(2) The timeout value in navGetEvent() is specified as
EVENT_WAIT_FOREVER. This will suspend the event task until
an event has been generated. Trimble recommends this method for
retrieving events.
(3) Using the method in (2), EVENT_GET_FIRST should be used for
the ucGetFlag parameter. This will retrieve the events in the order in
which they were generated.