From 7656af76e4fc8665406b638f2be982b7f7491c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Fri, 30 Mar 2018 12:48:28 +0200 Subject: [PATCH] Add switch-keymap.js --- packages/usb/switch-keymap.js | 9 +++++++++ packages/usb/uhk.js | 1 + 2 files changed, 10 insertions(+) create mode 100755 packages/usb/switch-keymap.js diff --git a/packages/usb/switch-keymap.js b/packages/usb/switch-keymap.js new file mode 100755 index 00000000..30ff1efb --- /dev/null +++ b/packages/usb/switch-keymap.js @@ -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); diff --git a/packages/usb/uhk.js b/packages/usb/uhk.js index 3ca7f188..dc5b908f 100644 --- a/packages/usb/uhk.js +++ b/packages/usb/uhk.js @@ -299,6 +299,7 @@ uhk = exports = module.exports = moduleExports = { getModuleProperty : 0x0e, getSlaveI2cErrors : 0x0f, setI2cBaudRate : 0x10, + switchKeymap : 0x11, }, enumerationModes: { bootloader: 0,