Date: Thu, 02 Dec 2004 06:59:03 +0800 From: "Fernando Durango" <fernando@bsdmail.org> To: freebsd-usb@freebsd.org Subject: Fw: trouble sending bytes to uhid (Griffin PowerMate on 5.3-STABLE/i386) Message-ID: <20041201225903.35FA323EF6B@ws5-4.us4.outblaze.com>
index | next in thread | raw e-mail
Hello all,
I originally posted this to hackers@ a while back. Mathew Kanner suggested
I try NetBSD as their USB framework seemed a bit more up to date. Then I
noticed the new usb@ list and figured I'd try my request here.
TIA,
-F
----- Original Message -----
From: "Fernando Durango" <fernando@bsdmail.org>
To: freebsd-hackers@freebsd.org
Subject: trouble sending bytes to uhid (Griffin PowerMate on 5.3-STABLE/i386)
Date: Wed, 17 Nov 2004 03:36:11 +0800
>
> Hello all,
>
> I have a Griffin PowerMate[1] that I would love to be able to manipulate
> via uhid on FreeBSD. Running a USB sniffer on a win32 box shows the device
> spews 6 bytes of data on dial movement and/or button pressing, and the pc
> sending one byte to the PowerMate occasionally, which seems to effect LED
> brightness on the Powermate. I am able to read and interpret the device
> output with perl(sysopen & sysread), but I am unable to send bytes back to
> the device (syswrite).
>
> The device shows up as follows:
> $ dmesg | grep uhid
> uhid0: Griffin Technology, Inc. Griffin PowerMate, rev 1.00/4.00,
> addr 2, iclass 3/0
> $ usbdevs -d -v
> addr 1: full speed, self powered, config 1, UHCI root hub(0x0000),
> Intel(0x0000), rev 1.00
> uhub1
> port 1 addr 2: low speed, power 100 mA, config 1, Griffin
> PowerMate(0x0410), Griffin Technology, Inc.(0x077d), rev 4.00
> uhid0
> $ usbhidctl -r -f /dev/uhid0
> Report descriptor:
> Collection page=Consumer usage=Consumer_Control
> Input size=1 count=1 page=Button usage=Button_1, logical range 0..1
> Input size=8 count=1 page=Generic_Desktop usage=Rx, logical range -127..127
> 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
> Output size=8 count=1 page=Consumer usage=Consumer_Control,
> logical range 0..255
> Feature size=8 count=1 page=Consumer usage=Consumer_Control,
> logical range 0..255
> Feature size=8 count=1 page=Consumer usage=Consumer_Control,
> logical range 0..255
> Feature size=8 count=1 page=Consumer usage=Consumer_Control,
> logical range 0..255
> Feature size=8 count=1 page=Consumer usage=Consumer_Control,
> logical range 0..255
> Feature size=8 count=1 page=Consumer usage=Consumer_Control,
> logical range 0..255
> Feature size=8 count=1 page=Consumer usage=Consumer_Control,
> logical range 0..255
> Feature size=8 count=1 page=Consumer usage=Consumer_Control,
> logical range 0..255
> Feature size=8 count=1 page=Consumer usage=Consumer_Control,
> logical range 0..255
> End collection
> Total input size 6 bytes
> Total output size 0 bytes
> Total feature size 0 bytes
>
> perl code for reading:
> sysopen(DATA, "/dev/uhid0", O_RDONLY | O_NODELAY | O_BINARY)
> or die "could not open $device!\n";
>
> while (1) {
> my $buf;
> if (sysread(DATA, $buf, 6)) {
> my @ascii = map { ord } split //, $buf;
> foreach ( @ascii ) {
> print "$_\t";
> }
> print "\n";
> }
> }
>
> perl code for writing:
> sysopen(DATA, "/dev/uhid0", O_RDWR)
> or die "could not open $device!\n";
>
> $val = 0xff;
> if (length($val) != syswrite(DATA, $val, length($val))) {
> die "This is Bad: $!\n";
> }
>
> close(DATA);
>
> When trying to write, I get the error "This is Bad: Bad file descriptor"
> Is it not possible to write to a uhid device?
>
> Thanks in advance!
>
> -F
>
> [1] http://www.griffintechnology.com/products/powermate/
>
--
_______________________________________________
Get your free email from http://mymail.bsdmail.com
Powered by Outblaze
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041201225903.35FA323EF6B>
