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:
2:ca5d12560ff7
Parent:
1:016d4400254b
Child:
4:5da66fab599c
--- a/WebPages.cpp	Tue Jul 03 16:26:21 2018 +0000
+++ b/WebPages.cpp	Tue Jul 10 03:09:19 2018 +0000
@@ -77,7 +77,7 @@
 // The /setup.xml file
 //
 // sprintf(buf, SETUP_TEMPLATE, "FriendlyName", "udn_hexstring", "serialNum", "ip.ad.dr", portNum);
-static const char * SETUP_TEMPLATE =
+static const char SETUP_TEMPLATE[] =
     "<?xml version=\"1.0\"?>\n"
     "<root xmlns=\"urn:Belkin:device-1-0\">\n"
     " <specVersion>\n"
@@ -186,7 +186,7 @@
 HTTPServer::CallBackResults Setup_xml(HTTPServer *svr, HTTPServer::CallBackType type, char * path,
                        const HTTPServer::namevalue *queryParams, int queryParamCount)
 {
-    char BigBuffer[1000];
+    char BigBuffer[sizeof(SETUP_TEMPLATE) + 150];
     HTTPServer::CallBackResults ret = HTTPServer::ACCEPT_ERROR;
     printf("Setup.xml responder\n");
     switch (type) {