Make the bootloader timeout of the reenumerate script specifiable.
This commit is contained in:
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "uhk-agent",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
7
packages/uhk-usb/package-lock.json
generated
7
packages/uhk-usb/package-lock.json
generated
@@ -1,14 +1,11 @@
|
||||
{
|
||||
"name": "uhk-usb",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"lockfileVersion": 1,
|
||||
"dependencies": {
|
||||
"@types/node": {
|
||||
"version": "8.0.28",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-8.0.28.tgz",
|
||||
"integrity": "sha512-HupkFXEv3O3KSzcr3Ylfajg0kaerBg1DyaZzRBBQfrU3NN1mTBRE7sCveqHwXLS5Yrjvww8qFzkzYQQakG9FuQ==",
|
||||
"dev": true
|
||||
"integrity": "sha512-HupkFXEv3O3KSzcr3Ylfajg0kaerBg1DyaZzRBBQfrU3NN1mTBRE7sCveqHwXLS5Yrjvww8qFzkzYQQakG9FuQ=="
|
||||
},
|
||||
"ansi-regex": {
|
||||
"version": "2.1.1",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { cloneDeep, isEqual } from 'lodash-es';
|
||||
import { cloneDeep, isEqual } from 'lodash';
|
||||
import { Device, devices, HID } from 'node-hid';
|
||||
import { CommandLineArgs, LogService } from 'uhk-common';
|
||||
|
||||
|
||||
@@ -2,9 +2,12 @@
|
||||
const uhk = require('./uhk');
|
||||
const program = require('commander');
|
||||
|
||||
program.parse(process.argv);
|
||||
program
|
||||
.option('-t, --timeout <ms>', 'Bootloader timeout in ms', 5000)
|
||||
.parse(process.argv);
|
||||
|
||||
const enumerationMode = program.args[0];
|
||||
|
||||
(async function() {
|
||||
await uhk.reenumerate(enumerationMode);
|
||||
await uhk.reenumerate(enumerationMode, program.timeout);
|
||||
})();
|
||||
|
||||
@@ -191,8 +191,7 @@ async function updateDeviceFirmware(firmwareImage, extension) {
|
||||
|
||||
// USB commands
|
||||
|
||||
function reenumerate(enumerationMode) {
|
||||
const bootloaderTimeoutMs = 5000;
|
||||
function reenumerate(enumerationMode, bootloaderTimeoutMs=5000) {
|
||||
const pollingIntervalMs = 100;
|
||||
let pollingTimeoutMs = 10000;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user