Skip to content

Commit

Permalink
chore: update info and standard style format
Browse files Browse the repository at this point in the history
  • Loading branch information
biancode committed Oct 31, 2019
1 parent 1c42053 commit 47dfb67
Show file tree
Hide file tree
Showing 51 changed files with 2,504 additions and 2,451 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ matrix:
- node_js: "lts/*"
- node_js: 10
allow_failures:
- node_js: 12
- node_js: 8
install:
- npm install
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@

Based on [modbus-serial][2] with TCP, C701, Telnet, Serial, RTU buffered, and ASCII

* stress tested with Node-RED v0.19 and Node.js v9 and v10 LTS
* stress tested with Node-RED v1.0 and Node.js v10 and 12 LTS
* works with queueing per unit and round robin scheduling
* Node.JS 8.x is supported with v3.x
* Node.JS 6.x is supported with v2.x
* Node.JS 4.x is supported with v1.x

Node-RED v0.x versions:
* Node.JS 10.x is supported with v4.x
* Node.JS 8.x is supported with v3.x
* Node.JS 6.x is supported with v2.x
* Node.JS 4.x is supported with v1.x

If you like that contributor's package for Modbus, then please give us your star at [GitHub][12] !

Expand Down
2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
The MIT License
Copyright (c) 2017, 2018, 2019 - Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2017, 2018, 2019 - Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-iiot-jwt
*/
Expand Down
2 changes: 1 addition & 1 deletion src/core/modbus-client-core.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus
Expand Down
2 changes: 1 addition & 1 deletion src/core/modbus-core.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus
Expand Down
2 changes: 1 addition & 1 deletion src/core/modbus-io-core.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus
node-red-contrib-modbusio
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-basics.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus - The BSD 3-Clause License
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-client.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
Copyright 2016 - Jason D. Harper, Argonne National Laboratory
Copyright 2015,2016 - Mika Karaila, Valmet Automation Inc.
All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-client.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
Copyright 2016 - Jason D. Harper, Argonne National Laboratory
Copyright 2015,2016 - Mika Karaila, Valmet Automation Inc.
All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-flex-connector.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright (c) 2017,2018 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2017,2018 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus - The BSD 3-Clause License
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-flex-connector.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2017,2018 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2017,2018 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus - The BSD 3-Clause License
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-flex-getter.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus - The BSD 3-Clause License
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-flex-getter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus - The BSD 3-Clause License
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-flex-server.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright (c) 2017,2018 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2017,2018 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus - The BSD 3-Clause License
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-flex-server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2017,2018 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2017,2018 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus - The BSD 3-Clause License
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-flex-write.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus - The BSD 3-Clause License
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-flex-write.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus - The BSD 3-Clause License
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-getter.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus - The BSD 3-Clause License
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-getter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus - The BSD 3-Clause License
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-io-config.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus - The BSD 3-Clause License
node-red-contrib-modbusio - The BSD 3-Clause License
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-io-config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus
node-red-contrib-modbusio
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-queue-info.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus - The BSD 3-Clause License
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-queue-info.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus - The BSD 3-Clause License
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-read.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
Copyright 2016 - Jason D. Harper, Argonne National Laboratory
Copyright 2015,2016 - Mika Karaila, Valmet Automation Inc.
Copyright 2013, 2016 IBM Corp. (node-red)
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-read.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
Copyright 2016 - Jason D. Harper, Argonne National Laboratory
Copyright 2015,2016 - Mika Karaila, Valmet Automation Inc.
Copyright 2013, 2016 IBM Corp. (node-red)
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-response-filter.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright (c) 2017,2018 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2017,2018 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus - The BSD 3-Clause License
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-response-filter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2017,2018 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2017,2018 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus - The BSD 3-Clause License
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-response.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
Copyright 2016 - Jason D. Harper, Argonne National Laboratory
Copyright 2015,2016 - Mika Karaila, Valmet Automation Inc.
All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-response.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
Copyright 2016 - Jason D. Harper, Argonne National Laboratory
Copyright 2015,2016 - Mika Karaila, Valmet Automation Inc.
All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-server.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus - The BSD 3-Clause License
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus - The BSD 3-Clause License
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-write.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
Copyright 2016 - Jason D. Harper, Argonne National Laboratory
Copyright 2015,2016 - Mika Karaila, Valmet Automation Inc.
All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion src/modbus-write.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
Copyright 2016 - Jason D. Harper, Argonne National Laboratory
Copyright 2015,2016 - Mika Karaila, Valmet Automation Inc.
All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion test/mocha-example-test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus - The BSD 3-Clause License
Expand Down
2 changes: 1 addition & 1 deletion test/modbus-basics-test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2016,2017,2018,2019 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus - The BSD 3-Clause License
Expand Down
16 changes: 8 additions & 8 deletions test/modbus-client-core-test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2017,2018 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2017,2018 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus - The BSD 3-Clause License
Expand All @@ -21,43 +21,43 @@ describe('Modbus Client Core Suite', function () {

describe('FSM states', function () {
it('should have NEW state after create', function (done) {
let fsm = clientCore.createStatelyMachine()
const fsm = clientCore.createStatelyMachine()
assert.equal(fsm.getMachineState(), 'NEW')
done()
})

it('should change to INIT state', function (done) {
let fsm = clientCore.createStatelyMachine()
const fsm = clientCore.createStatelyMachine()
assert.equal(fsm.init().getMachineState(), 'INIT')
done()
})

it('should change to STOPED while NEW state get stop', function (done) {
let fsm = clientCore.createStatelyMachine()
const fsm = clientCore.createStatelyMachine()
assert.equal(fsm.stop().getMachineState(), 'STOPED')
done()
})

it('should change to OPENED from INIT state', function (done) {
let fsm = clientCore.createStatelyMachine()
const fsm = clientCore.createStatelyMachine()
assert.equal(fsm.init().openserial().getMachineState(), 'OPENED')
done()
})

it('should change to CONNECTED from INIT state', function (done) {
let fsm = clientCore.createStatelyMachine()
const fsm = clientCore.createStatelyMachine()
assert.equal(fsm.init().connect().getMachineState(), 'CONNECTED')
done()
})

it('should change to Serial CLOSED state', function (done) {
let fsm = clientCore.createStatelyMachine()
const fsm = clientCore.createStatelyMachine()
assert.equal(fsm.init().openserial().connect().close().getMachineState(), 'CLOSED')
done()
})

it('should change to TCP CLOSED state', function (done) {
let fsm = clientCore.createStatelyMachine()
const fsm = clientCore.createStatelyMachine()
assert.equal(fsm.init().connect().close().getMachineState(), 'CLOSED')
done()
})
Expand Down
26 changes: 13 additions & 13 deletions test/modbus-core-test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
Copyright (c) 2017,2018 Klaus Landsdorf (http://bianco-royal.de/)
Copyright (c) 2017,2018 Klaus Landsdorf (https://bianco-royal.com/)
All rights reserved.
node-red-contrib-modbus - The BSD 3-Clause License
Expand All @@ -19,18 +19,18 @@ describe('Modbus Core Suite', function () {
})

it('should remove givin msg from message list', function () {
let list = new Map()
let msg = { messageId: 1, payload: { messageId: 1 } }
let otherMsg = { messageId: 1, payload: { messageId: 1 } }
const list = new Map()
const msg = { messageId: 1, payload: { messageId: 1 } }
const otherMsg = { messageId: 1, payload: { messageId: 1 } }
list.set(1, msg)
assert.equal(msg, core.getOriginalMessage(list, otherMsg))
assert.equal(0, list.size)
})

it('should return givin otherMsg if not in message list', function () {
let list = new Map()
let msg = { messageId: 1, payload: { messageId: 1 } }
let otherMsg = { messageId: 2, payload: { messageId: 2 } }
const list = new Map()
const msg = { messageId: 1, payload: { messageId: 1 } }
const otherMsg = { messageId: 2, payload: { messageId: 2 } }
list.set(1, msg)
assert.equal(otherMsg, core.getOriginalMessage(list, otherMsg))
})
Expand Down Expand Up @@ -76,18 +76,18 @@ describe('Modbus Core Suite', function () {
})

it('should remove givin origin msg from message list on building response message', function () {
let list = new Map()
let msg = { messageId: 1, payload: { messageId: 1 } }
let otherMsg = { messageId: 1, payload: { messageId: 1 } }
const list = new Map()
const msg = { messageId: 1, payload: { messageId: 1 } }
const otherMsg = { messageId: 1, payload: { messageId: 1 } }
list.set(1, msg)
assert.equal(2, core.buildMessage(list, {}, {}, otherMsg).length)
assert.equal(0, list.size)
})

it('should build response message if origin not found', function () {
let list = new Map()
let msg = { messageId: 1, payload: { messageId: 1 } }
let otherMsg = { messageId: 2, payload: { messageId: 2 } }
const list = new Map()
const msg = { messageId: 1, payload: { messageId: 1 } }
const otherMsg = { messageId: 2, payload: { messageId: 2 } }
list.set(1, msg)
assert.equal(2, core.buildMessage(list, {}, {}, otherMsg).length)
assert.equal(1, list.size)
Expand Down
Loading

0 comments on commit 47dfb67

Please sign in to comment.