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

Dependents:   X10Svr SSDP_Server

Files at this revision

API Documentation at this revision

Comitter:
WiredHome
Date:
Sun Jan 12 19:01:30 2020 +0000
Parent:
11:b7f8070014d8
Child:
13:bcabd901d344
Commit message:
Cosmetic only for debugging

Changed in this revision

SSDP.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/SSDP.cpp	Sun Jan 12 03:31:36 2020 +0000
+++ b/SSDP.cpp	Sun Jan 12 19:01:30 2020 +0000
@@ -96,9 +96,9 @@
             uint8_t mask = 0x00;    // fragments we found in the received packet
             
             buffer[n] = '\0';
-            INFO("SSDP <<<<<<< %d bytes from %s:%d <<<<<<<<<<<", n, 
+            INFO("SSDP Recv %d bytes from %s:%d", n, 
                 client.get_address(), client.get_port());
-            INFO("SSDP\r\n%s", buffer);
+            INFO("RecvMessage:  <<<<<<<<<<<<<<\r\n%s<<<<<<<<<<<<<<<", buffer);
             char * p = buffer;
             while (*p) {
                 char * e = strstr(p, "\r\n");
@@ -142,11 +142,11 @@
                     sprintf(out_buffer, SSDP_HTTP, cfg->ipAddr, cfg->port, cfg->ident, cfg->ident);
                     // It would be polite to delay, but the recommendation is from 1 to 5 seconds,
                     // and that will stall this thread.
-                    INFO("SSDPListener: reply >>>>>>> %s:%d >>>>>>>>>>>", client.get_address(),
+                    INFO("SSDPListener: reply >>>>>>> %s:%d >>>>>>>>>>>>>>>>>>>>>>>>>>>>>", client.get_address(),
                         client.get_port());
                     INFO("\r\n%s", out_buffer);
                     int i = server.sendTo(client, out_buffer, strlen(out_buffer));
-                    INFO("  sendTo %3d: reply <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<", i);
+                    INFO("  sendTo %3d: reply", i);
                     free(out_buffer);
                     INFO("SSDPListener: stack-used: %d, total: %d", pThr->max_stack(), pThr->stack_size());
                 } else {
@@ -204,7 +204,7 @@
         i = broadcast.set_address(MCAST_GRP, MCAST_PORT);
         INFO(" %d = sock.set_address(%s,%d)", i, MCAST_GRP, MCAST_PORT);
         sprintf(out_buffer, SSDP_NOTIFY_ALIVE, _config.ipAddr, _config.port);
-        printf("SendNotify:\n%s", out_buffer);
+        INFO("SendNotify:  >>>>>>>>>>>>>>\r\n%s>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", out_buffer);
         i = sock.sendTo(broadcast, out_buffer, strlen(out_buffer));
         INFO(" %d = sendTo(%s, ..., %d)", i, broadcast.get_address(), strlen(out_buffer));
         free(out_buffer);