wei zou
/
Mbed_Shield_GPRS_AT_Command_Test
this is a AT command test on Mbed Shield
Homepage
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()); } } }