Add erase-hca.js
This commit is contained in:
8
packages/usb/erase-hca.js
Executable file
8
packages/usb/erase-hca.js
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env node
|
||||
const uhk = require('./uhk');
|
||||
|
||||
const device = uhk.getUhkDevice();
|
||||
uhk.eraseHca(device)
|
||||
.catch((err)=>{
|
||||
console.error(err);
|
||||
});
|
||||
@@ -393,6 +393,12 @@ async function writeHca(device, isIso) {
|
||||
await uhk.launchEepromTransfer(device, uhk.eepromOperations.write, configBufferIds.hardwareConfig);
|
||||
}
|
||||
|
||||
async function eraseHca(device) {
|
||||
const buffer = new Buffer(Array(64).fill(0xff));
|
||||
await uhk.writeConfig(device, buffer, true);
|
||||
await uhk.launchEepromTransfer(device, uhk.eepromOperations.write, configBufferIds.hardwareConfig);
|
||||
}
|
||||
|
||||
async function getModuleProperty(device, slotId, moduleProperty) {
|
||||
await writeDevice(device, [uhk.usbCommands.getModuleProperty, slotId, moduleProperty]);
|
||||
}
|
||||
@@ -423,6 +429,7 @@ uhk = exports = module.exports = moduleExports = {
|
||||
launchEepromTransfer,
|
||||
writeUca,
|
||||
writeHca,
|
||||
eraseHca,
|
||||
getModuleProperty,
|
||||
usbCommands: {
|
||||
getDeviceProperty : 0x00,
|
||||
|
||||
Reference in New Issue
Block a user