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
main.cpp
- Committer:
- mazgch
- Date:
- 2013-12-19
- Revision:
- 5:1141d3cfd1ef
- Parent:
- 4:fafdcaf842ee
- Child:
- 6:1e5c9b6b2e90
File content as of revision 5:1141d3cfd1ef:
#include "mbed.h" #include "C027.h" int main() { C027 c027; c027.mdmPower(true); // open the mdm serial port Serial mdm(MDMTXD, MDMRXD); mdm.baud(MDMBAUD); // use hardware flow control to make the connection more reliable mdm.set_flow_control(SerialBase::RTSCTS, MDMRTS, MDMCTS); // open the PC serial port and (use the same baudrate) Serial pc(USBTX, USBRX); 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()); } }