usb

Mixed types are not supported

送分小仙女□ 提交于 2019-12-06 13:16:01
Please have a look at the following header file #pragma once using namespace UsbLibrary; ref class MissileLauncher { public: MissileLauncher(void); private: //Bytes used in command unsigned char UP[10]; unsigned char RIGHT[10]; unsigned char LEFT[10]; unsigned char DOWN[10]; unsigned char FIRE[10]; unsigned char STOP[10]; unsigned char LED_OFF[9]; unsigned char LED_ON[9]; UsbHidPort USB; }; I am using a Visual C++ project (C++/CLI ?) in visual studio professional 2010. When I run this code, I get lot of errors Error 1 error C4368: cannot define 'UP' as a member of managed 'MissileLauncher':

Java: util_USBUIRT.dll: Can't find dependent libraries

本小妞迷上赌 提交于 2019-12-06 12:53:44
I want to use this JAR file ( http://sourceforge.net/projects/uirt-j/ ) in my project. In Eclipse I used th option Project > Java Build Path > Add External JARs to import it. I can see all classes of JAR file in Ecplise. This JAR contains two dll files. In order to load dlls, I put into System32 dir, but when a execute my code, a I get the follow error: Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Windows\System32\util_USBUIRT.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(Unknown Source) at

Udev rules are not working for libusb on Ubuntu 12.04

岁酱吖の 提交于 2019-12-06 11:27:40
问题 I'm on Ubuntu 12.04.5 LTS, x86_64. I've a usb device that uses libusb to communicate with the computer. Once I plug it into the computer and run the communication program I get the following error: libusb couldn't open USB device /dev/bus/usb/008/004: Permission denied. libusb requires write access to USB device nodes. libusb failed to find the Optotrak USB device. Are you sure you have set the udev permissions correctly? So if I chmod the /dev/bus/usb/008/004 as follows: sudo chmod 777 /dev

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

馋奶兔 提交于 2019-12-06 11:17:25
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); MessageBox.Show("Hold Application Here"); Event Handlers for the scale private void DeviceAttachedHandler()

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

余生颓废 提交于 2019-12-06 11:17:06
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? 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 No, you cannot use a .NET library that accesses a USB port from inside Silverlight. The closest you can get is an SL4 Out-of-browser app with elevated privs which can use COM

how to get usb's urb info in linux

笑着哭i 提交于 2019-12-06 09:30:33
问题 I'm try to get usb stick's urb info. And I write like follows: #include <sys/ioctl.h> #include <errno.h> #include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <usb.h> /* #include <stropts.h> */ /* #include <inttypes.h> */ #include <linux/usbdevice_fs.h> /* #include <asm/byteorder.h> */ /* #include <linux/usb/ch9.h> */ #define USBDEVFS_REAPURB _IOW('U', 12, void *) int main(int argc, char *argv[]) { int fd; int result; int i; struct usbdevfs

Is it possible to send file from android smart phone to computer / PC programmatically?

被刻印的时光 ゝ 提交于 2019-12-06 09:28:38
问题 I have tried to find a information/way about this case and I found 3 ways to do this, there is : using adb usb host usb accessory but, I'm still not found the solution. anybody can help me about this case? 回答1: you can use socket: Server side: import java.io.*; import java.net.*; public class FileServer { public static void main(String[] args) throws IOException { int filesize=6022386; // filesize temporary hardcoded long start = System.currentTimeMillis(); int bytesRead; int current = 0; //

Discover serial ports in C#

余生长醉 提交于 2019-12-06 08:59:20
I'm writing an application that communicates by sending bytes to the USB port. I'd like to allow the user to choose the port and to do that, I use SerialPort.GetPortNames() . Unfortunately, it returns an empty array. The method supposedly reads the registry for data (HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM), but the SERIALCOMM directory is missing. When I run the program on Linux, it lists my four USB ports, as expected. How can I fix the registry/discover the ports in a different way? The SerialPort.GetPortNames() are the correct method to discover serial ports. But if you are using

detecting usb-device insertion and removal in c#

陌路散爱 提交于 2019-12-06 08:13:19
问题 i tried one of the solutions in this thread Detecting USB drive insertion and removal using windows service and c#. but i stil get errors, because of the thread-unsafe call to windows forms control. here is my code private void initWatchers() { WqlEventQuery insertQuery = new WqlEventQuery("SELECT * FROM __InstanceCreationEvent WITHIN 2 WHERE TargetInstance ISA 'Win32_USBHub'"); ManagementEventWatcher insertWatcher = new ManagementEventWatcher(insertQuery); insertWatcher.EventArrived += new

How to interact with USB device using PyUSB

怎甘沉沦 提交于 2019-12-06 08:12:36
I have so far gotten to the stage of finding the device, now I am ready to talk to the USB using the devices protocol laid out in the specification on page 22. libusb is installed on my machine and so is PyUSB. import usb.core import usb.util # find our device dev = usb.core.find(idVendor=0x067b, idProduct=0x2303) # was it found? if dev is None: raise ValueError('Device not found') # b are bytes, w are words reqType = '' bReq = '' wVal = '' wIndex = '' dev.ctrl_transfer(reqType, bReq, wVal, wIndex, []) The above example is attempting to use a control transfer, which I assume is what the