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
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).
<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.
You can find documentation for this module with the perldoc command.
You can also look for information at:
Copyright 2011 Brandon Fosdick.
This program is released under the terms of the BSD License.