usb

How can I disable Android USB debugging programmatically

独自空忆成欢 提交于 2019-12-29 08:52:23
问题 There is a bug on some Samsung Android Phones causing USB-debugging to automatically be turned on if the USB is plugged in. This is obviously a security issue. I want to write a program which will disable USB debugging so that I can start it whenever usb-plug is inserted. Any ideas on how to do this? 回答1: It seems to be impossible. I think I must use Settings.System with ADB_ENABLED, but ADB_ENABLED is a Secure-System-Setting which cannot be changed by a normal application. :-( On the other

how to get vendor id and product id of a plugged usb device on windows

非 Y 不嫁゛ 提交于 2019-12-28 12:48:16
问题 I am using Qt on windows platform. i want to get and display vendor id and product id of a plugged usb device from my local system. Below is my full source code to get the vendor id and product id from the usb device. when i run the my qt application it does not throw me any errors . so i plug the usb device into the system. but my print statement displays the result as below qDebug ()<<pDetData->DevicePath; i get the result as 0x4 Whether i have any implementation mistakes in my source code

Communicate with smartcard reader through Android USB host

牧云@^-^@ 提交于 2019-12-28 11:57:27
问题 I'm trying to send a command to a smart card. I use a Gemalto IDBridge CT30 (PC TWIN reader) and a IDBridge K30 connected to the Android device over USB. I try to send a SELECT APDU command over USB: boolean claim = openedConnection.claimInterface(usbInterface, true); byte[] data = new byte[]{ (byte) 0x00, (byte) 0xA4, (byte) 0x04, (byte) 0x0C, (byte) 0x07, (byte) 0xA0, (byte) 0x00, (byte) 0x00, (byte) 0x01, (byte) 0x18, (byte) 0x45, (byte) 0x4E}; After that I receive an answer: final int

Reading and writing to USB (HID) interrupt endpoints on Mac

你。 提交于 2019-12-28 09:19:19
问题 I am attempting to communicate with a rather specific USB device and developing both Windows and Mac code to do so. The device is a USB device with a HID interface (class 3) with two endpoints, an interrupt input and an interrupt output. The nature of the device is such that data is sent out from the device on the input endpoint only when data is requested from the host: the host sends it data which the device responds to on its input interrupt endpoint. Getting data to the device (a write)

How to detect using c# if a pendrive is plugged into a USB port?

半世苍凉 提交于 2019-12-28 04:59:04
问题 Is there a way to find out when in a LAN anyone plugs in a pendrive to the USB port? Programatically (in C# preferably) or through some tool. Basically I'd imagine a client application sits on each terminal and monitors the USB ports and sends the information to the server. a.) Can I get the details of the file(s) being copied? b.) Is there a way to do this without a client application? EDIT I dont want to disable the USB port entirely. its to be on a need to have basis. Basically just want

Sign PDF with iTextSharp 5.3.3 and USB token

我们两清 提交于 2019-12-28 03:51:09
问题 I'm new to iTextSharp (and StackOverFlow). I'm trying to sign a PDF in C# using external USB token. I try using the follow code I've digged from the internet. Org.BouncyCastle.X509.X509CertificateParser cp = new Org.BouncyCastle.X509.X509CertificateParser(); //Get Sertifiacte X509Certificate2 certClient = null; X509Store st = new X509Store(StoreName.My, StoreLocation.CurrentUser); st.Open(OpenFlags.MaxAllowed); X509Certificate2Collection collection = X509Certificate2UI.SelectFromCollection(st

Is it possible to use winusb to communicate with multiple identical usb devices simultaneously?

╄→尐↘猪︶ㄣ 提交于 2019-12-26 18:23:47
问题 I am using multiple identical devices and i would like to be able to read from them simultaneously. So the Product and Vendor ID are the same for all devices. I am wondering if i will be able to read from them in parallel. In my opinion i would think that it should be possible because for specific device path, you create a unique winusb handle as well as a unique createfile handle. However in practice, i realized that it didn't work. I didn't use overlapped structure as i though they were

My board design with a FTDI chip is a lot slower than a generic off the shelf RS232 to USB cable. Why is that the case?

别来无恙 提交于 2019-12-25 18:22:10
问题 Hello People of the internet, The company I work at implement hardware that is using RS232 however the board uses a network cable instead of a standard DB9 RS232 connector. So to remove the custom cable they need to mufacture for customers I designed a simple RS232 to USB converter that has a USB on the one side and a network cable on the other. It uses the FT230X chip from FTDI and a standard serial to rs232 converter from ST. However after doing some tests it seems that when I run my

Is there an easy way of getting a list of files from a folder on an attached phone/camera/usb device?

随声附和 提交于 2019-12-25 17:07:48
问题 I can use OpenFileDialog to get a list of multiple files from local or mapped drives, however I am prevented from doing the same when I browse for example a usb-attached phone - although I can see the files and folders, when I attempt to multi-select, I get an error similar to this. Is there a dialog I can use to get a list of files? I have looked into Ookii.Dialogs, among others, and the only code that comes close is the CommonOpenFileDialog example in the 2nd answer here, but the folder

Unity Android created CSV file visible on device, not on PC via USB

淺唱寂寞╮ 提交于 2019-12-25 13:00:11
问题 I have a unity application that does a simple file creation and save on a CSV file. public void WriteDataToCsv() { StreamWriter outStream = File.CreateText (Application.persistentDataPath + "/" + path); // GameObject.Find ("DebugText").GetComponent<Text> ().text = "Saved file to: " + Application.persistentDataPath + "/" + path; outStream.WriteLine (sb); outStream.Close (); } Using any file explorer app off the Play store (both File Manager and X-Plore) I am able to see the file, and even edit