Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??


I'm install Device::USB from apt-get on my Ubuntu machine. I have usb device. With wireshark i get protocol from anower software. The protocol used to communicate bulktransfer

but when i try implement it with Device::USB i have no luck

#!/usr/bin/perl -w use strict; use Device::USB; my $usb = Device::USB->new(); my $dev = $usb->find_device( 0x2642,0x0669); printf "Device: %04X:%04X\n", $dev->idVendor(), $dev->idProduct(); $dev->open (); $dev->claim_interface(); $dev->set_configuration (0); my $cmd = $dev->{config}->[0]->{interfaces}->[0]->[0]->{endpoints}->[0 +]->{bEndpointAddress}; my $string = $dev->{config}->[0]->{interfaces}->[0]->[0]->{endpoints}- +>[1]->{bEndpointAddress}; my $data = $dev->{config}->[0]->{interfaces}->[0]->[0]->{endpoints}->[ +3]->{bEndpointAddress}; my $send = $dev->bulk_write($cmd,hex('dd'),1000); my $data; my $read = $dev->bulk_read($string,$data,64,1000); $read = $dev->bulk_read($string,$data,64,1000);

I can't see any output in wireshark. And i have $send =-1 and read='-1'

What i'm missing ?

PS sorry for English

In reply to Device::USB ubuntu 13.10 and bulk read write problem by AlexSH

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2021-06-12 18:18 GMT
Find Nodes?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)

    Results (53 votes). Check out past polls.