From 68ffad6f699e6ec2b54d613b8c5b12b896a84e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=9F=E8=BF=9B?= Date: Wed, 16 Jan 2019 05:53:17 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20master.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/master.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/master.js b/lib/master.js index 55115c6..a249714 100644 --- a/lib/master.js +++ b/lib/master.js @@ -485,18 +485,11 @@ function Master(options, adapter) { if (options.config.type === 'tcp') { - options.config.tcp.bind = "127.0.0.1" ; - const tcp = options.config.tcp; - - if (!tcp || !tcp.bind || tcp.bind === '0.0.0.0') { - adapter.log.error('IP address is not defined'); - return; - } try { modbusClient = Modbus('client', 'tcp')({ options: { tcp: { - host: tcp.bind, + host: tcp.bind || "127.0.0.1", port: parseInt(tcp.port, 10) || 502, autoReconnect: false, },