libusb-1.0

How to send data to USB device in node.js using libusb

一世执手 提交于 2019-11-29 04:27:53
I have try to get data from device (USB thermometer), following this docs https://www.npmjs.org/package/usb , but I have not any result. For getting themperature data from device, I should send the data like that 'd\n'. This is my code: var usb = require('usb'), term = usb.findByIds(65535, 2); term.open(); var endpoints = term.interfaces[0].endpoints, inEndpoint = endpoints[0], outEndpoint = endpoints[1]; inEndpoint.transferType = 2; inEndpoint.startStream(1, 64); inEndpoint.transfer(64, function (error, data) { if (!error) { console.log(data); } else { console.log(error); } }); inEndpoint.on(

More than one file was found with OS independent path 'lib/x86/libusb.so'

ぐ巨炮叔叔 提交于 2019-11-27 06:47:27
问题 I am using libusb in my android application. When I am trying to build libusb native library then I get below error message, *.so files generated. Error:Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'. More than one file was found with OS independent path 'lib/x86/libusb.so' build.gradle import org.apache.tools.ant.taskdefs.condition.Os apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android {