From c8d855c46d09c8c32b96383cdd9b975f5a52fff3 Mon Sep 17 00:00:00 2001 From: Jeremy Green Date: Thu, 10 Mar 2016 21:57:59 -0500 Subject: [PATCH] Changed templates to include deviceType Previously, the notify template and and response templates had a hardcoded NT (or ST) of upnp:root device. They now include the deviceType that is set in initialization. --- libraries/ESP8266SSDP/ESP8266SSDP.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/ESP8266SSDP/ESP8266SSDP.cpp b/libraries/ESP8266SSDP/ESP8266SSDP.cpp index afae3e9fe..36eb40a8c 100644 --- a/libraries/ESP8266SSDP/ESP8266SSDP.cpp +++ b/libraries/ESP8266SSDP/ESP8266SSDP.cpp @@ -58,13 +58,11 @@ static const IPAddress SSDP_MULTICAST_ADDR(239, 255, 255, 250); static const char* _ssdp_response_template = "HTTP/1.1 200 OK\r\n" - "EXT:\r\n" - "ST: upnp:rootdevice\r\n"; + "EXT:\r\n"; static const char* _ssdp_notify_template = "NOTIFY * HTTP/1.1\r\n" "HOST: 239.255.255.250:1900\r\n" - "NT: upnp:rootdevice\r\n" "NTS: ssdp:alive\r\n"; static const char* _ssdp_packet_template = @@ -72,6 +70,7 @@ static const char* _ssdp_packet_template = "CACHE-CONTROL: max-age=%u\r\n" // SSDP_INTERVAL "SERVER: Arduino/1.0 UPNP/1.1 %s/%s\r\n" // _modelName, _modelNumber "USN: uuid:%s\r\n" // _uuid + "%s: %s\r\n" "LOCATION: http://%u.%u.%u.%u:%u/%s\r\n" // WiFi.localIP(), _port, _schemaURL "\r\n"; @@ -207,6 +206,8 @@ void SSDPClass::_send(ssdp_method_t method){ (method == NONE)?_ssdp_response_template:_ssdp_notify_template, SSDP_INTERVAL, _modelName, _modelNumber, + (method == NONE)?"ST":"NT", + _deviceType, _uuid, IP2STR(&ip), _port, _schemaURL );