usb

how can the directory of a usb drive connected to a system be obtained?

我只是一个虾纸丫 提交于 2020-01-12 08:24:08
问题 I need to obtain the path to the directory created for a usb drive(I think it's something like /media/user/xxxxx) for a simple usb mass storage device browser that I am making. Can anyone suggest the best/simplest way to do this? I am using an Ubuntu 13.10 machine and will be using it on a linux device. Need this in python. 回答1: This should get you started: #!/usr/bin/env python import os from glob import glob from subprocess import check_output, CalledProcessError def get_usb_devices(): sdb

Play Video using connected USB via OTG cable in Android?

萝らか妹 提交于 2020-01-12 06:01:33
问题 I want to ask that there are application available in which user can connect USB to Android via OTG cable device and play the media (specially videos) contained by it. i have made a Broadcast Receiver to detect the attached USB, i want to read the content also. I am using this code snippet. private final BroadcastReceiver mUsbReceiver = new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (UsbManager.ACTION_USB_DEVICE

Send file to computer system using USB

最后都变了- 提交于 2020-01-11 07:12:53
问题 I have such requirement in which i have to transfer file on computer system, lets consider windows PC. What i want to do is i have one screen with specific details,i am writing that values in one text file, now if user clicks on button then that file must be copied to computer at specific location using USB. I have tried to search about this but didn't get anything useful.I've also refer below link http://developer.android.com/guide/topics/connectivity/usb/host.html Is it possible in Android,

Access USB with Java, in order to find thumbdrive manufacturer's serial#/unique-ID

半世苍凉 提交于 2020-01-10 19:31:25
问题 Looking for a way to read the unique ID / serial# of a USB thumb drive; please note that - I am looking for the value of the manufacturer, not the one Windows allocates for it. - I need to support multiple OS (Windows, Unix, Mac), thus needs to be a Java solution The idea is to be able to distinguish between different USB thumb drives. 回答1: RXTX is the way to go. In the world of model trains, JMRI (Java Model Railroad Interface) has become very popular. JMRI runs on all platforms (Windows,

Access USB with Java, in order to find thumbdrive manufacturer's serial#/unique-ID

*爱你&永不变心* 提交于 2020-01-10 19:30:09
问题 Looking for a way to read the unique ID / serial# of a USB thumb drive; please note that - I am looking for the value of the manufacturer, not the one Windows allocates for it. - I need to support multiple OS (Windows, Unix, Mac), thus needs to be a Java solution The idea is to be able to distinguish between different USB thumb drives. 回答1: RXTX is the way to go. In the world of model trains, JMRI (Java Model Railroad Interface) has become very popular. JMRI runs on all platforms (Windows,

adb connection by wifi getting killed when a new USB attached/detached

浪尽此生 提交于 2020-01-08 17:20:11
问题 I develop on my tablet using android studio . The tablet is connected to the computer by wifi using adb connect <ip_andress>:5555 My application contains listeners for USB devices attached/detached . But unfourtunately, when I connect/disconnect usb device to/from the tablet, the adb connection is getting killed , and I can no longer see the device under "adb devices". 回答1: It is not a adb-connection-by-wifi what gets killed. It is just that USB enumerations affect the sys.usb.* system

Spoofing a game controller

安稳与你 提交于 2020-01-07 09:53:41
问题 I'm trying to write something that will allow a user to use a keyboard/mouse combination on a games console. The approach I've thought of is to do the following: Figure out how input maps to output in the console's controller. This is good old trial and error, basically connecting the controller via USB to a computer and figuring out how the controller responds to input using detailed USB logging. Then, write a userland program that takes keyboard/mouse input and converts it to the controller

Debian Jessie not working hot plug with usb modem sierra 802

拜拜、爱过 提交于 2020-01-07 09:08:06
问题 When I connect modem befour PC start all works fine. But when connect to working PC have bug. Have no use any drivers from other place all work on default debian jessie repositories. Here dmesg: 171.342776] usbcore: registered new interface driver usb-storage [ 171.528837] usb 2-5: USB disconnect, device number 2 [ 171.998784] usb 2-5: new high-speed USB device number 3 using ehci-pci [ 172.131651] usb 2-5: New USB device found, idVendor=1199, idProduct=0029 [ 172.131658] usb 2-5: New USB

Sending raw text to printer via usb

。_饼干妹妹 提交于 2020-01-07 09:03:32
问题 I am trying to send ZPL commands to a Zebra ZT230 printer. The printer and drivers are installed and the printer port is "USB003". The PC communicates perfectly with the printer via either Zebra Printer Setup Utilities or ZebraDesign. I tried the following code: Private Declare Function CreateFile Lib "kernel32.dll" (ByVal lpFileName As String, ByVal dwDesiredAccess As FileAccess, _ ByVal dwShareMode As UInteger, ByVal lpSecurityAttributes As IntPtr, ByVal dwCreationDisposition As FileMode, _

Sending raw text to printer via usb

故事扮演 提交于 2020-01-07 09:03:11
问题 I am trying to send ZPL commands to a Zebra ZT230 printer. The printer and drivers are installed and the printer port is "USB003". The PC communicates perfectly with the printer via either Zebra Printer Setup Utilities or ZebraDesign. I tried the following code: Private Declare Function CreateFile Lib "kernel32.dll" (ByVal lpFileName As String, ByVal dwDesiredAccess As FileAccess, _ ByVal dwShareMode As UInteger, ByVal lpSecurityAttributes As IntPtr, ByVal dwCreationDisposition As FileMode, _