LinksPoint GPS Toolkit Reference
Up | Next
GpsCheckForData
Examples | Palm OS functions | See Also
Checks for and interprets new data arriving from the GPS device
Examples
static Boolean MainFormHandleEvent(EventPtr eventP)
{
    Boolean handled = false;
    FormType * frmP;
    long lBytesRead = 0;

    switch (eventP->eType)
    {
    case nilEvent:
        int iLastPos = 0;
        int iPos = 0;

        do
        {
                if (GpsCheckForData(&lBytesRead, NULL) == GPSERROR_NONE)
                {
                        if (lBytesRead)
                        {
                            GPSDATASTRUCT gpsData;
                            GpsGetData(&gpsData);
                            .
                            // Check the latest data here
                            .
                            .
                        }
                }
        }
    }
}
Parameters
Parameters Description
plBytesRead Pointer to number of bytes read from the GPS device during the data check
pulDataMask Pointer to the data mask for the types of data that have been changed. This value can be NULL if no data masks are requested, or any combination of the Data Masks
Return Value
If the GPS library has successfully read data from the GPS device, then the return value will be GPSERROR_NONE. Otherwise the return value will be GPSERROR_NO_DATA.
Remarks
This function is for Palm OS only. Since the Palm OS cannot utilize threads, you must request the GPS library to check for new data sent from the GPS device. This function will return the total number of bytes read from the device and whether data has been processed. This function is best used during handling of the nilEvent of a Form to occasionally check the GPS for data when no other events are taking place.
See Also
Group
Links
Copyright ©1998-2005 Links Point Inc.