in reply to Re^4: USB module
in thread USB module

You can't. USB does not work like that. Neither the device, nor the device driver know how many hubs there are in the chain, nor what the path is through the hubs, nor do they care. Perhaps you need to state the actual problem you are trying to solve, rather than spend a lot of time trying to solve the wrong problem.


Perl is Huffman encoded by design.

Replies are listed 'Best First'.
Re^6: USB module
by boblikeperl (Novice) on Sep 27, 2005 at 18:51 UTC
    I don't know how to put it more simply. I want to use PERL to communicate with USB devices connected to the USB ports on my WinXP machine. How is this done !!! The devices do not have drivers I can load on my PC since they are "home grown" - not common USB devices, but, they conform to the USB 1.1 specification.

      I'm not sure how I can put it more simply appart from saying that I have written USB drivers for two "home grown" USB devices and have written the device side code for one of those devices and for a third USB device. I know what I speak of!

      Unless your devices are battery chargers or christmas tree lights running off USB power, there absolutely must be drivers for them. They may be standard operating system supplied drivers if they identify themselves as standard devices (HID for example).

      Simply saying "Tell me how to communicate with a USB device" is like saying "Tell me how to communicate with a person". Sounds fine, but: are you going to talk, use Morse code, exchange letters, use email...? What language are you going to use? Do you need to send a message once, or is this going to be a frequent thing? There is simply no way to answer the question when it is put in that form except by asking a bunch of detailed questions.

      This has moved beyond being of general interest. If you /msg me your email address I will help as I can.


      Perl is Huffman encoded by design.
        OK. This has gotten away from my original question. I am not asking how USB works or needing to develop drivers that deal with protocols and hardware devices. I wanted to know if there is a PERL module for USB that is similar to the Net::TelNet module that deals with ethernet communications. Maybe you can answer this one: I want to copy a file from a USB device on USB #1 to a device on USB #2 on my WinXP PC using Perl. How is this done? Assume the devices are HID.