RIAEvangelist / node-phidget-API

Node.JS Phidget API supporting all phidgets!
Other
10 stars 7 forks source link

Fix connection to non-localhost phidgetwebservices. #54

Closed pixelbreaker closed 8 years ago

pixelbreaker commented 8 years ago

Allow settings to be passed through to new.createConnection. Currently, nothing is passed through.

I found this when i tried to connect to a remote server, on 10.0.1.8 and it was still connecting to the one on localhost as that's the default.

RIAEvangelist commented 8 years ago

Any particular reason for the use of double not? if(!!params[key]) instead of if(params[key]) or if(params[key]!==undefined)?

RIAEvangelist commented 8 years ago

Your change doesn't make much sense because it will always be true.

Could you share the code that prompted you to make this upgrade? I think you may have unwittingly been doing something you were not expecting.


function setParams(params){
        for(var key in params){
            if(!!params[key])
                phidgetParams[key]=params[key];
        }
        for(var key in this.defaults){
            if(!phidgetParams[key])
                phidgetParams[key]=this.defaults[key];
        }

        if(this.params.boardID){
            phidgetParams.serial=this.params.boardID;
        }
    }
RIAEvangelist commented 8 years ago

Either that or I may need a wider refactor.