Subject: USB uhid remote control
To: None <netbsd-users@netbsd.org>
From: None <varheit@gmx.de>
List: netbsd-users
Date: 03/28/2006 23:26:27
Hello,

I want to use an infrared remote control to operate a headless box
running NetBSD 3.0. I figured "usbhidaction" would be the way to go. My
problem is I cannot figure out the proper way to set up the
configuration file. The only success I had was to set up a file
"usbhidconf" with the line
	Consumer:Consumer_Control 0 echo "success"
and then call
	usbhidaction -f 0 -c usbhidconf -v

This event is triggered regardless which button I press. Everything
else I tried did not trigger an event. Is there a way to get this
working?

Vic


When I plug in the receiver unit, it is detected:

uhidev0 at uhub0 port 1 configuration 1 interface 0
uhidev0: Formosa Industrial Computin Formosa RC102-809 USB Remot, rev 1.10/1.02, addr 2, iclass 3/1
uhid0 at uhidev0: input=4, output=0, feature=0


Getting some more information (this seems strange):

# usbhidctl -f 0 -r
Report descriptor:
Collection page=Consumer usage=Consumer_Control
Input   size=8 count=1 page=Consumer usage=Consumer_Control, logical range 0..255
Input   size=8 count=1 page=Consumer usage=Consumer_Control, logical range 0..255
Input   size=8 count=1 page=Consumer usage=Consumer_Control, logical range 0..255
Input   size=8 count=1 page=Consumer usage=Consumer_Control, logical range 0..255
End collection
Total   input size 4 bytes
Total  output size 0 bytes
Total feature size 0 bytes


Playing with the remote:

# usbhidctl -f 0 -l -a
(...pressing one key...)
Consumer_Control.Consumer_Control=0
Consumer_Control.Consumer_Control=247
Consumer_Control.Consumer_Control=0
Consumer_Control.Consumer_Control=255

(...pressing another key...)
Consumer_Control.Consumer_Control=0
Consumer_Control.Consumer_Control=247
Consumer_Control.Consumer_Control=1
Consumer_Control.Consumer_Control=254