Minicom/Modem Questions From A Perl Programmer

Hal Vaughan hal at thresholddigital.com
Sat Dec 17 16:22:57 UTC 2005


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?

The reason I'm asking is because when I can't get the modem to respond to 
Perl, it always responds to Minicom and it looks like one of the things 
Minicom uses to make sure the modem is reset is this.

Thanks!

Hal



More information about the minicom-devel mailing list