Subject: Missile launchers vs uhid
To: None <tech-kern@netbsd.org>
From: Stephen Borrill <netbsd@precedence.co.uk>
List: tech-kern
Date: 02/28/2007 14:59:25
I've got a USB missile launcher:
uhidev0 at uhub0 port 4 configuration 1 interface 0
uhidev0: vendor 0x1130 Tenx Nonstandard Devic, rev 1.10/1.00, addr 2, iclass 3/0
uhid0 at uhidev0: input=0, output=64, feature=8
uhidev1 at uhub0 port 4 configuration 1 interface 1
uhidev1: vendor 0x1130 Tenx Nonstandard Devic, rev 1.10/1.00, addr 2, iclass 3/0
uhid1 at uhidev1: input=0, output=8, feature=0

phone 1# usbhidctl -f uhid0 -a
No_Event=1 [0]
No_Event=1 [1]
No_Event=1 [2]
No_Event=1 [3]
No_Event=1 [4]
No_Event=1 [5]
No_Event=1 [6]
No_Event=1 [7]
usbhidctl: USB_GET_REPORT(output) [probably not supported by device]: Input/output error
phone 2# usbhidctl -f uhid0 -a
Report descriptor:
Feature size=8 count=8 Array page=Keyboard usage=No_Event..0x00ff, logical 
range 0..255
Output  size=8 count=64 Array page=Keyboard usage=No_Event..0x00ff, 
logical range 0..255
Collection page=Generic_Desktop usage=Undefined
Total   input size 0 bytes
Total  output size 64 bytes
Total feature size 8 bytes

I thought I'd write a missile control library, so I looked for a python 
driver:
http://scott.weston.id.au/software/pymissile/missile.py
and a Linux driver:
http://ian.jeffray.co.uk/linux/missile-control-linux.tgz

They both claim the device directly and try to detach the kernel uhid 
driver before writing a very simple usb control message. This seems a lot 
simpler than messing around with libusbhid, but I can't see how to achieve 
it on NetBSD.

I've open()ed /dev/uhid0 and checked the Vendor and Product match, but if 
I try to write() I get Invalid argument.

-- 
Stephen