SSDP Server - working version provides SSDP based network discovery, and with a companion web server, may provide other functionalities.
Dependents: X10Svr SSDP_Server
Diff: SSDP.cpp
- Revision:
- 11:b7f8070014d8
- Parent:
- 10:26f5a66f05a4
- Child:
- 12:4e7c5e1fd32b
diff -r 26f5a66f05a4 -r b7f8070014d8 SSDP.cpp --- a/SSDP.cpp Sun Mar 03 20:25:10 2019 +0000 +++ b/SSDP.cpp Sun Jan 12 03:31:36 2020 +0000 @@ -16,7 +16,7 @@ // define the following to support that discovery #define ST_DISCOVER_BELKIN_DEVICE -//#define DEBUG "SSDP" //Debug is disabled by default +#define DEBUG "SSDP" //Debug is disabled by default #include <cstdio> #if (defined(DEBUG) && !defined(TARGET_LPC11U24)) @@ -98,7 +98,7 @@ buffer[n] = '\0'; INFO("SSDP <<<<<<< %d bytes from %s:%d <<<<<<<<<<<", n, client.get_address(), client.get_port()); - INFO("SSDP\n%s", buffer); + INFO("SSDP\r\n%s", buffer); char * p = buffer; while (*p) { char * e = strstr(p, "\r\n"); @@ -119,6 +119,8 @@ #ifdef ST_DISCOVER_BELKIN_DEVICE } else if (sw_stristr(p, "ST:") && sw_stristr(p, "urn:Belkin:device:**")) { mask |= 0x08; + } else if (sw_stristr(p, "ST:") && sw_stristr(p, "urn:Belkin:service:")) { + mask |= 0x08; #endif } else if (sw_stristr(p, "HOST: ")) { mask |= 0x10; // HOST: 239.255.255.250:49152