diff --git a/lib/net/wisunb.js b/lib/net/wisunb.js index 8e43a0c..34684f3 100644 --- a/lib/net/wisunb.js +++ b/lib/net/wisunb.js @@ -277,7 +277,7 @@ EchonetLiteNetWisunb.prototype.startDiscovery = function(buf, callback) { callback = function() {}; } this.is_discovering = true; - this._activeScan((err) => { + this._activeScan(buf, (err) => { if(err) { callback(err); } else { @@ -294,7 +294,7 @@ EchonetLiteNetWisunb.prototype.startDiscovery = function(buf, callback) { }; // Start the active scan -EchonetLiteNetWisunb.prototype._activeScan = function(callback) { +EchonetLiteNetWisunb.prototype._activeScan = function(buf, callback) { this._setSerialCallback((res) => { if(res.match(/(^|\r\n)FAIL/)) { var msg = 'Failed the active scan: ' + this._getFailLine(res); @@ -317,7 +317,7 @@ EchonetLiteNetWisunb.prototype._activeScan = function(callback) { }, this.SERIAL_SEND_INTERVAL); } else { this.discovery_timer_id = setTimeout(() => { - this.startDiscovery(callback); + this.startDiscovery(buf, callback); }, this.SERIAL_SEND_INTERVAL); } }