HTTP Clientをテストするプログラムです。

Dependencies:   EthernetNetIf TextLCD mbed

Files at this revision

API Documentation at this revision

Comitter:
jksoft
Date:
Wed Mar 21 14:50:15 2012 +0000
Commit message:

Changed in this revision

EthernetNetIf.lib Show annotated file Show diff for this revision Revisions of this file
HTTPClient.lib Show annotated file Show diff for this revision Revisions of this file
TextLCD.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r b99037f2bfae EthernetNetIf.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/EthernetNetIf.lib	Wed Mar 21 14:50:15 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/donatien/code/EthernetNetIf/#bc7df6da7589
diff -r 000000000000 -r b99037f2bfae HTTPClient.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HTTPClient.lib	Wed Mar 21 14:50:15 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/donatien/code/HTTPClient/#d0be6af2d1db
diff -r 000000000000 -r b99037f2bfae TextLCD.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Wed Mar 21 14:50:15 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/benyun/code/TextLCD/#7dd9751172e1
diff -r 000000000000 -r b99037f2bfae main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Mar 21 14:50:15 2012 +0000
@@ -0,0 +1,53 @@
+#include "mbed.h"
+#include "EthernetNetIf.h"
+#include "HTTPClient.h"
+#include "TextLCD.h"
+
+EthernetNetIf eth;
+HTTPClient http;
+TextLCD lcd(p11, p12, p27, p28, p29, p30); // rs, e, d4-d7
+  
+int main() {
+
+  lcd.cls();
+  lcd.locate(0, 0);
+  lcd.printf("Ether connect..");
+  printf("Setting up...\n");
+  
+  EthernetErr ethErr = eth.setup();
+  if(ethErr)
+  {
+    lcd.locate(0, 1);
+    lcd.printf("ERROR");
+    printf("Error %d in setup.\n", ethErr);
+    return -1;
+  }
+  lcd.locate(0, 1);
+  lcd.printf("OK");
+  printf("Setup OK\n");
+  
+  HTTPText txt;
+  
+  HTTPResult r = http.get("http://jksoft.cocolog-nifty.com/msg.txt", &txt);
+  if(r==HTTP_OK)
+  {
+    lcd.cls();
+    lcd.locate(0, 0);
+    lcd.printf("%s",txt.gets());
+    
+    printf("Result :\"%s\"\n", txt.gets()); 
+  }
+  else
+  {
+    lcd.cls();
+    lcd.locate(0, 0);
+    lcd.printf("HTTP GET ERR");
+    
+    printf("Error %d\n", r);
+  }
+  
+  while(1)
+  {
+    
+  }
+}
diff -r 000000000000 -r b99037f2bfae mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Mar 21 14:50:15 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9114680c05da