]> git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/tests/net/cellular/sms/common/smstest.cpp
remove experimental return, cleanup slash_question key
[tmk_keyboard.git] / tmk_core / tool / mbed / mbed-sdk / libraries / tests / net / cellular / sms / common / smstest.cpp
1 #include "CellularModem.h"
2 #include "smstest.h"
3
4 void smstest(CellularModem& modem)
5 {
6 modem.power(true);
7 Thread::wait(1000);
8
9 #ifdef DESTINATION_NUMBER
10 modem.sendSM(DESINATION_NUMBER, "Hello from mbed:)");
11 #endif
12
13 while(true)
14 {
15 char num[17];
16 char msg[64];
17 size_t count;
18 int ret = modem.getSMCount(&count);
19 if(ret)
20 {
21 printf("getSMCount returned %d\n", ret);
22 Thread::wait(3000);
23 continue;
24 }
25 if( count > 0)
26 {
27 printf("%d SMS to read\n", count);
28 ret = modem.getSM(num, msg, 64);
29 if(ret)
30 {
31 printf("getSM returned %d\n", ret);
32 Thread::wait(3000);
33 continue;
34 }
35
36 printf("%s : %s\n", num, msg);
37 }
38 Thread::wait(3000);
39 }
40 }
41
Imprint / Impressum