Rudiments
|
Inherits client, and modemutil.
Public Member Functions | |
modemclient () | |
modemclient (const modemclient &m) | |
modemclient & | operator= (const modemclient &m) |
virtual | ~modemclient () |
void | initialize (constnamevaluepairs *cd) |
void | initialize (const char *device, const char *baud, const char *customatcommands, const char *connectscript, const char *phonenumber, const char *disconnectscript, unsigned long retrywait, unsigned long retrycount) |
int32_t | connect () |
bool | close () |
The modemclient implements methods for connecting to and communicating with a remote host using a modem.
modemclient::modemclient | ( | ) |
Creates an instance of the modemclient class.
modemclient::modemclient | ( | const modemclient & | m | ) |
Creates an instance of the modemclient class that is a copy of "m".
virtual modemclient::~modemclient | ( | ) | [virtual] |
Deletes this instance of the modemclient class.
bool modemclient::close | ( | ) | [virtual] |
Hangs up the modem and closes the device.
Returns true on success and false on failure.
Reimplemented from filedescriptor.
int32_t modemclient::connect | ( | ) | [virtual] |
Dials the modem and attempt to establish a connection. If the connection fails, it will retry "retrycount" times, waiting "retrywait" seconds between retrycount.
Setting "retrycount" to 0 will cause it to try to connect indefinitely. Setting "retrywait" to 0 will cause it to try to connect over and over as fast as possible (not recommended).
Each attempt to connect will wait "timeoutsec" seconds and "timeoutusec" microseconds for the connect to succeed. Specifying -1 for either parameter will cause the attempt to wait until the underlying protocol times out which may be up to 2 minutes.
Returns RESULT_SUCCESS on success and RESULT_ERROR on failure.
Implements client.
void modemclient::initialize | ( | constnamevaluepairs * | cd | ) | [virtual] |
void modemclient::initialize | ( | const char * | device, |
const char * | baud, | ||
const char * | customatcommands, | ||
const char * | connectscript, | ||
const char * | phonenumber, | ||
const char * | disconnectscript, | ||
unsigned long | retrywait, | ||
unsigned long | retrycount | ||
) |
Initializes the class to use "device", "baud, "customatcommands", "connectscript", "phonenumber", "disconnectscript", "retrywait" and "retrycount" when connect() is called.
modemclient& modemclient::operator= | ( | const modemclient & | m | ) |
Makes this instance of the modemclient class identical to "m".