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.
Fork of RPCHTTPServerVariable by
Revision 0:050a5d4ffd55, committed 2014-02-20
- Comitter:
- yueee_yt
- Date:
- Thu Feb 20 05:37:05 2014 +0000
- Child:
- 1:c409d7474fe7
- Commit message:
- Checked SimpleHandler
Changed in this revision
--- /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
