Proximity strip reader

Dependencies:   mbed sfh7779

Fork of StarterKit by Rick McConney

Revision:
6:713b4cbf1a7d
Parent:
5:3417b6a84ee3
Child:
8:b08ec94d9e9f
diff -r 3417b6a84ee3 -r 713b4cbf1a7d main.cpp
--- a/main.cpp	Mon Jul 11 21:34:31 2016 +0000
+++ b/main.cpp	Mon Jul 11 22:05:34 2016 +0000
@@ -168,14 +168,20 @@
 }
 
 int mdm_sendAtCmdRsp(const char *cmd, const char **rsp_list, int timeout_ms, string * rsp, int * len) {
-
     static char cmd_buf[3200];  // Need enough room for the WNC sockreads (over 3000 chars)
-
-    if (cmd && strlen(cmd) > 0) {
+    size_t n = strlen(cmd);
+    if (cmd && n > 0) {
         if (mdm_dbgmask & MDM_DBG_AT_CMDS) {
             printf(MAG "ATCMD: " DEF "--> " GRN "%s" DEF "\n", cmd);
         }
-        mdm.printf("%s\r\n", cmd);
+        while (n--) {
+            mdm.putc(*cmd++);
+            wait_ms(1);
+        };
+        mdm.putc('\r');
+        wait_ms(1);
+        mdm.putc('\n');
+        wait_ms(1);
     }
 
     if (rsp_list) {