diff --git a/package.json b/package.json index 5db3639..a2d331f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "modbus-serial", - "version": "6.0.0", + "version": "6.0.1", "description": "A pure JavaScript implemetation of MODBUS-RTU (Serial and TCP) for NodeJS.", "main": "index.js", "scripts": { diff --git a/ports/asciiport.js b/ports/asciiport.js index 4921938..c1657d0 100644 --- a/ports/asciiport.js +++ b/ports/asciiport.js @@ -169,8 +169,6 @@ var AsciiPort = function(path, options) { } }); - EventEmitter.call(this); - /** * Check if port is open. * @@ -182,6 +180,8 @@ var AsciiPort = function(path, options) { return this._client.isOpen; } }); + + EventEmitter.call(this); }; util.inherits(AsciiPort, EventEmitter); diff --git a/ports/c701port.js b/ports/c701port.js index 8bc92cd..6ed55b8 100644 --- a/ports/c701port.js +++ b/ports/c701port.js @@ -104,8 +104,6 @@ var UdpPort = function(ip, options) { modbus.openFlag = false; }); - EventEmitter.call(this); - /** * Check if port is open. * @@ -117,6 +115,8 @@ var UdpPort = function(ip, options) { return this.openFlag; } }); + + EventEmitter.call(this); }; util.inherits(UdpPort, EventEmitter); diff --git a/ports/rtubufferedport.js b/ports/rtubufferedport.js index b718fc2..b6cf51d 100644 --- a/ports/rtubufferedport.js +++ b/ports/rtubufferedport.js @@ -77,8 +77,6 @@ var RTUBufferedPort = function(path, options) { } }); - EventEmitter.call(this); - /** * Check if port is open. * @@ -90,6 +88,8 @@ var RTUBufferedPort = function(path, options) { return this._client.isOpen; } }); + + EventEmitter.call(this); }; util.inherits(RTUBufferedPort, EventEmitter); diff --git a/ports/tcpport.js b/ports/tcpport.js index 44aed25..bd7e223 100644 --- a/ports/tcpport.js +++ b/ports/tcpport.js @@ -94,8 +94,6 @@ var TcpPort = function(ip, options) { handleCallback(had_error); }); - EventEmitter.call(this); - /** * Check if port is open. * @@ -107,6 +105,8 @@ var TcpPort = function(ip, options) { return this.openFlag; } }); + + EventEmitter.call(this); }; util.inherits(TcpPort, EventEmitter); diff --git a/ports/tcprtubufferedport.js b/ports/tcprtubufferedport.js index bea8360..3f93abf 100644 --- a/ports/tcprtubufferedport.js +++ b/ports/tcprtubufferedport.js @@ -111,8 +111,6 @@ var TcpRTUBufferedPort = function(ip, options) { handleCallback(had_error); }); - EventEmitter.call(this); - /** * Check if port is open. * @@ -124,6 +122,8 @@ var TcpRTUBufferedPort = function(ip, options) { return this.openFlag; } }); + + EventEmitter.call(this); }; util.inherits(TcpRTUBufferedPort, EventEmitter); diff --git a/ports/telnetport.js b/ports/telnetport.js index 469cfbc..bc1bc92 100644 --- a/ports/telnetport.js +++ b/ports/telnetport.js @@ -99,8 +99,6 @@ var TelnetPort = function(ip, options) { handleCallback(had_error); }); - EventEmitter.call(this); - /** * Check if port is open. * @@ -112,6 +110,8 @@ var TelnetPort = function(ip, options) { return this.openFlag; } }); + + EventEmitter.call(this); }; util.inherits(TelnetPort, EventEmitter); diff --git a/ports/testport.js b/ports/testport.js index 48993a4..89d4b08 100644 --- a/ports/testport.js +++ b/ports/testport.js @@ -31,8 +31,6 @@ var TestPort = function() { // simulate 16 coils / digital inputs this._coils = 0x0000; // TODO 0xa12b, 1010 0001 0010 1011 - EventEmitter.call(this); - /** * Check if port is open. * @@ -44,6 +42,8 @@ var TestPort = function() { return true; } }); + + EventEmitter.call(this); }; util.inherits(TestPort, EventEmitter);