File: dump-bos.pl

package info (click to toggle)
libusb-libusb-perl 0.09-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 396 kB
  • sloc: perl: 727; makefile: 3
file content (23 lines) | stat: -rwxr-xr-x 453 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env perl
use 5.020;
use warnings;
use strict;

use blib;
use USB::LibUSB;
use Getopt::Long qw/:config gnu_getopt/;
use Data::Dumper;
use YAML::XS;
my $vid;
my $pid;

GetOptions("vid|v=s", \$vid,
           "pid|p=s", \$pid)
    or die "getopt";

my $ctx = USB::LibUSB->init();
$ctx->set_debug(LIBUSB_LOG_LEVEL_DEBUG);
my $handle = $ctx->open_device_with_vid_pid(hex $vid, hex $pid);
my $bos = $handle->get_bos_descriptor();

print Dump $bos;