Skip to content

Commit 9690678

Browse files
committed
Merge pull request #1753 from jeremyalangreen/ssdp-fixes
Changed ssdp templates to include deviceType
2 parents a14ae34 + e54e387 commit 9690678

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

libraries/ESP8266SSDP/ESP8266SSDP.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,19 @@ static const IPAddress SSDP_MULTICAST_ADDR(239, 255, 255, 250);
5858

5959
static const char* _ssdp_response_template =
6060
"HTTP/1.1 200 OK\r\n"
61-
"EXT:\r\n"
62-
"ST: upnp:rootdevice\r\n";
61+
"EXT:\r\n";
6362

6463
static const char* _ssdp_notify_template =
6564
"NOTIFY * HTTP/1.1\r\n"
6665
"HOST: 239.255.255.250:1900\r\n"
67-
"NT: upnp:rootdevice\r\n"
6866
"NTS: ssdp:alive\r\n";
6967

7068
static const char* _ssdp_packet_template =
7169
"%s" // _ssdp_response_template / _ssdp_notify_template
7270
"CACHE-CONTROL: max-age=%u\r\n" // SSDP_INTERVAL
7371
"SERVER: Arduino/1.0 UPNP/1.1 %s/%s\r\n" // _modelName, _modelNumber
7472
"USN: uuid:%s\r\n" // _uuid
73+
"%s: %s\r\n" // "NT" or "ST", _deviceType
7574
"LOCATION: http://%u.%u.%u.%u:%u/%s\r\n" // WiFi.localIP(), _port, _schemaURL
7675
"\r\n";
7776

@@ -207,6 +206,8 @@ void SSDPClass::_send(ssdp_method_t method){
207206
(method == NONE)?_ssdp_response_template:_ssdp_notify_template,
208207
SSDP_INTERVAL,
209208
_modelName, _modelNumber,
209+
(method == NONE)?"ST":"NT",
210+
_deviceType,
210211
_uuid,
211212
IP2STR(&ip), _port, _schemaURL
212213
);

0 commit comments

Comments
 (0)