Skip to content

Commit

Permalink
chore: return on failure without FC call
Browse files Browse the repository at this point in the history
  • Loading branch information
biancode committed Jul 28, 2022
1 parent c9e9ca2 commit 60215a7
Show file tree
Hide file tree
Showing 3 changed files with 177 additions and 227 deletions.
96 changes: 18 additions & 78 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/core/modbus-client-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ de.biancoroyal.modbus.core.client.readModbus = function (node, msg, cb, cberr) {
if (!node.client._port._client.readable) {
if (!node.connectClient()) {
coreClient.activateSendingOnFailure(node, cberr, new Error('Modbus-Read Error from client connecting'), msg)
return
}
delayTime = 500
}
Expand Down Expand Up @@ -342,9 +343,11 @@ de.biancoroyal.modbus.core.client.writeModbus = function (node, msg, cb, cberr)
if (!node.client._port._client.readable) {
if (!node.connectClient()) {
coreClient.activateSendingOnFailure(node, cberr, new Error('Modbus-Read Error from client connecting'), msg)
return
}
delayTime = 500
}

setTimeout(function () {
if (!node.bufferCommands) {
if (node.clienttype !== 'tcp') {
Expand Down
Loading

0 comments on commit 60215a7

Please sign in to comment.