(dropping inline comments since its getting to cluttered) This is my experiments so far:
When plugging in the device i get the following in the console log: uhidev0 at uhub5 port 1 configuration 1 interface 0 "HOLTEK USB Keyboard" rev 1.10/2.00 addr 2 uhidev0: iclass 3/1 ukbd0 at uhidev0: 8 modifier keys, 6 key codes wskbd1 at ukbd0 mux 1 wskbd1: connecting to wsdisplay0 When testing the device with a RFID brick i get output like: 010879d647 Including a newline (this is of course the text i would like to read into my program). When i then do a 'sudo cat /dev/wskbd1' i get the message: wskbd1: disconnecting from wsdisplay0 Which i guess is good since i no longer get any output on the active console, but also a little bad since i don't get any output from the cat command. I have been poking around in the wskbd/wsdisplay man pages and from what i read this looks like being the wrong way to do it (since the program i plan to write will be a daemon not attached to any displays). Then i have tried to force the device out of uhid (patch attached for reference) and then i get the following when i do a 'sudo cat /dev/ugen1.01': ''%$&#!$( Which i hope i will be able to decode into something usable (will return with the result). Of course if anyone has an easier way to do this stuff I'm all ears. Best regards Jens On 10-04-2010 14:29, Stuart Henderson wrote: > On 2010/04/10 12:43, Jens Teglhus Mxller wrote: > >> On 09-04-2010 15:06, Stuart Henderson wrote: >> >>> On 2010-04-09, Jens Teglhus M?ller<j...@mostlyharmless.dk> wrote: >>> >>>> Is it possible for a process to consume all output for a (this) particular >>>> keyboard >>>> >>> I don't know about that.. >>> >> What i was fishing for was if it is possible in a simple way (like >> having a process read from /dev/ukbd* or something similar) that >> would consume the data and not have it output on the terminal. >> > It might be possible, but that's the thing I don't know about. > >>>> or do i have to force it into ugen (is that even possible) and >>>> >>> you already know how to force it into ugen, same thing you did >>> for the Velleman kit :) >>> >> Yeah at the time of writing i was just a little unsure if ubkd was a >> uhid device and therefore could be forced into ugen with a quirk, but >> when i look at the man page i can see that ukbd attaches at uhiddev. >> >> >>> I'm not sure if that would make sense to commit this one though, >>> as presumably some people will want the device to present keyboard input.. >>> >> No, i can see that perhaps i will need to keep a local diff to do that >> >> >>>> try to read the output myself? >>>> >>> I would look around and see if someone already has code for this >>> using libusb (which is fairly portable)... >>> >> But wouldn't i still need some way of telling the kernel not to >> attach the device? Like a quirk or disabling it via ukc like chriss >> bennet suggested (and config -e for a more permanent solution). Or >> > Yes you would, that would be a way to access it once it's attached to ugen. > You can use config -e and disable uhid as long as you don't need it for your > main keyboard. > > >> can libusb tell the kernel to no longer handle the device? >> > Unfortunately not. It would be useful (we could remove all these messy > BAD_HID quirks...) but not possible at the moment. Some other OS allow > libusb to talk to a device even though it's claimed by a driver, > however that isn't really entirely safe. > > >>>> I don't have the dmesg/attach info at hand, but will post it later if >>>> required. >>>> >>>> Best regards Jens Index: sys/dev/usb/usbdevs =================================================================== RCS file: /cvs/src/sys/dev/usb/usbdevs,v retrieving revision 1.487 diff -u -p -u -r1.487 usbdevs --- sys/dev/usb/usbdevs 7 Apr 2010 20:56:41 -0000 1.487 +++ sys/dev/usb/usbdevs 12 Apr 2010 11:42:09 -0000 @@ -3541,6 +3541,7 @@ product TRUMPION XXX1100 0x1100 XXX 1100 /* Tsunami products */ product TSUNAMI SM2000 0x1111 SM-2000 +product TSUNAMI RFID 0xe000 RFID USB Reader /* TwinMOS products */ product TWINMOS G240 0xa006 G240 Index: sys/dev/usb/usb_quirks.c =================================================================== RCS file: /cvs/src/sys/dev/usb/usb_quirks.c,v retrieving revision 1.56 diff -u -p -u -r1.56 usb_quirks.c --- sys/dev/usb/usb_quirks.c 7 Apr 2010 21:18:42 -0000 1.56 +++ sys/dev/usb/usb_quirks.c 12 Apr 2010 11:42:09 -0000 @@ -141,6 +141,7 @@ const struct usbd_quirk_entry { { USB_VENDOR_TENX, USB_PRODUCT_TENX_MISSILE, ANY, { UQ_BAD_HID }}, { USB_VENDOR_TERRATEC, USB_PRODUCT_TERRATEC_AUREON, ANY, { UQ_BAD_HID }}, { USB_VENDOR_VELLEMAN, USB_PRODUCT_VELLEMAN_K8055, ANY, { UQ_BAD_HID }}, + { USB_VENDOR_TSUNAMI, USB_PRODUCT_TSUNAMI_RFID, ANY, { UQ_BAD_HID }}, { USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E220, ANY, { UQ_NO_STRINGS }}, { USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_DM9601, ANY, { UQ_NO_STRINGS }},