How to handle incompatible modems?

Gert Doering (gert@greenie.muc.de)
Sun, 6 Mar 1994 16:23:35 +0100


Hi,

Russell Nelson wrote:
> I want to add support to mgetty+sendfax for modems based on the Cirrus
> MD9624 chipset.

Sounds good.

> It's possible to automatically identify what modem is
> being used via the ATIn command. 

Well, actually that point came up some time ago, and I voted against it. I
prefer to have a configuration file where all the modem setup things (init
strings, fax capabilities, voice command set,...) are stored in, and the
user simply specifies the modem type to use.

For the modems that mgetty already has been used on, I can provide that
config file.

I like my style better, because

- ATIx is not bulletproof
- the user *knows* what kind of modem he has, so there's no gain in a
  program *guessing* it
- With "ATIx" you would have to wire damn many different modem types in
  the code, and it's not as easy to extend to an unknown type.

> So I would say that the different
> commands/code should be hidden behind variables and pointers to
> functions (as opposed to ifdefs).  Any suggestions on how I should do
> this?

Well, please do it as ifdefs for now. Your proposal is definitely better
than ifdefs, but since it will need major rewriting of much code, I'd
prefer to do it myself.

gert

-- 
Ok, Ihr habt gewonnen, hier ist eine neue signature...

Gert Doering - Munich, Germany                             gert@greenie.muc.de
fax: +49-89-3243328                         gert.doering@physik.tu-muenchen.de