Skip to content

Commit

Permalink
* (Apollon77) Prevent crash case (Sentry IOBROKER-MODBUS-1C)
Browse files Browse the repository at this point in the history
* update deps
* fix js-controller dep
  • Loading branch information
Apollon77 committed Sep 17, 2020
1 parent 3b69346 commit cddd3e5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ There are some programs in folder *test' to test the TCP communication:

## Changelog

### __WORK IN PROGRESS__
* (Apollon77) Prevent crash case (Sentry IOBROKER-MODBUS-1C)

### 3.1.7 (2020-07-23)
* (Apollon77) Fix some Sentry crash reports (IOBROKER-MODBUS-N)

Expand Down
7 changes: 6 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,12 @@
"sentry": {
"dsn": "https://0c7b6d766435448cbf4908f615efe683@sentry.iobroker.net/84"
}
}
},
"dependencies": [
{
"js-controller": ">=2.0.0"
}
]
},
"native": {
"params": {
Expand Down
3 changes: 3 additions & 0 deletions lib/master.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ function Master(options, adapter) {
for (let b = 0; b < buffer.length; b++) {
buffer[b] = regs.config[(obj.native.address - regs.addressLow) * 2 + b];
}
if (!modbusClient) {
return void callback('client disconnected');
}
modbusClient.writeMultipleRegisters(regs.deviceId, obj.native.address, buffer)
.then(response => callback())
.catch(err => {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
"@iobroker/adapter-core": "^2.4.0"
},
"devDependencies": {
"@alcalzone/release-script": "^1.4.1",
"@alcalzone/release-script": "^1.8.1",
"gulp": "^4.0.2",
"mocha": "^8.0.1",
"mocha": "^8.1.3",
"chai": "^4.2.0",
"nan": "2.14.1",
"modbus-stack": "^0.2.1"
Expand Down

0 comments on commit cddd3e5

Please sign in to comment.