Skip to content

Commit 335c96d

Browse files
author
Marco Crespi
committed
Merge branch 'develop'
2 parents fac4518 + 3827038 commit 335c96d

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

lib/bindings/dbus/Adapter.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/bindings/dbus/Adapter.js

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/bindings/dbus/Adapter.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bindings/dbus/Adapter.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { DbusMODblue } from './MODblue';
77
import { DbusPeripheral } from './Peripheral';
88

99
const UPDATE_INTERVAL = 5; // in seconds
10+
const SCAN_STATE_TIMEOUT = 10; // in seconds
1011

1112
export class DbusAdapter extends Adapter {
1213
public modblue: DbusMODblue;
@@ -124,7 +125,7 @@ export class DbusAdapter extends Adapter {
124125
resolve();
125126
}
126127
};
127-
const timer = setTimeout(() => reject(new Error('Scan state never changed')));
128+
const timer = setTimeout(() => reject(new Error('No scan state change')), SCAN_STATE_TIMEOUT * 1000);
128129
this.scanChangeListeners.push(listener);
129130
});
130131
}
@@ -177,7 +178,7 @@ export class DbusAdapter extends Adapter {
177178
resolve();
178179
}
179180
};
180-
const timer = setTimeout(() => reject(new Error('Scan state never changed')));
181+
const timer = setTimeout(() => reject(new Error('No scan state change')), SCAN_STATE_TIMEOUT * 1000);
181182
this.scanChangeListeners.push(listener);
182183
});
183184
}

0 commit comments

Comments
 (0)