usb

How do I org.bluetooth.characteristic.report_map for more than one type of report?

六眼飞鱼酱① 提交于 2019-12-11 08:04:54
问题 Alright, I'm building a keyboard with an integrated touch-screen used as a mouse, I'm sending the data generated over BLE via HID OVER GATT. This works fine for org.bluetooth.characteristic.boot_keyboard_input_report & org.bluetooth.characteristic.boot_mouse_input_report, but I'm not very certain how to configure the report_map and what I need to send according to these declarations. The Main question is really, because there is no hybrid type of Usage, I need to use two Usage. But do I need

How can I use RegisterDeviceNotification without a window handle?

不羁的心 提交于 2019-12-11 07:36:35
问题 I'm writing a DLL library that interfaces to a USB device using winusb in VB.NET. Since it's a DLL, I have no window, and it's possible that users of my library will also not have a window (command line apps, for instance). The examples I've seen that detect device attach and detach all use RegisterDeviceNotification which requires a window handle to receive the attach/detach messages at. How do I receive these messages directly into a function without a window to get a handle from? 回答1: I

How to monitor usb devices insertion?

浪子不回头ぞ 提交于 2019-12-11 07:30:03
问题 I am trying to monitor for USB devices when they get plugged in. A couple of test scripts fail that I am pretty sure should of worked. import pyudev context = pyudev.Context() monitor = pyudev.Monitor.from_netlink(context) monitor.filter_by(subsystem='usb') for device in iter(monitor.poll, None): if device.action == 'add': print('{} connected'.format(device)) ^^Does nothing. No error, no output. I try import dbus bus = dbus.SystemBus() obj = bus.get_object('org.freedesktop.NetworkManager', '

How can I get the id (or some unique properties) of the USB devices connected to my Android device, programmatically?

自作多情 提交于 2019-12-11 06:46:48
问题 How can I get the id (or some unique properties) of the USB devices connected to my Android device? 回答1: For anyone new to UsbDevice , it may be worth noting the use of UsbManager UsbManager usbManager = (UsbManager) getSystemService(Context.USB_SERVICE); HashMap<String, UsbDevice> usbDevices = usbManager.getDeviceList(); Read more at http://developer.android.com/reference/android/hardware/usb/UsbManager.html 回答2: You can get the unique ID of an android connected USB device using UsbDevice

Is Accessing USB from web application for cross browser cross os possible at all?

浪子不回头ぞ 提交于 2019-12-11 06:36:50
问题 I am wondering if there is anyway we can achieve this. I heard different things about Silverlight 4 , Java Script or Active X control but not seen any demo of code for any of them. Does anyone know any web component that is available or how to write one. We really like capture client's USB drive via Web and read/write data on it. This has to work for ANY Operating system in Any web browser. Thanks UPDATED What about WPF in browser mode...I read that I can host my wpf apps inside browser and

how to detect first plug usb flash memory on Vb.net

孤街醉人 提交于 2019-12-11 06:36:31
问题 I'm trying to make a screen locker software, that unlocks only when the correct flash drive plugged in and locks when it's unplugged. So that I have searched and found some codes that detects flash drive. It works properly when there is only one flash drive but if there are more than one flash drive and I unplugged the one without pass, my software still locks the screen. Can anyone help with it? here is my codes Imports System.Runtime.InteropServices Imports System.IO Public Class Form1

how to create mjpeg

混江龙づ霸主 提交于 2019-12-11 06:26:53
问题 I can't understand how to create a .mjpeg file. As far as I understand it is simply a series of jpeg files. I searched online for a way to combine them into a single file, but didn't find any information. Some people said that one just needs to create a miniserver that would show one image after another. I'm trying to use the following application, git://git.ideasonboard.org/uvc-gadget.git, to test UVC, and one of the options that it has is a path to the mjpeg file. I'm not very clear if it

read file from usb removable storage

痞子三分冷 提交于 2019-12-11 05:58:07
问题 in my application I want to read a file from usb removable storage I have a.txt and i want to read it void read() { UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE); HashMap<String, UsbDevice> deviceList = manager.getDeviceList(); Iterator<UsbDevice> deviceIterator = deviceList.values().iterator(); StringBuffer sb = new StringBuffer(); while (deviceIterator.hasNext()) { UsbDevice device = deviceIterator.next(); String Model = device.getDeviceName(); try { File file =

How to get files from a device using USB

心已入冬 提交于 2019-12-11 05:53:47
问题 Im writing a WPF application that wants to get access to a digital camera, and have been madly Googling around for solutions and Im pretty happy with how its all going. This is what I have at the moment: private const decimal WM_DEVICECHANGE = 0x0219; private const int DBT_DEVTYP_HANDLE = 6; private const int DBT_DEVNODES_CHANGED = 7; private const int BROADCAST_QUERY_DENY = 0x424D5144; private const int DBT_DEVICEARRIVAL = 0x8000; // system detected a new device private const int DBT

Why does DeviceIoControl fail with “Incorrect Function”

心已入冬 提交于 2019-12-11 05:39:43
问题 I am trying to communicate with my USB driver. I am able to get a handle, but once I use DeviceIoControl it fails, GetLastError() says error is an incorrect function. I am stumped on how to debug this. I am using XP 32bit machine. Handle = CREATEFILE( DevicePath1, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); if (INVALID_HANDLE_VALUE == Handle) { printf("INVALIDHANDLE USB\n"); return PHNFCSTVAL(CID_NFC_DAL, NFCSTATUS_INVALID_DEVICE); } else {