Skip to content

Commit

Permalink
fix: increase response timeout to 30 seconds and maximum to 60 seco…
Browse files Browse the repository at this point in the history
…nds (#6378)
  • Loading branch information
AlCalzone authored Oct 9, 2023
1 parent cf1d9c6 commit 47b8b9e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions packages/zwave-js/src/lib/driver/Driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ const defaultOptions: ZWaveOptions = {
timeouts: {
ack: 1000,
byte: 150,
response: 10000,
// Ideally we'd want to have this as low as possible, but some
// 500 series controllers can take upwards of 10 seconds to respond sometimes.
response: 30000,
report: 1000, // ReportTime timeout SHOULD be set to CommandTime + 1 second
nonce: 5000,
sendDataCallback: 65000, // as defined in INS13954
Expand Down Expand Up @@ -297,9 +299,9 @@ function checkOptions(options: ZWaveOptions): void {
ZWaveErrorCodes.Driver_InvalidOptions,
);
}
if (options.timeouts.response < 500 || options.timeouts.response > 20000) {
if (options.timeouts.response < 500 || options.timeouts.response > 60000) {
throw new ZWaveError(
`The Response timeout must be between 500 and 20000 milliseconds!`,
`The Response timeout must be between 500 and 60000 milliseconds!`,
ZWaveErrorCodes.Driver_InvalidOptions,
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/zwave-js/src/lib/driver/ZWaveOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface ZWaveOptions extends ZWaveHostOptions {
* How long to wait for a controller response. Usually this timeout should never elapse,
* so this is merely a safeguard against the driver stalling.
*/
response: number; // [500...20000], default: 10000 ms
response: number; // [500...60000], default: 30000 ms

/** How long to wait for a callback from the host for a SendData[Multicast]Request */
sendDataCallback: number; // >=10000, default: 65000 ms
Expand Down

0 comments on commit 47b8b9e

Please sign in to comment.