Skip to content

Commit 1950b10

Browse files
committed
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
1 parent 17c3fb9 commit 1950b10

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

libraries/ESP8266SSDP/ESP8266SSDP.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,8 @@ void SSDPClass::_update(){
307307
case VALUE:
308308
if(cr == 2){
309309
switch(header){
310-
case START:
311-
break;
310+
case START:
311+
break;
312312
case MAN:
313313
#ifdef DEBUG_SSDP
314314
DEBUG_SSDP.printf("MAN: %s\n", (char *)buffer);
@@ -321,9 +321,12 @@ void SSDPClass::_update(){
321321
DEBUG_SSDP.printf("REJECT: %s\n", (char *)buffer);
322322
#endif
323323
}
324-
if(strcmp(buffer, "ssdp:discovery")){
325-
_send(NONE);
326-
state = ABORT;
324+
// if the search type matches our type, we should respond
325+
if(strcmp(buffer, _deviceType)){
326+
_pending = true;
327+
_process_time = millis();
328+
state = KEY;
329+
cursor += strlen(_deviceType);
327330
}
328331
break;
329332
case MX:

0 commit comments

Comments
 (0)