Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: EthernetInterface HTTPClient HTTPServer mbed-rpc mbed-rtos mbed
Revision 1:2c577df21639, committed 2018-07-17
- Comitter:
- daklowprofile
- Date:
- Tue Jul 17 06:08:30 2018 +0000
- Parent:
- 0:36fbb19fb8fb
- Child:
- 2:bf0da8f925e0
- Commit message:
- included with thingsboard connection draft in http_get ; -still not working for thingsboard
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Jul 16 08:51:46 2018 +0000
+++ b/main.cpp Tue Jul 17 06:08:30 2018 +0000
@@ -112,12 +112,22 @@
void http_get(){
char* Server = "http://192.168.1.111/PDRM/api/api_update.php";
+ //char* Server = "http://demo.thingsboard.io/api/v1/aq8Xr1qkEzo1ANb4VQHa/telemetry";
char buffer[256];
HTTPClient http;
+ //HTTPMap map;
+ //map.put("t1r", "application/json");
+
buffer[0] = 0;
sprintf(buffer,"%s?t1=%d,%d,%d&t2=%d,%d,%d&t3=%d,%d,%d",Server,t1red.read(),t1yellow.read(),t1green.read(),t2red.read(),t2yellow.read(),t2green.read(),t3red.read(),t3yellow.read(),t3green.read());
printf("Send to %s\r\n", buffer);
http.get(buffer, buffer , 10); // Execute the URL of urlBuffer
+ /*
+ sprintf(buffer,"{\"t1r\":%d, \"t1y\":%d, \"t1g\":%d, \"t2r\":%d, \"t2y\":%d, \"t2g\":%d, \"t3r\":%d, \"t3y\":%d, \"t3g\":%d, \"active\": false}",t1red.read(),t1yellow.read(),t1green.read(),t2red.read(),t2yellow.read(),t2green.read(),t3red.read(),t3yellow.read(),t3green.read());
+ printf("Send to %s\r\n", buffer);
+ HTTPText inText(buffer, 512);
+ http.post(Server,map,&inText,10);
+ */
}
void traffic_interrupt (char t1, char t2, char t3, int time){