usb

Is there a C++ cross platform USB library?

牧云@^-^@ 提交于 2019-12-31 10:41:29
问题 I'm (going to be) writing an application in Qt that will run on the 3 main OSes (Windows, Linux and Mac). One of the features of this app is that it needs USB to talk to a piece of custom external hardware. Is there a cross-platform USB library available? 回答1: Try libusb. Supported operating systems: Linux, FreeBSD, NetBSD, OpenBSD, Darwin, MacOS X (and Windows, through the libusb-win32 project). But you should note that it uses libusb0.sys kernel-mode driver on Windows, which is not WHQL

Is there an equivalent of lsusb for OS X

老子叫甜甜 提交于 2019-12-31 07:59:45
问题 This question seems to be all over google, but the answers all point to using System Profiler. That's nice, but with System Profiler all you get is something that looks like this: DasKeyboard: Product ID: 0x1919 Vendor ID: 0x04d9 (Holtek Semiconductor, Inc.) Version: 1.06 Speed: Up to 1.5 Mb/sec Location ID: 0x1d114000 / 11 Current Available (mA): 500 Current Required (mA): 100 USB2.0 Hub: Product ID: 0x0608 Vendor ID: 0x05e3 (Genesys Logic, Inc.) Version: 32.98 Speed: Up to 480 Mb/sec

Cannot communicate successfully with USB HID device using writefile()

微笑、不失礼 提交于 2019-12-31 04:16:15
问题 I am fairly new to C# as well as windows programming and I am attempting to establish communication between a USB HID device and an app written in c# on a windows xp pc. I have obtained the device path successfully and have used this to establish a valid Handle on the device: IntPtr drive = CreateFile(devicePath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, FILE_FLAG_DELETE_ON_CLOSE, IntPtr.Zero); This proved to be a valid handle that yields a

How to write usb touchscreen driver kext in os x 10.9?

可紊 提交于 2019-12-30 11:48:25
问题 I want to write a usb touchscreen kext for usb touch screen . I have read the Kernel Extension Programming Topics and the I/O Kit Fundamentals etc, My question is, 1 . how to get the input report messages from touch screen ? 2 . how to post the coordinate info to system ? I have no idea, anybody help? 回答1: It depends on the hardware; moreover, this question is quite broad - you'll need to be more specific in your question to get more specific answers. I'll try to provide a broad overview: A

Android USBHost mode - why does my IRDA device fail on claimInterface?

一世执手 提交于 2019-12-30 07:11:26
问题 I have a Lindy IRDA USB bridge attached to my Xperia Neo (Cyanogen Mod 9). I have changed the features to support host mode etc. All is looking fine in the code. I detect the device. I can see the interface and the two endpoints (one in, one out), however as soon as I try to claimInterface it fails, regardless of whether I atempt a force claim or not. There appears to be no simple way to find out why the claim fails. Though strace gives me a clue as the ioctl call for claim interface fails

Identify COM port using VID and PID for USB device attached to x64

自作多情 提交于 2019-12-30 06:40:29
问题 As following i able to get usb com port names attached to 32bit win7OS machine, by given pid and vid,but when running in x64 it stuck in the following line: comports.Add((string)rk6.GetValue("PortName")); This is my code static List<string> ComPortNames(String VID, String PID) { String pattern = String.Format("^VID_{0}.PID_{1}", VID, PID); Regex _rx = new Regex(pattern, RegexOptions.IgnoreCase); List<string> comports = new List<string>(); RegistryKey rk1 = Registry.LocalMachine; RegistryKey

USB_DEVICE_ATTACHED only startsActivity of Galaxy S3 ICS

半世苍凉 提交于 2019-12-30 06:21:29
问题 Recently I've been trying to receive the intent android.hardware.usb.action.USB_DEVICE_ATTACHED using a broadcast receiver as per all the samples and examples that I've seen. I've declared a reciever in the manifest; <receiver android:name=".UsbDeviceReceiver"> <intent-filter> <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" /> <action android:name="android.hardware.usb.action.USB_DEVICE_DETACHED" /> <category android:name="android.intent.category.DEFAULT" /> </intent

Retrieve USB information using pyudev with device name

北慕城南 提交于 2019-12-30 05:22:05
问题 I retrieve the first device information from the block subsystem. For example that a USB stick was assigned to /dev/sdb. This is all the infos I can retrieve via the block subsystem: [(u'DEVLINKS', u'/dev/disk/by-id/usb-Generic_Flash_Disk_63F2B6EC-0:0 /dev/disk/by-label/Fedora-Live-Desktop-x86_64-20-1 /dev/disk/by-path/pci-0000:00:1d.0-usb-0:1.2:1.0-scsi-0:0:0:0 /dev/disk/by-uu id/2013-12-12-00-56-55-00'), (u'DEVNAME', u'/dev/sdb'), (u'DEVPATH', u'/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1

Sending Hexadecimal data through Serial Port Communication in Linux

我的未来我决定 提交于 2019-12-30 05:18:15
问题 I have got a task of sending hexadecimal data to my COMPORT in linux. I have written this simple C code, but it sends only a decimal number. Can anyone help me in sending an hexadecimal bit. Here is the code I have written #include <stdio.h> /* Standard input/output definitions */ #include <string.h> /* String function definitions */ #include <unistd.h> /* UNIX standard function definitions */ #include <fcntl.h> /* File control definitions */ #include <errno.h> /* Error number definitions */

Sending and receiving data over USB port

点点圈 提交于 2019-12-30 05:10:10
问题 I'd like to send/receive data over a USB port to a device (from my vista pc). Is there a free/cheap library out there that can do this, and how involved would this project be (not taking into account what's being sent or received) ? 回答1: You don't specify what's going on here. Does the device already exist? Is it already a USB device? If you already have a USB device, then the manufacturer should be able to help. If you are building the device, then you might want to look at something like a