TGI has asked for the wisdom of the Perl Monks concerning the following question:

I am working on an application that will make heavy use of serial communication. I need to deploy on Windows systems first, but subsequent development will be needed to port it to other systems, most likely Linux and Solaris.

Are Win32::SerialPort and Device::SerialPort my best option for portability? Or should I plan on using my own object to hide the varying Serial interfaces from my main code? For Unix systems, should I be opening my own filehandles and such or is there a module that is particularly good?

If anyone cares, I am going to be uploading intel hex files to a firmware flashing program. Because of hardware limitations, I need to chop the big hexfile into many little pieces and load each piece individually. While I can do this with a simple script and a terminal, it is no fun. Thus my desire to automate. Plus, we need a tool to give to our customers (if we ever finish the device and anyone ever buys it).

Update:Added CPAN tags to module names.


TGI says moo

Replies are listed 'Best First'.
Re: Portable serial communication
by shenme (Priest) on Oct 01, 2004 at 23:21 UTC

      I missed bikeNomad's post when I searched. Thank you for turning it up, it looks interesting. Perhaps I need to write better queries.

      jcwren's post is only one person's reaction. Maybe some other monks have some thoughts on the subject that they'd be willing to share.

      Have you used Device::SerialPort or Win32::SerialPort? Have you used filehandles and friends? If the answer to either of these questions is yes, please let me know what you thought of your experience.


      TGI says moo

        jcwren's post is only one person's reaction.
        Correction, one experts reaction, which speaks volumes.
Re: Portable serial communication
by cosimo (Hermit) on Oct 04, 2004 at 15:54 UTC
    <shameless ad>
    You could also try and use Device::Modem, which automatically loads up Win32:: or Device:: depending on your os, and lets you do some basic things in a fairly simple way. It is targeted towards modems and AT/AT+ command set, so probably it's not what you want. However, as the module author, I'd like you to share your opinion on it.
    </shameless ad>
Re: Portable serial communication
by gooch (Monk) on Oct 04, 2004 at 15:04 UTC
    Device::SerialPort and Win32::SerialPort are pretty solid tools for comm control, in my experience. I recently utilized them to develop a polling system, using several dozen modems to monitor the status of several thousand underground fuel storage tanks.

    Some of the more oddball stty settings may require a bit of jiggering to get set right under *nix, depending on the varient (we use AIX), but going back and forth beween Win32 and *nix was not a problem.

    Mike "Gooch" Gucciard