Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to talk to a composite/HID USB device



Hi

I have (I believe) a USB composite device with one interface
which is HID, see info from usb prober at the end of email.

I found on this list that
> making a device with a single interface a composite device
>is a very good idea, because it allows the
>AppleUSBComposite driver to configure it and handle things
>like hub resets gracefully.

and that all usb devices should be designed like this.

But when I run an HID program in Matlab/psychtoolbox, it
does not see my device, and when I run apple HID explorer,
it does not see it either, in both cases, it only sees the
mouse pad and keyboard.

I want to talk to this USB device.

I researched two possibilities without success:
1. HID explorer is a complete project which I can actually
compile. What function do I need to rewrite/correct it so
that the HID explorer sees my HID device.

2. Darwin has some kind of USBcomposite driver in a package
called IOUSBfamily ...  Where can I find a complete example
which I can compile which shows me how to use these
functions which I can copy from darwin

And just out of curiosity, if according to the following
>It also makes it comply with the spec.

>The defined class codes
><http://www.usb.org/developers/defined_class> specify most
>class codes for interfaces only. There are very few class
>codes which are defined for the device to use.

>I'm pretty sure that the HID spec specifically stats that a
>HID device should have device class == 0, and the HID is
>specified by the interfaces.

>On a practical note, using a single interface in a
>composite device means that there is no difference in the
>handling of single and multiple interface devices, which
>means its less likely to go wrong. Single interface
>composite devices probably make up 95% of the extant USB
>devices.

a composite device with a single HID interface is the proper
way to configure an HID device, why is HID explorer failing
to see my USB device?

NB: the application which uses the device runs
USBSimpleExample to connect to my device, according to the
console log.
USBSimpleExample: Starting
Found device 0x000091ab
dealWithDevice: found 1 configurations
found interface: 0x000092db
dealWithInterface: found 2 pipes
dealWithPipes: grabbing BULK IN pipe index 1, number 1
dealWithPipes: grabbing BULK OUT pipe index 2, number 2

Somehow it uses this generic driver to connect to the USB. I
should be able to do the same, but I don't know how. I have
a PC open source code accessing this device, and the ST7
microelectronics documentation.

---------------------------------------------------------------
USB Prober output.

    Device Descriptor
        Descriptor Version Number:   0x0110
        Device Class:   0   (Composite)
        Device Subclass:   0
        Device Protocol:   0
        Device MaxPacketSize:   8
        Device VendorID/ProductID:   0x0483/0x0035
(STMicroelectronics)
        Device Version Number:   0x0111
        Number of Configurations:   1
        Manufacturer String:   3 "STMicroelectronics"
        Product String:   1 "ST7 RS232 USB BIOFBK"
        Serial Number String:   0 (none)
    Configuration Descriptor
        Total Length of Descriptor:   41
        Number of Interfaces:   1
        Configuration Value:   1
        Attributes:   0x80 (bus-powered)
        MaxPower:   20 ma
        Interface #0 - HID
            Alternate Setting   0
            Number of Endpoints   2
            Interface Class:   3   (HID)
            Interface Subclass;   0
            Interface Protocol   0
            HID Descriptor
                Descriptor Version Number:   0x0110
                Country Code:   33
                Descriptor Count:   1
                Descriptor 1
                    Type:   0x22  (Report Descriptor)
                    Length (and contents):   29
                        Raw Descriptor (hex)    0000: 06 80
FF 09 00 A1 01 75  08 95 08 15 00 26 FF 00
                        Raw Descriptor (hex)    0010: 09 01
B1 82 09 01 81 82  09 02 91 82 C0
                    Parsed Report Descriptor:
                          Usage Page    (65408)
                          Usage 0 (0x0)
                              Collection (Application)
                                Report Size.............
(8)
                                Report Count............
(8)
                                Logical Minimum.........
(0)
                                Logical Maximum.........
(255)
                                Usage 1 (0x1)
                                Feature.................
(Data, Variable, Absolute, No Wrap, Linear, Preferred State,
No Null Position, Volatile, Bitfield)
                                Usage 1 (0x1)
                                Input...................
(Data, Variable, Absolute, No Wrap, Linear, Preferred State,
No Null Position, Bitfield)
                                Usage 2 (0x2)
                                Output..................
(Data, Variable, Absolute, No Wrap, Linear, Preferred State,
No Null Position, Volatile, Bitfield)
                              End Collection
            Endpoint 0x81 - Interrupt Input
                Attributes:   0x81  (IN)
                Attributes:   0x03  (Interrupt)
                Max Packet Size:   8
                Polling Interval:   10 ms
            Endpoint 0x02 - Interrupt Output
                Attributes:   0x02  (OUT)
                Attributes:   0x03  (Interrupt)
                Max Packet Size:   8
                Polling Interval:   10 ms



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.