smd.iotkit2.ch / 2-09-01-Uebung

Fork of RPCHTTPServerVariable by smd.iotkit2.ch

Files at this revision

API Documentation at this revision

Comitter:
yueee_yt
Date:
Thu Feb 20 05:37:05 2014 +0000
Child:
1:c409d7474fe7
Commit message:
Checked SimpleHandler

Changed in this revision

EthernetInterface.lib Show annotated file Show diff for this revision Revisions of this file
HttpServer.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-rpc.lib Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/EthernetInterface.lib	Thu Feb 20 05:37:05 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/EthernetInterface/#6a67d2bddc7c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HttpServer.lib	Thu Feb 20 05:37:05 2014 +0000
@@ -0,0 +1,1 @@
+HttpServer#fdf9c2c5200f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Feb 20 05:37:05 2014 +0000
@@ -0,0 +1,40 @@
+//#define DNS_SERVER_ADDRESS(ipaddr)        (ip4_addr_set_u32(ipaddr, ipaddr_addr("208.67.222.222"))) /* resolver1.opendns.com */
+#define __DEBUG
+#include "mbed.h"
+#include "rtos.h"
+#include "EthernetInterface.h"
+#include "HTTPServer.h"
+
+EthernetInterface eth;
+DigitalOut led1(LED1);
+
+void aliveState(void const *args) {
+    while (true) {
+        led1 = !led1;
+        Thread::wait(1000);
+    }
+}
+
+int main()
+{
+    printf("********* PROGRAM START ***********\r\n");
+    Thread thread(aliveState);
+    printf("EthernetInterface Setting up...\r\n");
+    if(eth.init()!=0) {                             //for DHCP Server
+    //if(eth.init(IPAddress,NetMasks,Gateway)!=0) { //for Static IP Address
+        printf("EthernetInterface Initialize Error \r\n");
+        return -1;
+    }
+    if(eth.connect()!=0) {
+        printf("EthernetInterface Connect Error \r\n");
+        return -1;
+    }
+    printf("IP Address is %s\r\n", eth.getIPAddress());
+    printf("NetMask is %s\r\n", eth.getNetworkMask());
+    printf("Gateway Address is %s\r\n", eth.getGateway());
+    printf("Ethernet Setup OK\r\n");
+
+    HTTPServerAddHandler<SimpleHandler>("/"); //Default handler
+    HTTPServerStart(80);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rpc.lib	Thu Feb 20 05:37:05 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/teams/mbed-official/code/mbed-rpc/#4490a0d9cb2a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-rtos.lib	Thu Feb 20 05:37:05 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed-rtos/#f88660a9bed1
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Feb 20 05:37:05 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/869cf507173a
\ No newline at end of file