This example establishes a transparent link between the mbed serial port and the modem (LISA or SARA) on the C027. You can use it to use the standard u-blox tools such as m-center or any terminal program. These tools can then connect to the serial port and talk directly to the modem. Baudrate should be set to 115200 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/m-center.html
Fork of C027_ModemTransparentSerial by
main.cpp
- Committer:
- dixter1
- Date:
- 2013-12-15
- Revision:
- 7:90c9258af1aa
- Parent:
- 5:1f5bb69f15d5
File content as of revision 7:90c9258af1aa:
#include "mbed.h" #include "C027.h" DigitalOut mdm_activity(LED); int main() { int led_toggle_count = 5; C027 c027; // enable, and use the uart c027.mdmPower(true,true); // enable the GPS. c027.gpsPower(true, false); #if 0 while(1) { mdm_activity = !mdm_activity; wait(0.2); } #else while( led_toggle_count-- > 0 ) { mdm_activity = !mdm_activity; wait(0.2); } #endif // open the mdm serial port Serial mdm(MDMTXD, MDMRXD); mdm.baud(MDMBAUD); // tell the modem that we can always receive data DigitalOut mdmRts(MDMRTS); mdmRts = 0; // (not using flow control) // open the PC serial port and (use the same baudrate) Serial pc(USBTX, USBRX); pc.baud(MDMBAUD); pc.printf( "M3->UART connection ready\r\n"); while (1) { // transfer data from pc to modem if (pc.readable() && mdm.writeable()) mdm.putc(pc.getc()); // transfer data from modem to pc if (mdm.readable() && pc.writeable()) pc.putc(mdm.getc()); } }