Merge branch 'master' of github.com:UltimateHackingKeyboard/agent

This commit is contained in:
László Monda
2019-08-03 12:51:19 +02:00
2 changed files with 18 additions and 1 deletions

View File

@@ -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';

View 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);
});