USB Missile Launcher ==================== Xmas 2005. M&S sell a USB missile launcher. It comes with a poor Microsoft Windows application to control it. I was challenged to get it controllable via a mobile phone, so the first obvious step was to get the thing controllable from linux via libusb. This is my efforts so far. The device is controlled, unusually, via USB HID class interface SET_REPORT commands (cf USB HID spec page 52) These can be sent via lib usb as control messages with usb_control_msg(). Seems to send two initiator packets starting with "USBC" to device endpoint 1, then a bronto 64 byte packet to endpoint 0, which is the actual variable command to move the missile launcher. The first byte is 0, then come 5 bytes which are either 1 or 0 to move the launcher in a given direction, then two 8 bytes, and then 48 0 padding bytes: 0 left right up down fire 8 8 0 0 0 0 0 0.... The Windows app only ever set one of the direction bytes at once, but you can actually set more than one and it works fine -- so you can go up/left at the same time for example! It seems picky about timeouts... gotta have a small usleep() between sending commands it seems. And if you just send a movement command, and don't send a "stop" command (all directions as 0's) then it keeps moving for a few seconds before finally giving up. (Doesn't just run to the full extent of its travel either, oddly) Code ---- Hacked from various sources, this just grabs the device, and moves it around a little to show it's working. I hope someone's going to come along and make a nice commandline/X11 app out of this before long :-) If you do use it, do as you like, but please leave the credits in the code and drop me an email. References ---------- USB HID spec: http://www.usb.org/developers/devclass_docs/HID1_11.pdf LIB USB docs: http://libusb.sourceforge.net/doc/ Contact ------- Ian Jeffray - ian@jeffray.co.uk Release info ------------ 27/12/05 : 0.01 : First release version