Skip to content

Commit

Permalink
- Removed lintin errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanpoeter committed Nov 25, 2016
1 parent 155d80f commit 2041f3b
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/handler/server/ReadCoils.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = stampit()
this.log.debug('handling read coils request.')

if (pdu.length !== 5) {
var buf = Buffer.allocUnsafe(2)
let buf = Buffer.allocUnsafe(2)

buf.writeUInt8(0x81, 0)
buf.writeUInt8(0x02, 1)
Expand All @@ -35,7 +35,7 @@ module.exports = stampit()
var mem = this.getCoils()

if (start > mem.length * 8 || start + quantity > mem.length * 8) {
var buf = Buffer.allocUnsafe(2)
let buf = Buffer.allocUnsafe(2)
buf.writeUInt8(0x81, 0)
buf.writeUInt8(0x02, 1)
cb(buf)
Expand Down
4 changes: 2 additions & 2 deletions src/handler/server/ReadDiscreteInputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var handler = stampit()
if (pdu.length !== 5) {
this.log.debug('wrong pdu length.')

var buf = Buffer.allocUnsafe(2)
let buf = Buffer.allocUnsafe(2)

buf.writeUInt8(0x82, 0)
buf.writeUInt8(0x02, 1)
Expand All @@ -40,7 +40,7 @@ var handler = stampit()
if (start > mem.length * 8 || start + quantity > mem.length * 8) {
this.log.debug('wrong pdu length.')

var buf = Buffer.allocUnsafe(2)
let buf = Buffer.allocUnsafe(2)

buf.writeUInt8(0x82, 0)
buf.writeUInt8(0x02, 1)
Expand Down
4 changes: 2 additions & 2 deletions src/handler/server/ReadHoldingRegisters.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = stampit()
if (pdu.length !== 5) {
this.log.debug('wrong pdu length.')

var buf = Buffer.allocUnsafe(2)
let buf = Buffer.allocUnsafe(2)

buf.writeUInt8(0x83, 0)
buf.writeUInt8(0x02, 1)
Expand All @@ -40,7 +40,7 @@ module.exports = stampit()

if (byteStart > mem.length || byteStart + (quantity * 2) > mem.length) {
this.log.debug('request outside register boundaries.')
var buf = Buffer.allocUnsafe(2)
let buf = Buffer.allocUnsafe(2)

buf.writeUInt8(0x83, 0)
buf.writeUInt8(0x02, 1)
Expand Down
4 changes: 2 additions & 2 deletions src/handler/server/ReadInputRegisters.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = stampit()
this.log.debug('handling read input registers request.')

if (pdu.length !== 5) {
var buf = Buffer.allocUnsafe(2)
let buf = Buffer.allocUnsafe(2)

buf.writeUInt8(0x84, 0)
buf.writeUInt8(0x02, 1)
Expand All @@ -36,7 +36,7 @@ module.exports = stampit()
var mem = this.getInput()

if (byteStart > mem.length || byteStart + (quantity * 2) > mem.length) {
var buf = Buffer.allocUnsafe(2)
let buf = Buffer.allocUnsafe(2)

buf.writeUInt8(0x84, 0)
buf.writeUInt8(0x02, 1)
Expand Down
4 changes: 2 additions & 2 deletions src/handler/server/WriteMultipleCoils.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = stampit()
this.log.debug('handling write multiple coils request.')

if (pdu.length < 3) {
var buf = Buffer.allocUnsafe(2)
let buf = Buffer.allocUnsafe(2)

buf.writeUInt8(0x8F, 0)
buf.writeUInt8(0x02, 1)
Expand All @@ -37,7 +37,7 @@ module.exports = stampit()

// error response
if (start > mem.length * 8 || start + quantity > mem.length * 8) {
var buf = Buffer.allocUnsafe(2)
let buf = Buffer.allocUnsafe(2)

buf.writeUInt8(0x8F, 0)
buf.writeUInt8(0x02, 1)
Expand Down
4 changes: 2 additions & 2 deletions src/handler/server/WriteMultipleRegisters.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = stampit()
this.log.debug('handling write multiple registers request.')

if (pdu.length < 3) {
var buf = Buffer.allocUnsafe(2)
let buf = Buffer.allocUnsafe(2)

buf.writeUInt8(0x90, 0)
buf.writeUInt8(0x02, 1)
Expand All @@ -33,7 +33,7 @@ module.exports = stampit()
var byteCount = pdu.readUInt8(5)

if (quantity > 0x007b) {
var buf = Buffer.allocUnsafe(2)
let buf = Buffer.allocUnsafe(2)

buf.writeUInt8(0x90, 0)
buf.writeUInt8(0x03, 1)
Expand Down
4 changes: 2 additions & 2 deletions src/handler/server/WriteSingleCoil.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = stampit()
this.log.debug('handling write single coil request.')

if (pdu.length !== 5) {
var buf = Buffer.allocUnsafe(2)
let buf = Buffer.allocUnsafe(2)

buf.writeUInt8(0x85, 0)
buf.writeUInt8(0x02, 1)
Expand All @@ -31,7 +31,7 @@ module.exports = stampit()
var value = !(pdu.readUInt16BE(3) === 0x0000)

if (pdu.readUInt16BE(3) !== 0x0000 && pdu.readUInt16BE(3) !== 0xFF00) {
var buf = Buffer.allocUnsafe(2)
let buf = Buffer.allocUnsafe(2)

buf.writeUInt8(0x85, 0)
buf.writeUInt8(0x03, 1)
Expand Down
4 changes: 2 additions & 2 deletions src/handler/server/WriteSingleRegister.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = stampit()
this.log.debug('handling write single register request.')

if (pdu.length !== 5) {
var buf = Buffer.allocUnsafe(2)
let buf = Buffer.allocUnsafe(2)

buf.writeUInt8(0x86, 0)
buf.writeUInt8(0x02, 1)
Expand All @@ -36,7 +36,7 @@ module.exports = stampit()
var mem = this.getHolding()

if (byteAddress > mem.length) {
var buf = Buffer.allocUnsafe(2)
let buf = Buffer.allocUnsafe(2)

buf.writeUInt8(0x86, 0)
buf.writeUInt8(0x02, 1)
Expand Down

0 comments on commit 2041f3b

Please sign in to comment.