This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Beginner question on what constitutes a device USB interface

Been reading through the USB document and going through the codes but still having a bit of trouble grasping the concept of an interface.
What would constitute an "interface"? Does it encapsulate a class with the associated class methods?
Where in the code does it bind the "interface" to the class?
When the host request for an "interface", what would it get in return or what would be the purpose of asking for an interface?
For example, if a device declares that it has three interface, how does it associates each interface to the actual firmware codes?
Thanks.

Parents
  • I believe that you get USB stuff and Object-oriented programming stuff mixed up.

    www.usbmadesimple.co.uk/ums_4.htm

    A device can have one or more interfaces. Each interface can have a number of endpoints and represents a functional unit belonging to a particular class.

    Each endpoint is a source or sink of data.

    For example a VOIP phone might have one audio class interface with 2 endpoints for transferring audio in each direction, plus a HID interface with a single IN interrupt endpoint, for a built in keypad.

    en.wikipedia.org/.../USB

    Audio = Speaker, microphone, sound card, MIDI
    Communications and CDC Control = Modem, Ethernet adapter, Wi-Fi adapter, RS232 serial adapter.
    Human interface device (HID) = Keyboard, mouse, joystick
    Physical Interface Device (PID) = Force feedback joystick
    Image (PTP/MTP) = Webcam, scanner
    Printer = Laser printer, inkjet printer, CNC machine
    Mass storage (MSC or UMS) = USB flash drive, memory card reader, digital audio player

Reply
  • I believe that you get USB stuff and Object-oriented programming stuff mixed up.

    www.usbmadesimple.co.uk/ums_4.htm

    A device can have one or more interfaces. Each interface can have a number of endpoints and represents a functional unit belonging to a particular class.

    Each endpoint is a source or sink of data.

    For example a VOIP phone might have one audio class interface with 2 endpoints for transferring audio in each direction, plus a HID interface with a single IN interrupt endpoint, for a built in keypad.

    en.wikipedia.org/.../USB

    Audio = Speaker, microphone, sound card, MIDI
    Communications and CDC Control = Modem, Ethernet adapter, Wi-Fi adapter, RS232 serial adapter.
    Human interface device (HID) = Keyboard, mouse, joystick
    Physical Interface Device (PID) = Force feedback joystick
    Image (PTP/MTP) = Webcam, scanner
    Printer = Laser printer, inkjet printer, CNC machine
    Mass storage (MSC or UMS) = USB flash drive, memory card reader, digital audio player

Children
No data