Test Read of modem status page only. For peer review, not functional

Dependencies:   EthernetNetIf mbed

Files at this revision

API Documentation at this revision

Comitter:
RodColeman
Date:
Tue Sep 06 10:39:14 2011 +0000
Commit message:
0.01

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
HTTPClientExample.cpp Show annotated file Show diff for this revision Revisions of this file
I2CTextLCD.lib 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 bbcccea017f0 EthernetNetIf.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/EthernetNetIf.lib	Tue Sep 06 10:39:14 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/donatien/code/EthernetNetIf/#bc7df6da7589
diff -r 000000000000 -r bbcccea017f0 HTTPClient.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HTTPClient.lib	Tue Sep 06 10:39:14 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/donatien/code/HTTPClient/#d0be6af2d1db
diff -r 000000000000 -r bbcccea017f0 HTTPClientExample.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HTTPClientExample.cpp	Tue Sep 06 10:39:14 2011 +0000
@@ -0,0 +1,48 @@
+#include "mbed.h"
+#include "EthernetNetIf.h"
+#include "HTTPClient.h"
+#include "I2CTextLCD.h"
+
+// EthernetNetIf eth;           // use this line if DHCP needed, or -
+// /*
+EthernetNetIf eth(
+IpAddr(192,168,100,55), //IP Address  
+IpAddr(255,255,255,0), //Network Mask  
+IpAddr(192,168,100,1), //Gateway
+IpAddr(192,168,1,254)  //DNS
+);
+// */
+HTTPClient client;
+I2CTextLCD lcd(p9, p10, 0x70); // sda scl, address
+  
+Serial pc(USBTX, USBRX);
+DigitalOut led1(LED1);
+DigitalOut ConnectLED (LED2);
+DigitalOut GetLED (LED4);
+static const int ClientTimeoutMs = 28000; 
+   
+int main() {
+pc.baud (115400);
+lcd.cls();
+wait(0.1);
+lcd.locate(0,0);
+lcd.printf("Setting up...");
+EthernetErr ethErr = eth.setup();
+if(ethErr)
+  {
+    lcd.printf("Error %d in setup.\n", ethErr);
+    return -1;
+  }
+lcd.locate(0,0);
+lcd.printf("\r\nSetup OK\r\n");
+HTTPText txt("text/html", 4096);
+client.setTimeout(ClientTimeoutMs);
+  for (int x = 10; x>0; x--) 
+   {
+     HTTPResult r = client.get("http://192.168.100.1/install/?page=installStatusData", &txt);
+     GetLED = 1;
+     lcd.printf("R:\"%s\"\n", txt.gets()); 
+     lcd.printf("Error %d %4d\n", r, client.getHTTPResponseCode());
+     wait (3);
+   }
+}
diff -r 000000000000 -r bbcccea017f0 I2CTextLCD.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/I2CTextLCD.lib	Tue Sep 06 10:39:14 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/RodColeman/code/I2CTextLCD/#4816fdd57607
diff -r 000000000000 -r bbcccea017f0 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Sep 06 10:39:14 2011 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9114680c05da