You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tested your program. Works very fine! But there is a little bug in the code.
This is the code used for detecting a search request: if (request.indexOf('M-SEARCH') > 0) { if (request.indexOf("urn:Belkin:device:**") > 0) { ...
The first indexOf gives a warning "To many chars in char constant". It is compiled to "indexOf('M')". Replacing it with indexOf("M-SEARCH") does not work, because "M-SEARCH" is at position 0. indexOf() returns -1 if a string is not found!
Replace the code by if (request.indexOf('M-SEARCH') > -1) { if (request.indexOf("urn:Belkin:device:**") > -1) { ...
or
if (request.indexOf('M-SEARCH') == 0) { if (request.indexOf("urn:Belkin:device:**") > -1) { ...
The text was updated successfully, but these errors were encountered:
I tested your program. Works very fine! But there is a little bug in the code.
This is the code used for detecting a search request:
if (request.indexOf('M-SEARCH') > 0) {
if (request.indexOf("urn:Belkin:device:**") > 0) {
...
The first indexOf gives a warning "To many chars in char constant". It is compiled to "indexOf('M')". Replacing it with indexOf("M-SEARCH") does not work, because "M-SEARCH" is at position 0. indexOf() returns -1 if a string is not found!
Replace the code by
if (request.indexOf('M-SEARCH') > -1) {
if (request.indexOf("urn:Belkin:device:**") > -1) {
...
or
if (request.indexOf('M-SEARCH') == 0) {
if (request.indexOf("urn:Belkin:device:**") > -1) {
...
The text was updated successfully, but these errors were encountered: