From 15a56659b66045c8e1772f88224e34f165f3dcb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Thu, 5 Oct 2017 02:46:49 +0200 Subject: [PATCH] Add script. --- packages/usb/apply-config.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 packages/usb/apply-config.js diff --git a/packages/usb/apply-config.js b/packages/usb/apply-config.js new file mode 100755 index 00000000..51f296d7 --- /dev/null +++ b/packages/usb/apply-config.js @@ -0,0 +1,8 @@ +#!/usr/bin/env node +const uhk = require('./uhk'); + +const device = uhk.getUhkDevice(); +const sendData = new Buffer([uhk.usbCommands.applyConfig]); +device.write(uhk.getTransferData(sendData)); +const response = Buffer.from(device.readSync()); +console.log(response);