Tom De Smedt / Mbed 2 deprecated EthernetBM

Dependencies:   C12832_lcd EthernetNetIf HTTPClient_ToBeRemoved mbed

Fork of TwitterExample by Donatien Garnier

Files at this revision

API Documentation at this revision

Comitter:
TomDS
Date:
Mon Nov 25 11:37:32 2013 +0000
Parent:
3:2f8261781bf8
Child:
5:e68d9f6a8866
Commit message:
Biomedische => Michiel

Changed in this revision

C12832_lcd.lib Show annotated file Show diff for this revision Revisions of this file
EthernetNetIf.lib Show annotated file Show diff for this revision Revisions of this file
HTTPClient.lib Show diff for this revision Revisions of this file
HTTPClient_ToBeRemoved.lib Show annotated file Show diff for this revision Revisions of this file
TwitterExample.cpp Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/C12832_lcd.lib	Mon Nov 25 11:37:32 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/dreschpe/code/C12832_lcd/#8f86576007d6
--- a/EthernetNetIf.lib	Fri Jul 09 14:49:52 2010 +0000
+++ b/EthernetNetIf.lib	Mon Nov 25 11:37:32 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/donatien/code/EthernetNetIf/#bc7df6da7589
+http://mbed.org/users/donatien/code/EthernetNetIf/#0401477beaa3
--- a/HTTPClient.lib	Fri Jul 09 14:49:52 2010 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/donatien/code/HTTPClient/#d97a4fc01c86
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HTTPClient_ToBeRemoved.lib	Mon Nov 25 11:37:32 2013 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/donatien/code/HTTPClient_ToBeRemoved/#1190175dcc64
--- a/TwitterExample.cpp	Fri Jul 09 14:49:52 2010 +0000
+++ b/TwitterExample.cpp	Mon Nov 25 11:37:32 2013 +0000
@@ -1,48 +1,42 @@
-/*
-  Update: 21-06-2010
-  The basic authentication service for twitter is going down at the end of the week.
-  To continue using that program, the code has been updated to use http://supertweet.net which acts as an API proxy.
-  Simply visit the website to setup your twitter account for this API.
-  See: http://www.supertweet.net/about/documentation
-*/
-
 #include "mbed.h"
 #include "EthernetNetIf.h"
 #include "HTTPClient.h"
-
+#include "C12832_lcd.h"
+ 
 EthernetNetIf eth; 
-
+HTTPClient http;
+C12832_LCD lcd;
+  
 int main() {
-
-  printf("Init\n");
-
-  printf("\r\nSetting up...\r\n");
+ 
+  lcd.printf("Start\n");
+  wait(1);
+  lcd.printf("\r\nSetting up...\r\n");
   EthernetErr ethErr = eth.setup();
   if(ethErr)
   {
-    printf("Error %d in setup.\n", ethErr);
+    lcd.printf("Error %d in setup.\n", ethErr);
     return -1;
   }
-  printf("\r\nSetup OK\r\n");
-
-  HTTPClient twitter;
+  lcd.printf("\r\nSetup OK\r\n");
+  
+  HTTPText txt;
   
-  HTTPMap msg;
-  msg["status"] = "I am tweeting from my mbed!"; //A good example of Key/Value pair use with Web APIs
-
-  twitter.basicAuth("myuser", "mypass"); //We use basic authentication, replace with you account's parameters
-  
-  //No need to retieve data sent back by the server
-  HTTPResult r = twitter.post("http://api.supertweet.net/1/statuses/update.xml", msg, NULL); 
-  if( r == HTTP_OK )
+  HTTPResult r = http.get("http://mbed.org/media/uploads/donatien/hello.txt", &txt);
+  if(r==HTTP_OK)
   {
-    printf("Tweet sent with success!\n");
+    lcd.printf("Result :\"%s\"\n", txt.gets()); 
   }
   else
   {
-    printf("Problem during tweeting, return code %d\n", r);
+    lcd.printf("Error %d\n", r);
+  }
+  
+  while(1)
+  {
+  
   }
   
   return 0;
-
-}
+  
+}
\ No newline at end of file