usb

Issues with PySerial: Port must be configured before it can be used

回眸只為那壹抹淺笑 提交于 2019-12-24 03:45:10
问题 I am writing code (in python) to use serial communication with an Arduino, using the pySerial library, on Windows 7. However, I am having issues using the ports correctly. Here is my code: import serial #sets the connection parameters, relook at when know more ser = serial.Serial( port ='COM4', baudrate = 9600, parity = serial.PARITY_ODD, stopbits = serial.STOPBITS_TWO, bytesize = serial.EIGHTBITS ) ser = serial.Serial() ser.open() #opens port ser.isOpen() #returns true? handStateList = [0]*3

How to use USB over Remote Connection to a Virtual Machine

廉价感情. 提交于 2019-12-24 03:22:15
问题 I'm trying to do mobile application development (BlackBerry, Android) on a virtual machine. My idea is that no matter what desktop I'm on I can open a remote connection to the virtual machine and have my mobile development environment ready. The problem is that I would like to deploy code to the mobile device as if it were physically connected to the virtual machine. Ideally the devices will be plugged in to the client machine that is creating the remote connection. I'm currently using VMWare

Cannot access usb webcam through OpenCV, Cygwin

拟墨画扇 提交于 2019-12-24 02:08:17
问题 I've downloaded and installed cygwin for windows, I downloaded opencv (ported version for cygwin) and installed it successfully and my code compiles. The problem I have is that CvCapture* capture = cvCreateCameraCapture(-1); is always null! The usb webcam is connected and is not in use. Why I can't access my webcam in cygwin? (Is there any particular reason like for example I should mount the device first, If this is the case I have no knowledge about it) Please advice 来源: https:/

c#.NET USB device persistent identifier

纵饮孤独 提交于 2019-12-24 01:50:55
问题 I am looking for a way in C# to have a persistent (across when end-users unplug a hub/restart their computer) identifier for USB slots, more specifically, SD card readers. Drive letters are not always assigned to the same slot, but I need a way to identify Slot A physically; as once I can identify it, I can make the connections to a drive letter. So my question(s): Is this possible? If so, how would I go about getting these identifiers? 回答1: WMI class Win32_USBHub. ManagementObjectSearcher

Read data received to android phone from a PC

百般思念 提交于 2019-12-24 00:59:16
问题 I have a requirement to implement a solution to read data from an android device , connected to PC via a USB cable. i.e. the phone connected to the PC will receive data through another android device via NFC where the PC - C# program must read the received data from the plugged in android phone as show below. [PC]<----(2. read data) usb cable----[android phone]<-----NFC (1. transmit string)-----[android phone] I have implemented data transmission via NFC utlizing the link here - http:/

notification message only shows when device connected to USB

会有一股神秘感。 提交于 2019-12-24 00:57:17
问题 The notification message string in my app only shows if the development device is connected to USB. As soon as I disconnect the phone from USB, even with the app open, the notifications for my app no longer shows the message, it is just blank, yet everything else seems to work fine for the notification. I have no errors in logcat when running app in ADB, and all other params are passed successfully to the notification. The only issue is the setContentText() only seems to work if phone is

WinUSB_Initialize function occurs INVALID_FUNCTION (0x1) Error

蓝咒 提交于 2019-12-24 00:29:14
问题 Why does the WinUSB_Initialize function occur INVALID_FUNCTION (0x1) Error? This is a function from the winusb.dll which returns an interface handle. I would like to get an Interface handle. I already have a Device handle. internal struct devInfo { internal SafeFileHandle deviceHandle; internal IntPtr winUsbHandle; internal Byte bulkInPipe; internal Byte bulkOutPipe; internal Byte interruptInPipe; internal Byte interruptOutPipe; internal UInt32 devicespeed; } internal const Int32 FILE

How can I view/edit my registry settings on a Windows CE 6 device?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-23 20:19:04
问题 In his second comment here, PaulH suggests changing registry settings, providing this link. I'm not sure editing the registry is really something I want to do, because copying files to the handheld was working fine until late yesterday, and I doubt any change was made to the registry to cause that problem to commence, so I'm not at all sure that changing the registry will fix the problem. At any rate, I wanted to compare the values I have in the registry with what is shown on that msdn page

Use the Windows raw access APIs to directly access the USB drive

北慕城南 提交于 2019-12-23 17:43:23
问题 At the end of USB physical drive, I want to write data directly using windows raw access API. I don't want to use kernel driver to do that. As far as I know, HDD direct access is blocked from windows xp sp2 or sp3(?) for security reason. I'm not sure this is true for USB drive. Please guide me how to get there. Thanks a lot. 回答1: It depends on how "direct" you want to be. Something like HANDLE hDrive = CreateFile("\\\\.\\F:", ...); ReadFile(hDrive, ...); should get you what you need in most

UsbDevice.FromIdAsync returns null

主宰稳场 提交于 2019-12-23 17:03:12
问题 I have this code: private async void OnDeviceAdded(DeviceWatcher watcher, DeviceInformation deviceInformation) { if (deviceInformation.Name.StartsWith("ClearShot") && deviceInformation.IsEnabled) { targetDevice = await UsbDevice.FromIdAsync(deviceInformation.Id); OnConnected(EventArgs.Empty); } } This is actually an event that is called from a DeviceWatcher The problem is that targetDevice is always null. No crashes no nothing, It's just null, doesn't change. Why ? Edit: This is the thing