Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix off-by-one error which causes "M-SEARCH" to be missed if it's at the start of the UDP packet. #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion UpnpBroadcastResponder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void UpnpBroadcastResponder::serverLoop(){
// check if this is a M-SEARCH for WeMo device
String request = String((char *)packetBuffer);

if(request.indexOf('M-SEARCH') > 0) {
if(request.indexOf("M-SEARCH") >= 0) {
// Issue https://github.com/kakopappa/arduino-esp8266-alexa-multiple-wemo-switch/issues/22 fix
if((request.indexOf("urn:Belkin:device:**") > 0) || (request.indexOf("ssdp:all") > 0) || (request.indexOf("upnp:rootdevice") > 0)) {
Serial.println("Got UDP Belkin Request..");
Expand Down