Skip to content

Commit

Permalink
fix: increase default controller response timeout to 10s (#4259)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCalzone committed Mar 4, 2022
1 parent e2444bb commit 9c18a38
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/api/driver.md
Original file line number Diff line number Diff line change
Expand Up @@ -613,9 +613,9 @@ interface ZWaveOptions {
/**
* How long to wait for a controller response. Usually this timeout should never elapse,
* so this is merely a safeguard against the driver stalling
* so this is merely a safeguard against the driver stalling.
*/
response: number; // [500...5000], default: 1600 ms
response: number; // [500...20000], default: 10000 ms
/** How long to wait for a callback from the host for a SendData[Multicast]Request */
sendDataCallback: number; // >=10000, default: 65000 ms
Expand Down
6 changes: 3 additions & 3 deletions packages/zwave-js/src/lib/driver/Driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ const defaultOptions: ZWaveOptions = {
timeouts: {
ack: 1000,
byte: 150,
response: 1600,
response: 10000,
report: 1000, // ReportTime timeout SHOULD be set to CommandTime + 1 second
nonce: 5000,
sendDataCallback: 65000, // as defined in INS13954
Expand Down Expand Up @@ -245,9 +245,9 @@ function checkOptions(options: ZWaveOptions): void {
ZWaveErrorCodes.Driver_InvalidOptions,
);
}
if (options.timeouts.response < 500 || options.timeouts.response > 5000) {
if (options.timeouts.response < 500 || options.timeouts.response > 20000) {
throw new ZWaveError(
`The Response timeout must be between 500 and 5000 milliseconds!`,
`The Response timeout must be between 500 and 20000 milliseconds!`,
ZWaveErrorCodes.Driver_InvalidOptions,
);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/zwave-js/src/lib/driver/ZWaveOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export interface ZWaveOptions {

/**
* How long to wait for a controller response. Usually this timeout should never elapse,
* so this is merely a safeguard against the driver stalling
* so this is merely a safeguard against the driver stalling.
*/
response: number; // [500...5000], default: 1600 ms
response: number; // [500...20000], default: 10000 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 9c18a38

Please sign in to comment.