Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^4: basic serial and USB access

by apotheon (Deacon)
on Feb 03, 2008 at 20:39 UTC ( #665861=note: print w/replies, xml ) Need Help??

in reply to Re^3: basic serial and USB access
in thread basic serial and USB access

Is there no way to access data from such a device, in Perl, without a device driver?

print substr("Just another Perl hacker", 0, -2);
- apotheon
CopyWrite Chad Perrin

Replies are listed 'Best First'.
Re^5: basic serial and USB access
by GrandFather (Sage) on Feb 03, 2008 at 21:30 UTC

    I don't know how it works for other operating systems, but with Windows (at least in the past) the device gets matched by P&P using its PID and VID to a kernel mode driver that knows how to talk to the device. The main job of the driver is to handle P&P and other aspects of the USB bus that are incidental to the higher level conceptual operation of the device. You really really don't want to deal with a USB device at the level that drivers do. Most device manufacturers wouldn't make the information available to allow you to do that in any case.

    If what you will be dealing with is simply serial devices over a RS-232 to USB adapter, then your Perl code wouldn't know the difference in any case. If you are trying to develop some sort of generic test system, then you will need to write some sort of plug in code technology to handle different devices types over different interfaces.

    Perl is environmentally friendly - it saves trees

      Thanks for all that information.

      I'm looking at writing code for sensor testing now -- and the same code may be used again, with modifications, for another project a little further along. I unfortunately don't know a lot of details about what's actually going to be used in each case, but I'm trying to familiarize myself with the most likely technologies (based on what I know so far), maybe write some code as I wait for more information to arrive, before I actually have to do the work.

      Anyway . . . you've given me some things to think about. I appreciate the help.

      print substr("Just another Perl hacker", 0, -2);
      - apotheon
      CopyWrite Chad Perrin

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://665861]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2019-11-23 02:33 GMT
Find Nodes?
    Voting Booth?
    Strict and warnings: which comes first?

    Results (113 votes). Check out past polls.