Hayes AT Commands: Detect Remote Hangup?

前端 未结 2 1802
死守一世寂寞
死守一世寂寞 2020-12-20 06:39

How are you supposed to programatically detect when the remote modem on your call hangs up? I am writing a C program which interfaces with a SoftModem device /dev/ttyS

2条回答
  •  一生所求
    2020-12-20 06:59

    This is a hardware signal on modems, the Carrier Detect (CD) line. You'll need to monitor it to know that the connection was lost. Basics in linux are described in this how-to, you obtain the signal state with ioctl() using the TIOCM_CAR command.

提交回复
热议问题