wei zou
/
Mbed_Shield_GPRS_AT_Command_Test
this is a AT command test on Mbed Shield
main.cpp
#include "mbed.h" Serial gprs(p28,p27); Serial pc(USBTX,USBRX); int main() { char buffer[64]; int count = 0; pc.baud(19200); gprs.baud(19200); while(1) { if(gprs.readable()) { while(gprs.readable()) { char c = gprs.getc(); buffer[count++] = c; if(count == 64) break; } pc.puts(buffer); for(int i = 0; i < count; i++) { buffer[i] = NULL; } count = 0; } if(pc.readable()) { gprs.putc(pc.getc()); } } }
Changes
Revision | Date | Who | Commit message |
---|---|---|---|
0:c310471929e7 | 2013-11-20 | lawliet | Initial verison of testing AT Commands on Mbed Shield |