SSDP Server - working version provides SSDP based network discovery, and with a companion web server, may provide other functionalities.

Dependents:   X10Svr SSDP_Server

Revision:
4:2260bac62038
Parent:
2:3d6d70556fca
Child:
10:26f5a66f05a4
--- a/SSDP.h	Tue Jul 10 23:15:01 2018 +0000
+++ b/SSDP.h	Fri Aug 31 22:50:27 2018 +0000
@@ -1,5 +1,12 @@
 //
+// SSDP Server
 //
+// This block creates and manages the network interface for an SSDP Server,
+// which can make this node easily discoverable on the network.
+//
+// @note SSDP is not a secure protocol and is cited as creating vulnerabilities,
+//       so this should be understood or used with caution on a controlled
+//       private network.
 //
 
 #include "mbed.h"
@@ -24,7 +31,7 @@
 } SSDP_Config_T;
 
 
-///
+
 /// SSDP Server
 /// 
 /// This file documents the SSDP Server, which can be implanted into a node
@@ -87,12 +94,6 @@
     ///
     bool SetFriendlyName(const char * name);
 
-    /// Delete the friendly name that was assigned.
-    ///
-    /// This frees the memory that was previously allocated.
-    ///
-    void DelFriendlyName();
-
     /// Set the identity for this node
     ///
     /// @param[in] ident is a pointer to a string containing the identity.
@@ -100,12 +101,6 @@
     ///
     bool SetIdentity(const char * ident);
 
-    /// Delete the identity that was assigned.
-    ///
-    /// This frees the memory that was previously allocated.
-    ///
-    void DelIdentity();
-
     /// Set the IP Address for this node
     ///
     /// @param[in] ipAddr is a pointer to a string containing the ipAddress.
@@ -113,12 +108,6 @@
     ///
     bool SetIPAddress(const char * ipAddr);
 
-    /// Delete the friendly IP Address that was assigned.
-    ///
-    /// This frees the memory that was previously allocated.
-    ///
-    void DelIPAddress();
-
     /// Set the Port
     ///
     /// @param[in] port is the port number of the local web server.
@@ -128,10 +117,34 @@
     
 private:
 
+    /// Delete the friendly name that was assigned.
+    ///
+    /// This frees the memory that was previously allocated.
+    ///
+    void DelFriendlyName();
+
+    /// Delete the identity that was assigned.
+    ///
+    /// This frees the memory that was previously allocated.
+    ///
+    void DelIdentity();
+
+    /// Delete the friendly IP Address that was assigned.
+    ///
+    /// This frees the memory that was previously allocated.
+    ///
+    void DelIPAddress();
+
+    /// Starts a dedicated thread just to listen for SSDP Queries
+    /// and respond to them.
+    ///
     void StartListener();
+    
+    /// On power-up and on state-change, notify events are sent
+    /// for which listeners may react.
+    ///
     void SendNotify();
     
     SSDP_Config_T _config;       ///< the configuration
 
-    //Thread * pThr;
 };
\ No newline at end of file