H
Hal Vaughan
I have a problem with my mode, which I am controlling from
Device::SerialPort. It usually works (meaning I can run a Perl script that
uses my modem and it'll be able to control it easily). After the system
has rebooted, or after I've run minicom and exited, my Perl scripts can't
control the modem. If I rum minicom and quit without resetting the modem,
my Perl script works.
I figure there must be something in the modem that I have to set (or reset
or change) that I'm missing. I do not know C, but was able to go through
the minicom source (it's in C), and find out that when I exit, an extra
routine is run to reset the modem to previous settings. There is also an
opposite routine, to save settings (but no matter what the settings before
running minicom, whenever I run it and exit, my Perl script still won't
work).
Here's the part of the C code that gets the modem info:
tcgetattr(fd, &savetty);
ioctl(fd, TIOCGETP, &sg);
ioctl(fd, TIOCGETC, &tch);
ioctl(fd, TIOCLGET, &lsw);
ioctl(fd, TIOCMODG, &m_word);
And here's the part that restores it when I exit minicom:
tcsetattr(fd, TCSANOW, &savetty);
ioctl(fd, TIOCSETP, &sg);
ioctl(fd, TIOCSETC, &tch);
ioctl(fd, TIOCLSET, &lsw);
ioctl(fd, TIOCMODS, &m_word);
From my understanding, ioctl is changing the settings on the modem. I
figure if I knew what it was changing, I could make sure I set it to what
works for my Perl script in that script. I'm not clear if "tcgetattr" is
storing the ENTIRE modem configuration or not. It would help to know if it
does. Also knowing what is being changed in the ioctl calls (TIOCSETP,
TIOCSETC, TIOCLSET, TIOCMODS) would help, too. Can anyone tell me what the
program is doing or what settings would be the equivalent in working with
the modem in Device::SerialPort? While there are web pages with these
terms mentioned, they are always used in the context of people who already
know about them.
Thanks for any help!
Hal
Device::SerialPort. It usually works (meaning I can run a Perl script that
uses my modem and it'll be able to control it easily). After the system
has rebooted, or after I've run minicom and exited, my Perl scripts can't
control the modem. If I rum minicom and quit without resetting the modem,
my Perl script works.
I figure there must be something in the modem that I have to set (or reset
or change) that I'm missing. I do not know C, but was able to go through
the minicom source (it's in C), and find out that when I exit, an extra
routine is run to reset the modem to previous settings. There is also an
opposite routine, to save settings (but no matter what the settings before
running minicom, whenever I run it and exit, my Perl script still won't
work).
Here's the part of the C code that gets the modem info:
tcgetattr(fd, &savetty);
ioctl(fd, TIOCGETP, &sg);
ioctl(fd, TIOCGETC, &tch);
ioctl(fd, TIOCLGET, &lsw);
ioctl(fd, TIOCMODG, &m_word);
And here's the part that restores it when I exit minicom:
tcsetattr(fd, TCSANOW, &savetty);
ioctl(fd, TIOCSETP, &sg);
ioctl(fd, TIOCSETC, &tch);
ioctl(fd, TIOCLSET, &lsw);
ioctl(fd, TIOCMODS, &m_word);
From my understanding, ioctl is changing the settings on the modem. I
figure if I knew what it was changing, I could make sure I set it to what
works for my Perl script in that script. I'm not clear if "tcgetattr" is
storing the ENTIRE modem configuration or not. It would help to know if it
does. Also knowing what is being changed in the ioctl calls (TIOCSETP,
TIOCSETC, TIOCLSET, TIOCMODS) would help, too. Can anyone tell me what the
program is doing or what settings would be the equivalent in working with
the modem in Device::SerialPort? While there are web pages with these
terms mentioned, they are always used in the context of people who already
know about them.
Thanks for any help!
Hal