From 3f78cc13404886f3879ad3b73eec43115ff2f70b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Tue, 31 Oct 2017 20:08:33 +0100 Subject: [PATCH] Add script to test hidapi stability by using readSync() calls. --- packages/usb/hidapi-sync-stress-test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 packages/usb/hidapi-sync-stress-test.js diff --git a/packages/usb/hidapi-sync-stress-test.js b/packages/usb/hidapi-sync-stress-test.js new file mode 100755 index 00000000..99667fc2 --- /dev/null +++ b/packages/usb/hidapi-sync-stress-test.js @@ -0,0 +1,12 @@ +#!/usr/bin/env node +const uhk = require('./uhk'); + +const device = uhk.getUhkDevice(); +let counter = 1; + +while (true) { + console.log(`hidapi sync test ${counter++}`); + const sendData = new Buffer([uhk.usbCommands.getProperty, uhk.systemPropertyIds.hardwareConfigSize]); + device.write(uhk.getTransferData(sendData)); + device.readSync() +}