To explain what is happening below, the key facts are as follows. In
the report descriptor, there are 2 usages defined. The descriptor
also indicates that the report size is 8 bits long and that the
report count is 26 bytes. In theory, since the report size is 8 bits
(1 byte) and the report count is 26, then there could have been up to
26 usages defined, where each usage is associated with sequential
bytes.
In this case, since there are only 2 usages, the first byte (8 bits -
the report size) is associated with the first usage. There is only
one more usage left, so the remaining bits, are associated with this
second usage.
See HID Spec page 40
While Local items do not carry over to the next Main item, they may
apply to more than one control within a single item. For example, if
an Input item defining five controls is preceded by three Usage
tags, the three usages would be assigned sequentially to the first
three controls, and the third usage would also be assigned to the
fourth and fifth controls. If an item has no controls (Report Count
= 0), the Local item tags apply to the Main item (usually a
collection item).
Anyway, since the second usage gets assigned the 200 bits, and the
report size is only 8 bits, then 25 additional chunk elements are
defined by the HID Manager. You can examine the second elements as a
long value of size 25, or you can examine elements 3 - 27 as bytes.
I have no doubt that this is confusing, as it was when I first
leanred about it. I will create a tech Q&A to explain this situation.
hope this helps.
rich
At 9:19 AM -0700 10/28/04, Geoff Smith wrote:
Hi All,
I am trying to write code to allow hid devices to be accessed from
Macromedia Director from OSX, the pc version is already working
successfully, but have hit a problem in OSX. I am new to the Mac OSX
USB world.
I have a device with the following hid descriptor (from a usb analyzer).
06 A0 ff Usage page
09 a5 Usage
a1 01 Collection
09 a6 Useage - vendor defined
09 a7 usage - vendor defined
15 00 log min 0
25 ff log max 255
75 08 Report size 8 bits
95 1a Report count 26 bytes
81 02 input data,variable, absolute
c0 end collection
The correct data is being sent in from the device to the host.
The issue:
Both in my program and in the HID explorer 27 elements are defined,
The details of the first are:
============================================
Name:#{V:4, P:24003, U:65440:166}#
============================================
Type:kIOHIDElementTypeInput_Misc
Usage Vendor Defined Usage 0xa6
usagePage 65440, usage 166, cookie 2,
min -1, max 0, scaledMin -1, scaledMax size in bits 8, relative:No,
wrapping:No, non-linear:No, prefState:Yes, nullState:No units 0,
unitExp 0
The second is:
============================================
Name:#{V:4, P:24003, U:65440:167}#
============================================
Type:kIOHIDElementTypeInput_Misc
Usage Vendor Defined Usage 0xa7
usagePage 65440, usage 167, cookie 3,
min -1, max 0, scaledMin -1, scaledMax size in bits 200,
relative:No, wrapping:No, non-linear:No, prefState:Yes, nullState:No
units 0, unitExp 0
The next 25 are as below with the cookie incrementing
============================================
Name:#{V:4, P:24003, U:65440:167}#
============================================
Type:kIOHIDElementTypeInput_Misc
Usage Vendor Defined Usage 0xa7
usagePage 65440, usage 167, cookie 4,
min -1, max 0, scaledMin -1, scaledMax size in bits 8, relative:No,
wrapping:No, non-linear:No, prefState:Yes, nullState:No units 0,
unitExp 0
This is where my confusion starts. The second element is 200 bits, 25
bytes, surely either the first one should return all 26 bytes, or
each one should return 1. When I use the getElement value the first
byte does get returned, BUT the second one does return a longValue
with a size of 25; but the data is wrong.
Question(s):
How many elements should be returned? 1, 26 or some other value?
I am using HIDUtilites, but the get element value accessor does not
return the longValue if present, I can expand the HidUtilities, or is
there another way to access the data?
Why is the second one 200 bits?
What is the "corrrect" way to read the data?
Any pointers to docs, previous emails covering this, suggestions,
illuminating comments
--
Sincerely,
Rich Kubota
email@hidden
(408) 974-6212
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden