linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Transmitting chars when DTR/RTS are low
@ 2004-03-24  5:28 Jim Brain
  0 siblings, 0 replies; only message in thread
From: Jim Brain @ 2004-03-24  5:28 UTC (permalink / raw)
  To: linux-serial

I apologize in advance if this is a FAQ, as I have scoured newsgroups
and web pages for a few days looking for the answer, to no avail, but
many folks in this area seemed to have lots of related wisdom.  If you
will indulge me:

I am writing an application that will emulate a modem on Linux (so that
older apps that expect a modem and an AT command set can be null-modem
connected to a Linux PC and never know the difference.  Instead of phone
line, the connection will be IP (atdt192.168.0.1:23 etc.)  There are a
few other attempts out there, but the ones I find are either commercial
or with Windows.

I have written the application, and almost all of it is working.  Both
sides can communicate, and all seems well.  However, many null modem
cables place DCD with the DTR pin.  In order, thus, to emulate a DCD to
the non PC system, I need to bring DTR low until an IP connection comes in.

This is my problem.  When I do that, the 16550A I have cannot send any
characters out.  I would chalk it up to that being the way it is, but I
have here right next to me a Windows applicaiton that is doing the exact
same thing, and all is working well.  I see DTR and RST low on my modem
line tester, and I can send and receive chars from COM1 via Win32.

I have read all of char/serial.c, and cannot see the issue from there.

I am using CLOCAL on my setattr.  Seeing a post in here from long ago
about misuse of TIOCMSET and TIOCMGET in setting DTR lines and such low
(and clobbering OUT1 and OUT2), I switched my code tonight to:

  int status;
  //old code
  //ioctl(cfg->fdTTY, TIOCMGET, &status);
  //status &= ~TIOCM_DTR;
  //ioctl(cfg->fdTTY, TIOCMSET, &status);
  status = TIOCM_DTR;
  ioctl(cfg->fdTTY, TIOCMBIC, &status);
  printf("Dropping DSR\n");
  return status;

with no luck.

I surmise that I am stepping out of the bounds of what Linux wants to do
with a serial port, but I refuse to believe it cannot be done.  I can
only assume I am missing some trivial item...  I looked at DZCOMM, but
it simply maps into the same APIs I am using.

Would anyone have a clue as to my error?  I can send source if wanted
(it's open source, and only 42kB of an app at that).

Jim Brain



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-03-24  5:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-24  5:28 Transmitting chars when DTR/RTS are low Jim Brain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).