COMM-DRV/Lib: ModemAttention() Puts modem in command state

Description-

This function puts the modem in the command state & verbose mode. It first does this by sending “+++”. If the modem does not respond to “+++” it will toggle the DTR signal. If the modem still does not respond, it returns an error. This function can be used to determine if a modem is on a particular port.

Syntax-

stat = ModemAttention(port);

On Entry-

int port;

Port previously opened with InitializePort() or OpenComPort().

On Exit-

int stat;

0 If successful.

else

-1 If port was not initialized or modem does not respond.

See Also-

Dial()
ModemAnswerMode()
ModemConnect()
ModemGetCarrierSpeed()
ModemGetConnectSpeed()
ModemHangup()
ModemInit()
ModemModifyString()

Example-

#include "comm.h"
int port=0;
 int stat;
if ((stat = ModemAttention(port)) == -1)
 {
 printf("Error getting modem's attention.\n");
/* Take remedial action */
 }