Subject: usbhidctl doesn't allow writing array values?
To: None <current-users@netbsd.org>
From: Werner Backes <werner@bit-1.de>
List: current-users
Date: 02/16/2004 21:44:34
Hi,

I just connected a generic USB I/O chip to my computer. The chip
is an IO-Warrior24 and seems to be a pretty neat device to do
digital I/O (and more) via USB. It is recognized as HID device
so I hoped I could access it via usbhidaction/usbcidctl without
further programming. This in fact is true for the input side,
where the 16 input pins can be addressed as

   Generic_Desktop:Undefined.Button:Button_1
   ...
   Generic_Desktop:Undefined.Button:Button_16

But for the output side, I get an Array of 16 values:

Generic_Desktop:Undefined.LEDs:Generic_Indicator=1 [0]
Generic_Desktop:Undefined.LEDs:Generic_Indicator=1 [1]
Generic_Desktop:Undefined.LEDs:Generic_Indicator=1 [2]
Generic_Desktop:Undefined.LEDs:Generic_Indicator=1 [3]
Generic_Desktop:Undefined.LEDs:Generic_Indicator=1 [4]
Generic_Desktop:Undefined.LEDs:Generic_Indicator=1 [5]
Generic_Desktop:Undefined.LEDs:Generic_Indicator=1 [6]
Generic_Desktop:Undefined.LEDs:Generic_Indicator=1 [7]
Generic_Desktop:Undefined.LEDs:Generic_Indicator=1 [8]
Generic_Desktop:Undefined.LEDs:Generic_Indicator=1 [9]
Generic_Desktop:Undefined.LEDs:Generic_Indicator=1 [10]
Generic_Desktop:Undefined.LEDs:Generic_Indicator=1 [11]
Generic_Desktop:Undefined.LEDs:Generic_Indicator=1 [12]
Generic_Desktop:Undefined.LEDs:Generic_Indicator=1 [13]
Generic_Desktop:Undefined.LEDs:Generic_Indicator=1 [14]
Generic_Desktop:Undefined.LEDs:Generic_Indicator=1 [15]

My problem is to access the individual array elements. I
can only write to the first element by doing:

usbhidctl -f /dev/uhid0 -w \
Generic_Desktop:Undefined.LEDs:Generic_Indicator=1

but how to access the other 15 bits? Is this possible
with usbhidctl or do I have to do my own programming?

   Werner