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. u-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:   mbed

Install mbed Windows Drivers

Make sure you installed the drivers on your windows PC to get the virtual serial port. A installation guideline and the drivers can be found in the following wiki page. /handbook/Windows-serial-configuration

main.cpp

Committer:
mazgch
Date:
2014-06-12
Revision:
3:e8792e374579
Parent:
2:490b4b087576

File content as of revision 3:e8792e374579:

#include "mbed.h"
#ifdef TARGET_UBLOX_C027
 #include "C027_api.h"
#else
 #error "This example is targeted for the C027 platform"
#endif

/* This example is establishing a transparent link between 
   the mbed serial port and the serial communication interface 
   of the GPS. 
   
   For a more advanced driver for the GPS or Modem(MDM) please 
   look at the follwing library and example:
   C027_Support Library 
     http://mbed.org/teams/ublox/code/C027_Support/
   C027_Support Example
     http://mbed.org/teams/ublox/code/C027_SupportTest/
*/
int main() 
{
    c027_gps_powerOn();
    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());
    }
}