COMM-DRV/Lib: ModemGetConnectSpeed() Returns connect speed

Description-

Returns the connect speed at which the modem last connected(baud rate between the computer and the modem). The speed returned by this function is only valid if a previous call to ModemConnect() was successful

Syntax-

speed =ModemGetConnectSpeed(port);

On Entry-

int port;

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

On Exit-

long speed;

The actual connect speed that was returned by the modem the last time it successfully connected to another modem. This value is a positive decimal value. If a -1 is returned then the port was not initialized.

See Also-

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

Example-

#include "comm.h>"
int port=0;
 int stat;
 int mode=1;
 long speed;
 char *telephone="1-713-568-6401";
if ((stat = ModemInit(port)) == -1)
 {
 printf("Error initializing modem\n");
/* Take remedial action */
 }
if ((stat = Dial(port,mode,telephone)) == -1)
 {
 printf("Modem not responding\n");
/* Take remedial action */
 }
if ((stat = ModemConnect(port)) != 0)
 {
printf("Error connecting to modem\n");
/* Take remedial action */
 }
if ((speed = ModemGetCarrierSpeed(port)) == -1L)
 {
 printf("Port not initialized\n");
/* Take remedial action */
 }
if (speed !=ModemGetConnectSpeed(port))
 printf("Connect & Carrier Speeds are different\n");