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 SDFileSystem mbed-rtos mbed wolfSSL
Fork of SimpleDropbox by
Diff: main.cpp
- Revision:
- 0:b20eee676480
- Child:
- 3:0bf592148055
diff -r 000000000000 -r b20eee676480 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Mon Dec 08 12:03:12 2014 +0000
@@ -0,0 +1,39 @@
+#include "mbed.h"
+#include "EthernetInterface.h"
+#include "HTTPClient.h"
+
+#define SHARED_LINK "https://www.dropbox.com/s/m856g2irwzb68uv/test.txt?dl=0"
+
+extern HTTPResult dropbox_get(const char *url, char *buff, int size) ;
+
+EthernetInterface eth;
+HTTPClient http;
+char recvBuff[1024*20];
+
+int main()
+{
+ HTTPResult ret ;
+
+ eth.init(); //Use DHCP
+ printf("Dropbox Shared Link, Starting,...\n") ;
+
+ while(1) {
+ if(eth.connect() == 0)break ;
+ printf("Retry\n") ;
+ }
+ printf("HTTP Client, IP Address is %s\n", eth.getIPAddress());
+
+ printf("Shared Link: %s\n", SHARED_LINK);
+ memset(recvBuff, '\0', sizeof(recvBuff)) ;
+ ret = dropbox_get(SHARED_LINK, recvBuff, sizeof(recvBuff));
+ if (ret == HTTP_OK) {
+ printf("Result: %s\n", recvBuff);
+ } else {
+ printf("Error - ret = %d - HTTP return code = %d\n", ret, http.getHTTPResponseCode());
+ }
+
+ eth.disconnect();
+
+ while(1) {
+ }
+}
