this is a AT command test on Mbed Shield

Dependencies:   mbed

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());
        }
    }
}
Committer:
lawliet
Date:
Wed Nov 20 07:53:14 2013 +0000
Revision:
0:c310471929e7
Initial verison of testing AT Commands on Mbed Shield

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lawliet 0:c310471929e7 1 http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f