COMM-DRV/Lib: ModemInit() Set modem initialization string

Description-

This function sends the modem initialization string(the modem initialization string may be changed with the ModemModifyString() function). The default initialization string used by COMM-DRV/LIB should work with most modems. It forces the modem to return verbose result codes from which the connect baud rate(baud rate between the computer and the modem) and the carrier baud rate(baud rate between the two modems) are retrieved. The modem is left in the command state when this function returns.

Syntax-

stat = ModemInit(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()
ModemAttention()
ModemConnect()
ModemGetCarrierSpeed()
ModemGetConnectSpeed()
ModemHangup()
ModemModifyString()

Example-

#include "comm.h"
int port=0;
 int stat;
if ((stat = ModemInit(port)) == -1)
 {
 printf("Initializing modem\n");
/* Take remedial action */
 }