Re: Application that shows modem lights.

From: Rob van Nieuwkerk (robn@verdi.et.tudelft.nl)
Date: Mon Jun 19 2000 - 13:01:27 EST


Hi Roger,

> The problem.
> ------------
>
> I'd like to write an applciation that monitors a serial port and shows
> what leds on the mode would be on. In fact the application is done,
> but it kind of disturbs the normal operation of the serial port. This
> is neccesary on Linux boxen, as you can have lots of serial ports,
> more than you can monitor by putting the modem on your desk.
>
> I can open the port, which raises DTR. I can then do the TIOCMGET
> ioctl to get the current state of the modem control signals. Then
> if the port gets closed, DTR doesn't drop, as I still have the
> port open.
>
> I can't open the port when it's in ppp mode. It seems I can keep the
> port open while in ppp mode.
>
> The ioctl doesn't tell me of the activity on RX and TX. (Gnome users
> will jump up-and-down saying that they have an applett that does show
> TX and RX. Well, kind of: This only works when it's in "ppp" mode.)
>
>
> Design goals.
> -------------
>
> - Don't influence the normal operation of the port.
> - unlimited "portwatchers".
> - has a way of monitoring the TX and RX activity.
>
> Current implementation.
> -----------------------
>
> On User Space Serial Ports (*) and Specialix SX (#) and RIO (#) ports
> I can make an ioctl on the "control/firmware" device that couples the
> file descriptor virtually with the requested port, so that the
> tiocmget returns the stats for the port. Also the usage count of the
> port won't be influenced. So DTR behaves normally.
>
> I also keep a count of total RX and TX chars. Whenever those change,
> the application can turn on the RX and TX leds.
>
> However, this is not easily adapted to other serial ports. (e.g. the
> standard 16550 ports).
>
> Suggestions?

Yes:
        cat /proc/tty/driver/serial

or use the "statserial" program (comes with Red Hat, other distro's too
probably).

        Greetings,
        Rob van Nieuwkerk

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:17 EST