Brandon Fosdick > USB-Descriptor-4 > USB::Descriptor::Interface

Download:
USB-Descriptor-4.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 2   Source  

NAME ^

USB::Descriptor::Interface - USB Interface Descriptor

SYNOPSIS ^

An object representation of a USB interface descriptor.

    use USB::Descriptor::Interface;

    my $interface = USB::Descriptor::Interface->new( description => 'My First Interface' );
    $interface->class(0);
    $interface->subclass(0);
    $interface->endpoints( [ USB::Descriptor::Endpoint->new() ] );
    ...

DESCRIPTION ^

USB::Descriptor::Interface represents a USB interface descriptor. When added to the descriptor tree of a USB::Descriptor::Device object it can be used to generate the data structures needed to compile the firmware for a USB device.

CONSTRUCTOR ^

$interface = USB::Descriptor::Interface->new(description=>$description, ...);

Constructs and returns a new USB::Descriptor::Interface object using the passed options. Each option key is the name of an accessor method.

ARRAYIFICATION ^

$interface->bytes (or @{$interface} )

Returns an array of bytes containing all of the fields in the interface descriptor as well as all of the child endpoint descriptors.

ATTRIBUTES ^

$interface->alternate

Get/Set the alternate setting value (bAlternateSetting).

$interface->class

Get/Set the interface class (bInterfaceClass).

$interface->class_descriptor

Get/Set the interface class descriptor object reference.

$interface->description

Get/Set the interface's description string. A string descriptor index (iInterface) will be automatically assigned when arrayified by USB::Descriptor::Configuration.

$interface->endpoint

A convenience method that wraps a single hash reference in an array and passes it to endpoints().

$interface->endpoints

Get/Set the array of USB::Descriptor::Endpoint objects. All of the endpoints in the passed array will be arrayified when the interface object is arrayified by USB::Descriptor::Configuration.

$interface->number

Get/Set the interface's number (bInterfaceNumber).

$interface->protocol

Get/Set the interface's protocol (bInterfaceProtocol).

$interface->subclass

Get/Set the interface's SubClass (bInterfaceSubClass).

AUTHOR ^

Brandon Fosdick, <bfoz at bfoz.net>

BUGS ^

Please report any bugs or feature requests to bug-usb-descriptor-interface at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=USB-Descriptor-Interface. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc USB::Descriptor::Interface

You can also look for information at:

ACKNOWLEDGEMENTS ^

LICENSE AND COPYRIGHT ^

Copyright 2011 Brandon Fosdick.

This program is released under the terms of the BSD License.

syntax highlighting: