Skip Menu |

This queue is for tickets about the Device-USB CPAN distribution.

Report information
The Basics
Id: 92539
Status: new
Priority: 0/
Queue: Device-USB

People
Owner: Nobody in particular
Requestors: alberto.panu [...] mondadoriportfolio.it
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Issue on the DevInterface example
Date: Tue, 28 Jan 2014 17:49:31 +0100
To: bug-device-usb [...] rt.cpan.org
From: Alberto Panu <alberto.panu [...] mondadoriportfolio.it>
Hello,
i found an issue on the DevInterface example, in red the solution.
The  
$cfg->interfaces()

return alist of lists...

Thanks

Alberto

use Device::USB;

    my $usb = Device::USB->new();
    my $dev = $usb->find_device( $VENDOR, $PRODUCT );

    printf "Device: %04X:%04X\n", $dev->idVendor(), $dev->idProduct();
    $dev->open();

    my $cfg = $dev->config()->[0];
    my $inter = $cfg->interfaces()->[0]->[0];
    print "Interface:", $inter->bInterfaceNumber(),
       " name: ", $dev->get_string_simple($iter->iInterface()), 
       ": endpoint count: ", $inter->nNumEndpoints(), "\n";