LinksPoint GPS Toolkit Reference
GpsSwitchToProtocol
Examples 1 | Examples 2 | Generic GPS Functions | See Also
Causes the GPS Receiver protocol to be re-configured
Examples 1
// Palm OS
       case SwitchProtocolButton:
        {
            GPSPROTOCOL gpProtocol = GpsGetProtocol();
            switch (gpProtocol)
            {
                case GPSPROTOCOL_NMEA:

                    {
                        // Switch Protocol
                        NMEASwitchToSIRF(38400);

                        // Force message checking
                        GpsCheckForData(NULL, NULL);

                        // Wait 3 secs. for command processing
                        SysTaskDelay(SysTicksPerSecond() * 3);
                        GpsSetBaudRate(38400);
                        GpsSetProtocol(GPSPROTOCOL_SIRF);
                    }
                    break;

                case GPSPROTOCOL_SIRF:

                    {
                        // Switch Protocol
                        SirfSwitchToNMEA(1, 1, 1, 3, 1, 1, 4800);

                        // Force message checking
                        GpsCheckForData(NULL, NULL);

                        // Wait 3 secs. for command processing
                        SysTaskDelay(SysTicksPerSecond() * 3);
                        GpsSetBaudRate(4800);
                        GpsSetProtocol(GPSPROTOCOL_NMEA);
                    }
                    break;
            }

        }
Examples 2
// Windows based platforms
       case SwitchProtocolButton:
        {
            GPSPROTOCOL gpProtocol = GpsGetProtocol();
            switch (gpProtocol)
            {
                case GPSPROTOCOL_NMEA:

                    {
                        // Switch Protocol
                        NMEASwitchToSIRF(38400);

                        // Wait 3 secs. for command processing
                        Sleep(3000);
                        GpsSetBaudRate(38400);
                        GpsSetProtocol(GPSPROTOCOL_SIRF);
                    }
                    break;

                case GPSPROTOCOL_SIRF:

                    {
                        // Switch Protocol
                        SirfSwitchToNMEA(1, 1, 1, 3, 1, 1, 4800);

                        // Wait 3 secs. for command processing
                        Sleep(3000);
                        GpsSetBaudRate(4800);
                        GpsSetProtocol(GPSPROTOCOL_NMEA);

                    }
                    break;
            }

        }
Parameters
Parameters Description
GPS_PROTOCOL_SWITCH * pProto The protocol to be set.
Return Value
Returns GPSERROR_NONE on success or GPSERROR_CONFIG on failure.
Remarks
  • This function causes the GPS receiver's protocol to be re-configured, but does not necessarily change the GPS Toolkit's protocol to match. If the protocol used by the GPS Toolkit and the GPS Receiver do not match, communications will be unavailable. See GpsSetProtocol to switch the protocol and GpsSetBaudRate to set the baud rate in use by the Toolkit.

  • The protocols supported by this function currently are NMEA and SiRF. Equivalent functions to perform the same operation are NMEASwicthToSIRF and SirfSwitchToNMEA
See Also
Group
Declaration
File
sirfapi.h
Links
Copyright ©1998-2005 Links Point Inc.