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

Download:
USB-Descriptor-4.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 2   Source  

NAME ^

USB::Descriptor::Endpoint - USB Endpoint Descriptor

SYNOPSIS ^

An object representation of a USB endpoint descriptor.

    use USB::Descriptor::Endpoint;

    my $endpoint = USB::Descriptor::Endpoint->new( address => 1 );
    $endpoint->type('interrupt');
    $endpoint->direction('in');
    ...

DESCRIPTION ^

USB::Descriptor::Endpoint 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 ^

$endpoint = USB::Descriptor::Endpoint->new(interval=>$interval, ...);

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

When constructing endpoint objects, the endpoint direction and endpoint number can be specified with a single key/value pair. For example, you can use new('in' => 3) instead of new('direction' => 'in', 'number' => 3).

Arrayification ^

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

Returns an array of bytes containing all of the fields in the endpoint descriptor.

ATTRIBUTES ^

$interface->address

Direct access to the bEndpointAddress value. Don't use this unless you know what you're doing.

$interface->attributes

Direct access to the bmAttributes value. Don't use this unless you know what you're doing.

$interface->direction

Get/Set the endpoint's direction (bEndpointAddress). Pass 'in' for an IN endpoint or 'out' for an OUT endpoint.

$interface->interval

Get/Set the endpoint's polling interval in frame counts (bInterval). Forced to 1 for isochronous endpoints as required by the USB specification.

$interface->max_packet_size

Get/Set the endpoint's maximum packet size (wMaxPacketSize).

$interface->number

Get/Set the endpoint number (bEndpointAddress).

$interface->synchronization_type

Get/Set the endpoint's synchronization type (bmAttributes). Only used by isochronous endpoints.

$interface->type

Get/Set the endpoint's type (bmAttributes). Valid values are 'control', 'isochronous', 'bulk', and 'interrupt'.

$interface->usage_type

Get/Set the endpoint's usage type (bmAttributes). Only used by isochronous endpoints.

AUTHOR ^

Brandon Fosdick, <bfoz at bfoz.net>

BUGS ^

Please report any bugs or feature requests to bug-usb-descriptor-endpoint at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=USB-Descriptor-Endpoint. 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::Endpoint

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: