ATT_SMS_System for home security system
Dependencies: FXOS8700CQ MODSERIAL mbed-rtos mbed
Fork of ATT_Cellular_IOT_Button by
Diff: main.cpp
- Revision:
- 46:da9d788f5d5a
- Parent:
- 43:6821a9c78c4b
- Child:
- 47:c07656706ca1
diff -r a836eecd5d12 -r da9d788f5d5a main.cpp --- a/main.cpp Sun Jul 24 17:50:42 2016 +0000 +++ b/main.cpp Sun Jul 24 19:33:23 2016 +0000 @@ -507,6 +507,7 @@ printf(BLU "Sending to modem : %s" DEF "\n", modem_string); sockwrite_mdm(modem_string); sockread_mdm(&MySocketData, 1024, 20); + printf("DONE with READ!\r\n"); // If any non-zero response from server, make it GREEN one-time // then the actual FLOW responses will set the color. @@ -516,9 +517,11 @@ SetLedColor(0x2); } - printf(BLU "Read back : %s" DEF "\n", &MySocketData[0]); + printf(BLU "Read back : %s" DEF "\n", MySocketData.c_str()); char myJsonResponse[512]; - if (extract_JSON(&MySocketData[0], &myJsonResponse[0])) + char stringToCharBuf[1501]; // 1500 is the max length WNC can return + strcpy(stringToCharBuf, MySocketData.c_str()); + if (extract_JSON(stringToCharBuf, &myJsonResponse[0])) { printf(GRN "JSON : %s" DEF "\n", &myJsonResponse[0]); parse_JSON(&myJsonResponse[0]);