USB::Descriptor::Configuration - USB Interface Descriptor
An object representation of a USB configuration descriptor.
use USB::Descriptor::Configuration; my $configuration = USB::Descriptor::Configuration->new( description => 'My First Configuration' ); $configuration->max_current(100); # Max current in mA $configuration->self_powered(1); # Self-powered device $configuration->interfaces( [ USB::Descriptor::Interface->new() ] ); ...
USB::Descriptor::Configuration represents a USB configuration 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.
Constructs and returns a new USB::Descriptor::Configuration object using the passed options. Each option key is the name of an accessor method.
Returns an array of bytes containing all of the fields in the configuration descriptor fields as well as all of the child interface descriptors.
Direct access to the bmAttributes value. Don't use this unless you know what you're doing.
Get/Set the configuration's description string. A string descriptor index (iConfiguration) will be automatically assigned when arrayified by USB::Descriptor::Configuration.
A convenience method that wraps a single hash reference in an array and passes it to interfaces().
interfaces()
Get/Set the array of USB::Descriptor::Interface objects. All of the interfaces in the passed array will be arrayified when the configuration object is arrayified by USB::Descriptor::Device.
Get/Set the configuration's max current draw in milliamps (bMaxPower). Defaults to 0.
Get/Set the configuration's remote wakeup attribute (bmAttributes).
Get/Set the configuration's self-powered attribute (bmAttributes).
Get/Set the configuration's configuration value (bConfigurationValue).
If no value is specified, and the configuration has been added to a USB::Descriptor::Device, a value will be automatically assigned by USB::Descriptor::Device->bytes().
Brandon Fosdick, <bfoz at bfoz.net>
<bfoz at bfoz.net>
Please report any bugs or feature requests to bug-usb-descriptor-configuration at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=USB-Descriptor-Configuration. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-usb-descriptor-configuration at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc USB::Descriptor::Configuration
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=USB-Descriptor-Configuration
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/USB-Descriptor-Configuration
CPAN Ratings
http://cpanratings.perl.org/d/USB-Descriptor-Configuration
Search CPAN
http://search.cpan.org/dist/USB-Descriptor-Configuration/
Copyright 2011 Brandon Fosdick.
This program is released under the terms of the BSD License.
To install USB::Descriptor, copy and paste the appropriate command in to your terminal.
cpanm
cpanm USB::Descriptor
CPAN shell
perl -MCPAN -e shell install USB::Descriptor
For more information on module installation, please visit the detailed CPAN module installation guide.