This example establishes a transparent link between the mbed seial port and the gps on the C027. You can use it to use the standard u-blox tools such as u-center. These tools can then connect to the serial port and talk directly to the GPS receiver. Baudrate should be set to 9600 baud and is fixed. m-center can be downloaded from u-blox website following this link: http://www.u-blox.com/en/evaluation-tools-a-software/u-center/u-center.html

Dependencies:   C027-REVB mbed

Fork of C027_GPSTransparentSerial by u-blox

main.cpp

Committer:
dixter1
Date:
2013-12-15
Revision:
4:a82068d36685
Parent:
3:e62c5d162729

File content as of revision 4:a82068d36685:

#include "mbed.h"
#include "C027.h"

int main() 
{
    C027 c027;
    c027.gpsPower(true,false);
    
    int baud = GPSBAUD;
    
    // open the gps serial port
    Serial gps(GPSTXD, GPSRXD);
    gps.baud(baud);
    
    // open the PC serial port and (use the same baudrate)
    Serial pc(USBTX, USBRX);
    pc.baud(baud);
    
    while (1)
    {
        // transfer data from pc to gps
        if (pc.readable() && gps.writeable())
            gps.putc(pc.getc());
        // transfer data from gps to pc
        if (gps.readable() && pc.writeable())
            pc.putc(gps.getc());
    }
}