From 1950b10751f72799dc7fce8344d897ac61cfe3e9 Mon Sep 17 00:00:00 2001 From: Wyatt Neal Date: Wed, 6 Jan 2016 20:52:31 -0500 Subject: [PATCH] more correctly responding to queries also a small formatting fix. this should now allow the system to actually respond to SSDP discoveries that are issued on the network ... i'm still not 100% certain if this is right due to the way that the switch() statement is setup; it could be processing more than it should --- libraries/ESP8266SSDP/ESP8266SSDP.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/libraries/ESP8266SSDP/ESP8266SSDP.cpp b/libraries/ESP8266SSDP/ESP8266SSDP.cpp index 499b41399..ae5c7068e 100644 --- a/libraries/ESP8266SSDP/ESP8266SSDP.cpp +++ b/libraries/ESP8266SSDP/ESP8266SSDP.cpp @@ -307,8 +307,8 @@ void SSDPClass::_update(){ case VALUE: if(cr == 2){ switch(header){ - case START: - break; + case START: + break; case MAN: #ifdef DEBUG_SSDP DEBUG_SSDP.printf("MAN: %s\n", (char *)buffer); @@ -321,9 +321,12 @@ void SSDPClass::_update(){ DEBUG_SSDP.printf("REJECT: %s\n", (char *)buffer); #endif } - if(strcmp(buffer, "ssdp:discovery")){ - _send(NONE); - state = ABORT; + // if the search type matches our type, we should respond + if(strcmp(buffer, _deviceType)){ + _pending = true; + _process_time = millis(); + state = KEY; + cursor += strlen(_deviceType); } break; case MX: