Trimble Outdoors 44326-00-ENG GPS Receiver User Manual


 
3
Software Integration
34
FirstGPS Starter Kit User Guide
Whenever an event is generated, the event data structure is stored
internally in a queue in the library. In order for the application task to
know which events have been generated, a special API function,
navGetEvent, page 63, is used to retrieve FirstGPS events. This
function blocks the calling task (for example, AppTask) until an event
is generated at which point the task is resumed.
In a typical application, the AppTask runs in a simple loop, calling
navGetEvent continuously. When an event is generated by the
FirstGPS library, the function returns the event information, allowing
the application task to call the API function corresponding to the
generated event and process the data. After the event-specific
processing is complete, the application task calls navGetEvent again
and repeats the loop.
Note Event-driven data collection is the preferred method of using
the FirstGPS API calls. Trimble recommends that polled data
collection be used mainly when responding to queries for library data.
For example, when a New Position Fix Available event is generated,
the AppTask calls navGetLastFix, page 66, to retrieve the newly
generated position fix data. The application should avoid scenarios
where it constantly calls API functions, such as navGetLastFix on its
own (scheduled by a timer or while running in an infinite loop).
For information on how to retrieve events properly, refer to the
description of the API function navGetEvent, page 63 .