An example demonstrating SSDP Discovery and a companion Web Server.

Dependencies:   mbed mbed-rtos Watchdog SW_HTTPServer SW_String EthernetInterface TimeInterface SSDP

This example program provides a framework -by- example.

It makes itself discoverable to the network using SSDP. From there, it is easy to access the embedded web server to interact with the embedded node.

The example, built on the LPC1768, provides interaction to turn the LEDs on and off via a web page that is discovered using the SSDP protocol.

It also picks up time via an NTP server.

Revision:
7:776244e5765a
Parent:
4:5da66fab599c
Child:
8:0b1efcef5e50
--- a/main.cpp	Fri Aug 31 22:51:15 2018 +0000
+++ b/main.cpp	Sun Jan 12 03:31:51 2020 +0000
@@ -61,9 +61,11 @@
     }
     wd.Configure(45);       // very generous, but this is a network appliance, so a bit less deterministic.
 
-    eth.init(); //Use DHCP
-    eth.connect();
-    printf("IP: %s\n", eth.getIPAddress());
+    int eRes = eth.init(); //Use DHCP
+    printf("eth.init() returned %d\r\n", eRes);
+    eRes = eth.connect();
+    printf("eth.connect() returned %d\r\n", eRes);
+    printf("IP: %s\r\n", eth.getIPAddress());
     //Thread thr(SSDPListener, NULL, osPriorityLow);
     HTTPServer svr(Server_Port, Server_Root, 15, 30, 20, 50, &pc);
     svr.RegisterHandler("/", RootPage);
@@ -82,7 +84,7 @@
         static time_t tLast;
         time_t tNow = ntp.timelocal();
         if (tNow != tLast) {
-            printf("time is %s\r\n", ntp.ctime(&tNow));
+            //printf("time is %s\r\n", ntp.ctime(&tNow));
             tLast = tNow;
         }
         //printf("Mem: %5d, %5d %5d\n", Thread::used_stack(), Thread::max_stack(), Thread::stack_size());