usb

USB Device Path In Swift

大城市里の小女人 提交于 2019-12-08 00:35:07
问题 This is the code that I have. I am able to detect when a USB device is connected, then poll it to see what the Device Name for the device is. I was hoping to use something along the lines of finding BSD Path (I think that's what it's called) or the TTY/CU mount location. When I try to change the key, I end up getting a EXCC_BAD_INSTRUCTION error. I know it must be be there somewhere! :P Any help would be appreciated! Thanks in advance! import Foundation import Cocoa class USBDetector { class

How to Fix TypeError: an integer is required in python 3.4, pyserial 2.7 virtual serial port

这一生的挚爱 提交于 2019-12-07 23:05:36
问题 EDITED Hello programmers Community, I have some problems dealing with pyserial in Python 3.4 first I do not have serial ports so I have used "Virtual Serial Port Driver 7.2 by Eltima Software" to create virtual serial ports in pairs, which means that I can try to send and receive data from these ports, in my case I just create COM1 connected to COM2, then I installed Hercules SETUP utility by HW group to monitor these serial ports, so IN THEORY IF I SEND(write) DATA IN PYTHON I CAN SEE IT IN

Can Silverlight access a .Net library that accesses a USB port?

半城伤御伤魂 提交于 2019-12-07 18:57:42
问题 We have a .Net library that accesses some custom hardware via a USB port. I've read that Silverlight contains a subset of the .Net runtime. So, my question is, would this subset be sufficient for the .Net library to function? 回答1: YES YOU COULD an update only for people like me that founds this question, here the answer: http://blogs.msdn.com/b/silverlight_sdk/archive/2011/09/27/pinvoke-in-silverlight5-and-net-framework.aspx 回答2: No, you cannot use a .NET library that accesses a USB port from

Connecting to Digital Scale(Metler Toledo PS90) as HID runs OnReport only when cable is connected to computer for first time

二次信任 提交于 2019-12-07 18:57:06
问题 I am using Mike O Brien's HID Library to connect to digital scale, Device opens successfully then displays device attached & removed messages perfectly. But only runs OnReport for about 20 times initially After Inital approx 20 runs on OnReport it never runs again, unless I remove usb cable and re-connect. My code is below if (scale.IsConnected) { scale.Inserted += DeviceAttachedHandler; scale.Removed += DeviceRemovedHandler; scale.MonitorDeviceEvents = true; scale.ReadReport(OnReport);

iOS USB HID programming

99封情书 提交于 2019-12-07 17:53:54
问题 I am trying to make some code regarding USB HID devices. I have found an article about Bluetooth programming which uses Game Kit Framework. Now I'm looking for some tutorial or maybe some code to work on connecting HID device via USB. Where should I look? Is Game Kit the right way? Is it difficult to implement communication between iOS and HID device? 回答1: You can use IOKit for USB, but it's a private framework on iOS - so it depends if you want to deploy to the App Store. Here is the USB

How to get device descriptor and configuration descriptor of usb device in Mac?

吃可爱长大的小学妹 提交于 2019-12-07 17:50:50
问题 I have minimum exposure to xcode and I/Okit framework. I have seen device descriptor and configuration descriptor of a usb device in USB prober. I have written an xcode program using I/O kit framework which gives the usb device name as output, when we give product id and vendor id of that device as input. /*Take the vendor and product id from console*/ printf("\nEnter the vendor id : "); scanf("%lx",&usbVendor); printf("\nEnter the product id :"); scanf("%lx",&usbProduct); /* Set up a

“ The crash happened outside the Java Virtual Machine in native code.”how to solve this error (Java)?

旧城冷巷雨未停 提交于 2019-12-07 15:20:18
问题 Using the library in this link http://www.blog.kslemb.com/doku.php/en/projects/globx/java_hid I have been modfied this code to write on a HID terminal if (HIDHandle.equals(WinBase.INVALID_HANDLE_VALUE)) { return HID_DEVICE_NOT_OPENED; } /* Write Feature report */ boolean Status=Kernel32.INSTANCE.WriteFile(HIDHandle, buffer, (int)buffersize, null, null); if (Status == false) { debug("Write File: " + getSystemError(Kernel32.INSTANCE.GetLastError())); return HID_DEVICE_TRANSFER_FAILED; } else {

USB relay commands

痴心易碎 提交于 2019-12-07 13:55:40
问题 I have this USB Relay: http://www.ebay.com/itm/5V-USB-Relay-2-Channel-Programmable-Computer-Control-For-Smart-Home-/141097843081?pt=LH_DefaultDomain_0&hash=item20da163989 Al I need is to send close/open to the device (to turn on & off an LED light) How can I do that using C# or C++? Thanks Boaz 回答1: Here's what you need (tested on Linux) : HIDAPI from http://www.signal11.us/oss/hidapi/ USBRELAY from https://github.com/darrylb123/usbrelay/blob/master/README.md Use it like : usbrelay ZG4HU_1=1

Reading USB-GPS info with Python

不羁的心 提交于 2019-12-07 13:04:25
问题 I've written a small python script that uses information from a usb gps dongle. This far I've been working in linux where I could just identify the device in /dev/ and read NMEA data from it using pySerial. This isn't a perfect solution though and it's not platform independent in any way so I started looking at pyUSB to try to communicate with the device. The device: Product name: ND-100S baud rate: 4800 USB class: 0xEF subclass: 2 My problem is that I know very little about usb so I don't

android usb UsbDeviceConnection.bulkTransfer returns -1

徘徊边缘 提交于 2019-12-07 11:36:43
问题 I am trying to send commands to a POS printer from my android tablet. I have been able to get the basic connections wroking but now when I try to send data to the printer, the bulkTransfer returns -1. Please help me understand what is going on. The following is a modified broadcast receiver taken from the android site where I do all the data transfer. private final BroadcastReceiver mUsbReceiver = new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { String action