LinksPoint GPS Toolkit Reference
SirfGetEphemeris
Examples | SiRF Specific functions | See Also
Gets ephemeris data from a SiRF receiver
Examples
    SIRF_GPSSATELLITES_EX GpsSatellitesEx;      // SiRF extended satellite structure
    SIRF_PACKED_EPHEMERIS Frame;            // Subframe data
    SIRF_EPHEMERIS_DATA Ephdata[MAX_SVID_CNT];  // Engineering parameters
    unsigned short usSvid = 0;

        //Get Satellite info
        SirfGetSatellitesEx(&GpsSatellitesEx);
        // Satellite Struct is channel based, obtain SVID
    for ( int i = 0; i < GPS_NUMBER_OF_CHANNELS; i++ )
    {
        if (GpsSatellitesEx.gsSatelliteEx[i].fEphemerisAvailable )
        {
            usSvid = GpsSatellitesEx.gsSatelliteEx[i].usID;
            SirfPollEphemeris(usSvid);
            Sleep(3000);
            SirfGetEphemeris(usSvid,&Frame);
            // Decode obtains engineering parameters
            SirfDecodeEphemeris(&Frame,&Ephdata[usSvid -1]);
        }
    }
Parameters
Parameters Description
SIRF_PACKED_EPHEMERIS * pFrame Pointer to SIRF_PACKED_EPHEMERIS.
ulSvid Range 0 to 32.
Return Value
Returns GPSERROR_NONE on success or GPSERROR_CONFIG on failure.
Remarks
  • Call SiRFPollEphemeris before this function to cause the receiver to output the data

  • The user is responsible for allocating and freeing the memory for the parameter(s).
See Also
Group
Declaration
GPSERROR GPSAPI SirfGetEphemeris(unsigned short usSvid, SIRF_PACKED_EPHEMERIS * pFrame);
File
sirfapi.h
Links
Copyright ©1998-2005 Links Point Inc.