Merge branch 'master' of github.com:UltimateHackingKeyboard/agent
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import { Device, devices } from 'node-hid';
|
import { Device, devices } from 'node-hid';
|
||||||
import { readFile } from 'fs-extra';
|
import { readFile } from 'fs-extra';
|
||||||
import { EOL } from 'os';
|
import { EOL } from 'os';
|
||||||
import MemoryMap from 'nrf-intel-hex';
|
import * as MemoryMap from 'nrf-intel-hex';
|
||||||
import { LogService } from 'uhk-common';
|
import { LogService } from 'uhk-common';
|
||||||
|
|
||||||
import { Constants, UsbCommand } from './constants';
|
import { Constants, UsbCommand } from './constants';
|
||||||
|
|||||||
17
packages/usb/kboot-firmware-upgrade.ts
Normal file
17
packages/usb/kboot-firmware-upgrade.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import * as path from 'path';
|
||||||
|
import { LogService } from 'uhk-common';
|
||||||
|
import { UhkHidDevice, UhkOperations } from 'uhk-usb';
|
||||||
|
|
||||||
|
const logService = new LogService();
|
||||||
|
const rootDir = path.join(__dirname, '../../tmp');
|
||||||
|
const uhkHidDevice = new UhkHidDevice(logService, {}, rootDir);
|
||||||
|
const uhkOperations = new UhkOperations(logService, uhkHidDevice, rootDir);
|
||||||
|
|
||||||
|
uhkOperations
|
||||||
|
.updateRightFirmware()
|
||||||
|
.then(() => uhkOperations.updateLeftModule())
|
||||||
|
.then(() => console.log('Firmware upgrade finished'))
|
||||||
|
.catch(error => {
|
||||||
|
console.error(error);
|
||||||
|
process.exit(-1);
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user