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

I wrote a sloppy bit of code where I open a serial port and use it to do some basic modem communications.

Everything with it works great, but I can't manage to make it hang up the line. I'm guessing I need to drop DTR, but I'm not sure how I would do that using just a filehandle.

I've seen some complex examples using IO::File, but I'd rather not rewrite what I've got if there's a simple way to do it with what I have.

thanks!
tmbg

Replies are listed 'Best First'.
Re: modem handling in perl
by THRAK (Monk) on Apr 30, 2001 at 19:21 UTC
Re: modem handling in perl
by Anonymous Monk on Apr 30, 2001 at 19:08 UTC
    Wouldn't sending ATH do it? I seem to remember that being the proper AT command for hanging up...

    ~Cybercosis

      I currently have at the end of communications the following:
      sleep(2); msend("+++\r"); sleep(2); msend("ATH0\r");
      that doesn't seem to do it

        Remove the first \r.

                - tye (but my friends call me "Tye")
Re: modem handling in perl
by the_slycer (Chaplain) on Apr 30, 2001 at 19:42 UTC
    I'm sure that there was a very good example of Serial Port communication in the last tpj issue, but the journal is currently between sites/publishers right now.

    Sadly, I cannot seem to access their archived articles, and I don't have the journal handy. There is a note on the site that they will be available in may, if you can hang on you may want to take a look at that.