
ControllerBox directs electromechanical equipment in restaurants to display information.
Dependencies: TextLCD MbedJSONValue libMotiv picojson mbed-rtos mbed
Fork of Mbed_MotiVControllerBox by
Diff: main.cpp
- Revision:
- 6:32e6f0048bf1
- Parent:
- 5:e22a1ae893d2
--- a/main.cpp Tue Jan 06 22:18:27 2015 +0000 +++ b/main.cpp Tue Jan 06 22:41:10 2015 +0000 @@ -65,6 +65,42 @@ c.testRequest(); // setup(); // + + + + +//printf("\nTrying to fetch page...\r\n"); +// int ret = http.get("http://core.motiv.jvanbaarsen.com/v1/tables", str, 1024); +// if (!ret) +// { +// printf("Page fetched successfully - read %d characters\r\n", strlen(str)); +// printf("Result: %s\r\n", str); +// c.lcdWriteLine(1, str); +// } +// else +// { +// printf("Error - ret = %d - HTTP return code = %d\n", ret, http.getHTTPResponseCode()); +// } +// +// picojson::value jsonVal; +// char *json = (char*) malloc(strlen(str)+1); +// strcpy(json, str); +// string err = picojson::parse(jsonVal, json, json + strlen(json)); +// printf("res error? %s\r\n", err.c_str()); +// +// string code = jsonVal.get("table").get("code").get<string>(); + + +// int dinner_stat = json["table"]; +// string code = table["code"]; +// +// printf("The status of the dinner is: %d\r\n", dinner_stat); +// printf("Code: %s\r\n", code); + + + + + // pc.printf("Entering loop\r\n"); // // //the endless loop keeps mbed in low power mode