Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of C027_ModemTransparentSerial by
Revision 9:57346cb22188, committed 2015-10-02
- Comitter:
- MrGu
- Date:
- Fri Oct 02 09:47:53 2015 +0000
- Parent:
- 8:b561b2003e76
- Commit message:
- Talk with GSM modem from serial port
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Jun 12 07:28:57 2014 +0000 +++ b/main.cpp Fri Oct 02 09:47:53 2015 +0000 @@ -1,9 +1,6 @@ #include "mbed.h" -#ifdef TARGET_UBLOX_C027 - #include "C027_api.h" -#else - #error "This example is targeted for the C027 platform" -#endif +#include "C027_api.h" + /* This example is establishing a transparent link between the mbed serial port and the serial communication interface @@ -29,15 +26,19 @@ mdm.set_flow_control(SerialBase::RTSCTS, MDMRTS,MDMCTS); // open the PC serial port and (use the same baudrate) - Serial pc(USBTX, USBRX); + Serial pc(P4_28, P4_29); pc.baud(MDMBAUD); 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()); + } } }