1 / 14

Ruby USB

Ruby USB. Michael Hewner rubyusb.technofetish.net rubyusb ‘at’ hewner.com. What’s Cool About USB?. Everywhere & well specified You can build your own (but not in ruby) Self-describing (especially HID devices). USB Human Interface Devices. For the complete HID spec details check out

Download Presentation

Ruby USB

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Ruby USB Michael Hewner rubyusb.technofetish.net rubyusb ‘at’ hewner.com

  2. What’s Cool About USB? • Everywhere & well specified • You can build your own (but not in ruby) • Self-describing (especially HID devices)

  3. USB Human Interface Devices For the complete HID spec details check out Device Class Definition for HID 1.11 http://www.usb.org/developers/devclass_docs/HID1_11.pdf

  4. The Goal: Annotated Data 10000000011111011 Distinct but logically grouped Annotated with the string “security stuff” Measures in °C Minimum Value -36 Implicitly *10^3 Left mouse button

  5. A Partial Mouse HID Descriptor 3 1 Bit “Button” Fields 1 5 Bit Empty Space

  6. Examples of RubyUSB

  7. How Does it Work? Part 1 of 3: libUSB C Structs & Raw USB Descriptions LibUSB Cross -Platform C USB Library • Provides basic C access to all key USB fuctionality • Supposedly cross-platform (OS X and BSD) but I’ve only tested on Linux • The version in the Debian package repository doesn’t work – you need to get the latest from CVS • You must disconnect devices from the kernel

  8. How Does it Work? Part 2 of 3: HIDParser Report Descriptor Objects HIDParser C++ OO Parser For HID Reports • Parses the HID into “Report Descriptor Objects” that describe a particular kind of communication • Vast majority of HID constructs are supported • Suite of unit tests • Needs more testing on interesting HID devices

  9. How Does it Work? Part 3 of 3: RubyUSB RubyUSB Handy Documented USB Library • Tries to implictly do the right thing • Produces annotated Objects • Needs more work for Output and some other stuff

  10. Simple Commands The Big Picture AVR USB USB Your Rock’n USB C Device LibUSB Cross- Platform C USB Library Your Rock’n App HIDParse C++ OO Parser For HID Reports RubyUSB Handy Documented USB Library Raw USB Descriptions Report Descriptor Objects Fancy Report Objects Raw USB Reports

  11. AVRUSB: So Very Cool So easy to build your own custom USB devices anybody can do it. As long as anybody has a soldering iron and an avr microcontroller programmer. http://www.obdev.at/products/avrusb/hidkeys.html

  12. Future Stuff • Improved packaging building and installation • Improved ruby objects • More testing with a variety of usb devices • Evdev for even easier but less cool fun

More Related