[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Trapping modem indicators.



On Fri, 1 Jun 2001, Hans wrote:

H> I was just wondering: is it possible to trap modem indicators and if so,
H> how? E.g. I would like to know when a modem puts the line in OH (off hook),
H> trap that signal and use it in a script (or Tx and Rx signals for that
H> matter). /proc doesn't seem to have it and the modem-HOWTO neither.
H> Pointers appreciated. --Hans

check out /proc/tty/driver/serial

serinfo:1.0 driver:4.27
0: uart:16550A port:3F8 irq:4 baud:1200 tx:8 rx:6249 brk:1 RTS|DTR
1: uart:16550A port:2F8 irq:3 baud:115200 tx:5032122 rx:65579052 brk:4 RTS|CTS|DTR|DSR|CD

my ttyS0 is mouse and ttyS1 is modem which is currently connected, i don't
think you can poll the off hook but the CD on the end of the 2nd line means
Carrier Detected .. the modem is connected to another modem ...

the tx/rx stats appear to be cumulative, they don't reset when the modem goes
offline .. 


                                                Dingo.


                                      ).|.(
                                    '.'___'.'
                                   ' '(>~<)' '
   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-ooO-=(_)=-Ooo-=-=-=-=-=-=-=-=-=-=-=-=-=-
    Petr [Dingo] Dvorak                                 dingo@pdragon.org
    Coder - Purple Dragon MUD                       pdragon.org port 3333
   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-[ 369D93 ]=-=-
     Debian version 2.2.18pre21, up 2 days, 11 users, load average: 1.01
   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-




Reply to: