SMS test for AbitUSBModem. see: http://developer.mbed.org/users/phsfan/notebook/abitusbmodem/
Dependencies: AbitUSBModem USBHost mbed
main.cpp
- Committer:
- phsfan
- Date:
- 2015-02-25
- Revision:
- 1:f824d480d49e
- Parent:
- 0:26b54873adb6
File content as of revision 1:f824d480d49e:
#include "mbed.h" #include "AbitUSBModem.h" Serial pc(USBTX, USBRX); DigitalOut myled(LED1); void test(void const*) { AbitUSBModem modem; modem.sendSM("07012345678", "Hello mbed"); while(1) { char num[17]; char msg[64]; int ret = modem.getSM(num, msg, 64); if (!ret) { printf("SMS from: %s, message: %s\r\n", num, msg); } Thread::wait(3000); } } int main() { pc.baud(115200); printf("** PHS\r\n"); Thread testTask(test, NULL, osPriorityNormal, 1024 * 4); while(1) { myled = !myled; Thread::wait(1000); } }