Minicom/Modem Questions From A Perl Programmer

Adam Lackorzynski adam at os.inf.tu-dresden.de
Mon Dec 19 12:43:07 UTC 2005


On Sat Dec 17, 2005 at 12:19:45 -0500, Hal Vaughan wrote:
> On Saturday 17 December 2005 12:07 pm, Adam Lackorzynski wrote:
> > On Sat Dec 17, 2005 at 11:22:57 -0500, Hal Vaughan wrote:
> > > On Saturday 17 December 2005 10:53 am, Adam Lackorzynski wrote:
> > > > Hi,
> > > >
> > > > On Wed Dec 14, 2005 at 18:05:25 -0500, Hal Vaughan wrote:
> > > > > Any answers, suggestions, or help will be greatly appreciated.  If I
> > > > > knew C, I'd just rip out the routine m_setparms and set it up as a
> > > > > stand alone program, but it would also help to understand what is
> > > > > going on so I can do, in Perl, everything it does.
> > > >
> > > > Hmm, isn't 'stty' what you're looking for?
> > >
> > > That hadn't come up in my searches.  I remember another program showed up
> > > that didn't do half that (can't remember it now, I'd have to dig through
> > > notes).
> > >
> > > According to the man page, it just might do what I need.
> > >
> > > As I go through the Minicom code, though, I still find a few things in it
> > > where I'm not sure what it is doing, and I'd like to do the same thing. 
> > > For example, I've found CTRL-A then X from Minicom tends to reset the
> > > modem from just about anything.  I found the code it uses:
> > >
> > > void modemreset()
> > > {
> > > 	WIN *w;
> > >
> > > 	if (P_MRESET[0] == '\0') return;
> > >
> > > 	w = mc_tell(_("Resetting Modem"));
> > > 	mputs(P_MRESET, 0);
> > > 	sleep(1);
> > > 	wclose(w, 1);
> > > }
> > >
> > > As I understand it, this is writing to the modem, but I can't find a
> > > definition of P_MRESET anywhere.  So what is being written to the modem? 
> > > Is it just a reset string like ATZ or the init string?
> >
> > P_MRESET is the string from the configuration. Grep for mreset in
> > rwconf.c to get the default string.
> 
> I got this (grep is aliased to show lines and ignore case):
> 
> [hal at wizard:src]$ grep P_MRESET *.c
> config.c:651:  wprintf(w, "%s %.48s\n", reset_string, P_MRESET);
> dial.c:216:  if (P_MRESET[0] == '\0') return;
> dial.c:219:  mputs(P_MRESET, 0);
> 
> So I loaded rwconf.c and found this line:
> 
>   { "^M~ATZ^M~",	PUBLIC,   "mreset" }
> 
> Is that what you mean?  Is the "P_" prefix something used in C for identifying 
> or something?

No, not at all. Also grep in header file (*.h), the 'mapping' is there.

> It does help, since I've been leaving out pauses and not preceding with a CR, 
> which could make a difference.  It'd be frustrating to find out that is all, 
> but I am *very* weak in this area, so I'm not surprised that it could be 
> something so obvious.
> 
> One related question: In a reset routine, I tried sending the following 
> commands:
> 
> ATZ
> AT&F
> AT ...(init string)...
> 
> and I found whenever I included the AT&F I ran into trouble with garbage 
> appearing whenever I connected to another system.  The last time I ever had 
> to worry about modem configuration was on an Apple //e, with an AppleCat (oh, 
> those WERE the days!).  I remember whenever anything went wrong, the thing to 
> do was AT&F to get the factory defaults, then send in all your init strings 
> to change the settings to what you wanted.  (Since then, when I had dialup, 
> it was an easy ISP connection without the need for config tweaking.)
> 
> Is there some problem with AT&F (Yes, I know it resets defaults, but shouldn't 
> those allow for reading data from another system)?

Well, I don't know, I'm not very experienced with modem stuff
unfortunately...



Adam
-- 
Adam                 adam at os.inf.tu-dresden.de
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/



More information about the minicom-devel mailing list