Fix write-hca.js and write-user.js, and remove write-config.js. Fixes #627.
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
#!/usr/bin/env node
|
||||
const program = require('commander');
|
||||
const fs = require('fs');
|
||||
const uhk = require('./uhk');
|
||||
|
||||
(async function() {
|
||||
const device = uhk.getUhkDevice();
|
||||
require('shelljs/global');
|
||||
|
||||
program
|
||||
.usage(`config.bin`)
|
||||
.option('-h, --hardware-config', 'Write the hardware config instead of the user config')
|
||||
.parse(process.argv);
|
||||
|
||||
if (program.args.length == 0) {
|
||||
console.error('No binary config file specified.');
|
||||
exit(1);
|
||||
}
|
||||
|
||||
const configBin = program.args[0];
|
||||
const isHardwareConfig = program.hardwareConfig;
|
||||
const configTypeString = isHardwareConfig ? 'hardware' : 'user';
|
||||
const configBuffer = fs.readFileSync(configBin);
|
||||
|
||||
await uhk.writeUserConfig(device, configBuffer, isHardwareConfig);
|
||||
})();
|
||||
@@ -12,7 +12,8 @@ if (layout !== 'iso' && layout !== 'ansi') {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
uhk.writeHca(layout === 'iso')
|
||||
const device = uhk.getUhkDevice();
|
||||
uhk.writeHca(device, layout === 'iso')
|
||||
.catch((err)=>{
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
@@ -17,5 +17,6 @@ const uhk = require('./uhk');
|
||||
const device = uhk.getUhkDevice();
|
||||
const configBuffer = fs.readFileSync(configPath);
|
||||
await uhk.writeConfig(device, configBuffer, false);
|
||||
await uhk.launchEepromTransfer(device, uhk.eepromOperations.write, uhk.configBufferIds.stagingUserConfig);
|
||||
await uhk.applyConfig(device);
|
||||
await uhk.launchEepromTransfer(device, uhk.eepromOperations.write, uhk.configBufferIds.validatedUserConfig);
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user