Skip to content

Commit

Permalink
Changed templates to include deviceType
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jeremyalangreen committed Mar 11, 2016
1 parent a4e78b4 commit c8d855c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libraries/ESP8266SSDP/ESP8266SSDP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,19 @@ 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 =
"%s" // _ssdp_response_template / _ssdp_notify_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";

Expand Down Expand Up @@ -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
);
Expand Down

0 comments on commit c8d855c

Please sign in to comment.