简体   繁体   中英

Can I access USB HID device via a Chrome App?

I have a simple little dongle I want to debug by sending/receiving basic USB messages. It enumerates as an HID device (like an additional mouse), but am worried that I won't have access to it. I forgot the hardware and can't test with it for a couple days.

Is it a futile effort to continue building a chrome extension to test it?

Chrome App, USB documentation: https://developer.chrome.com/apps/app_usb Getting-started example: https://github.com/GoogleChrome/chrome-app-samples/tree/master/usb/knob

Google Chrome now proposes a USB HID API. Have a look at the API: https://developer.chrome.com/apps/hid

The API is still defined as experimental at the time of this message. But it is functional. I have just written a tutorial to explain how to use this API.

Have a look: http://www.appnearme.com/blog/2014/7/21/chrome-usb-hid-controlling-your-usb-device-javascr/

You can't build a Chrome Extension to use that API, only Apps are allowed access.

That said, the JS side of things will probably not be the hard part, the example you linked provides an ample starting point. But I can't quickly find a ready library to do so, so prepare for relatively low-level hardware stuff.

Edit: Seems like there will be an API for that: https://code.google.com/p/chromium/issues/detail?id=290428

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM