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:
8:0b1efcef5e50
Parent:
7:776244e5765a
Child:
9:13e4749ddfa2
--- a/main.cpp	Sun Jan 12 03:31:51 2020 +0000
+++ b/main.cpp	Sun Jan 12 03:51:53 2020 +0000
@@ -1,7 +1,7 @@
 //
 // A simple SSDP example
 //
-#include "mbed.h"               // ver 120; mbed-rtos ver 111
+#include "mbed.h"               // testing mbed v128, mbed-rtos v121
 #include "EthernetInterface.h"  // ver 55
 #include "SW_HTTPServer.h"      // ver 50
 #include "TimeInterface.h"      // ver 23
@@ -11,6 +11,8 @@
 
 #include "WebPages.h"           // Private handler for web queries
 
+extern "C" void mbed_reset();
+
 RawSerial pc(USBTX, USBRX);
 
 EthernetInterface eth;
@@ -63,8 +65,12 @@
 
     int eRes = eth.init(); //Use DHCP
     printf("eth.init() returned %d\r\n", eRes);
+    if (eRes < 0)
+        mbed_reset();
     eRes = eth.connect();
     printf("eth.connect() returned %d\r\n", eRes);
+    if (eRes < 0)
+        mbed_reset();
     printf("IP: %s\r\n", eth.getIPAddress());
     //Thread thr(SSDPListener, NULL, osPriorityLow);
     HTTPServer svr(Server_Port, Server_Root, 15, 30, 20, 50, &pc);