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);
|
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) {
|
async function getModuleProperty(device, slotId, moduleProperty) {
|
||||||
await writeDevice(device, [uhk.usbCommands.getModuleProperty, slotId, moduleProperty]);
|
await writeDevice(device, [uhk.usbCommands.getModuleProperty, slotId, moduleProperty]);
|
||||||
}
|
}
|
||||||
@@ -423,6 +429,7 @@ uhk = exports = module.exports = moduleExports = {
|
|||||||
launchEepromTransfer,
|
launchEepromTransfer,
|
||||||
writeUca,
|
writeUca,
|
||||||
writeHca,
|
writeHca,
|
||||||
|
eraseHca,
|
||||||
getModuleProperty,
|
getModuleProperty,
|
||||||
usbCommands: {
|
usbCommands: {
|
||||||
getDeviceProperty : 0x00,
|
getDeviceProperty : 0x00,
|
||||||
|
|||||||
Reference in New Issue
Block a user