Add switch-keymap.js

This commit is contained in:
László Monda
2018-03-30 12:48:28 +02:00
parent beed546ae4
commit 7656af76e4
2 changed files with 10 additions and 0 deletions

9
packages/usb/switch-keymap.js Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env node
const uhk = require('./uhk');
const device = uhk.getUhkDevice();
const sendData = Buffer.concat([new Buffer([uhk.usbCommands.switchKeymap, 3]), new Buffer('TES')]);
console.log(sendData)
device.write(uhk.getTransferData(sendData));
const response = Buffer.from(device.readSync());
console.log(response);

View File

@@ -299,6 +299,7 @@ uhk = exports = module.exports = moduleExports = {
getModuleProperty : 0x0e,
getSlaveI2cErrors : 0x0f,
setI2cBaudRate : 0x10,
switchKeymap : 0x11,
},
enumerationModes: {
bootloader: 0,