File: modemclient.h.html

package info (click to toggle)
rudiments 0.31-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 7,516 kB
  • ctags: 3,248
  • sloc: asm: 23,776; cpp: 22,792; sh: 7,769; ansic: 1,769; makefile: 1,054; xml: 169; perl: 19
file content (86 lines) | stat: -rw-r--r-- 6,044 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<html>
<head>
<title>~/src/firstworks/rudiments-0.31/include/rudiments/modemclient.h.html</title>
<meta name="Generator" content="Vim/7.0">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffff" text="#000000">
<pre>
<font color="#0000ff">// Copyright (c) 2004 David Muse</font>
<font color="#0000ff">// See the COPYING file for more information.</font>

<font color="#a020f0">#ifndef RUDIMENTS_MODEMCLIENT_H</font>
<font color="#a020f0">#define RUDIMENTS_MODEMCLIENT_H</font>

<font color="#a020f0">#include </font><font color="#ff00ff">&lt;rudiments/private/modemclientincludes.h&gt;</font>

<font color="#0000ff">// The modemclient implements methods for connecting to and communicating with</font>
<font color="#0000ff">// a remote host using a modem.</font>

<font color="#a020f0">#ifdef RUDIMENTS_NAMESPACE</font>
<font color="#2e8b57"><b>namespace</b></font> rudiments {
<font color="#a020f0">#endif</font>

<font color="#2e8b57"><b>class</b></font> modemclientprivate;

<font color="#2e8b57"><b>class</b></font> modemclient : <font color="#a52a2a"><b>public</b></font> client, <font color="#a52a2a"><b>private</b></font> modemutil {
        <font color="#a52a2a"><b>public</b></font>:
                                modemclient();
                                modemclient(<font color="#2e8b57"><b>const</b></font> modemclient &amp;m);
                modemclient     &amp;<font color="#a52a2a"><b>operator</b></font>=(<font color="#2e8b57"><b>const</b></font> modemclient &amp;m);
                <font color="#2e8b57"><b>virtual</b></font>               ~modemclient();

                <font color="#2e8b57"><b>void</b></font>  initialize(constnamevaluepairs *cd);
                        <font color="#0000ff">// Initializes the class to use &quot;device&quot;,</font>
                        <font color="#0000ff">// &quot;baud, &quot;connectscript&quot;, &quot;phonenumber&quot;,</font>
                        <font color="#0000ff">// &quot;disconnectscript&quot;, &quot;retrywait&quot; and</font>
                        <font color="#0000ff">// &quot;retrycount&quot; when connect() is called.</font>
                <font color="#2e8b57"><b>void</b></font>  initialize(<font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *device,
                                        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *baud,
                                        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *connectscript,
                                        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *phonenumber,
                                        <font color="#2e8b57"><b>const</b></font> <font color="#2e8b57"><b>char</b></font> *disconnectscript,
                                        <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>long</b></font> retrywait,
                                        <font color="#2e8b57"><b>unsigned</b></font> <font color="#2e8b57"><b>long</b></font> retrycount);
                        <font color="#0000ff">// Initializes the class to use &quot;device&quot;,</font>
                        <font color="#0000ff">// &quot;baud, &quot;connectscript&quot;, &quot;phonenumber&quot;,</font>
                        <font color="#0000ff">// &quot;disconnectscript&quot;, &quot;retrywait&quot; and</font>
                        <font color="#0000ff">// &quot;retrycount&quot; when connect() is called.</font>

                <font color="#2e8b57"><b>int</b></font>   connect();
                        <font color="#0000ff">// Dial the modem and attempt to establish a connection.</font>
                        <font color="#0000ff">// If the connection fails, it will retry &quot;retrycount&quot;</font>
                        <font color="#0000ff">// times, waiting &quot;retrywait&quot; seconds between</font>
                        <font color="#0000ff">// retrycount.</font>
                        <font color="#0000ff">//</font>
                        <font color="#0000ff">// Setting &quot;retrycount&quot; to 0 will cause it to try to </font>
                        <font color="#0000ff">// connect indefinitely.  Setting &quot;retrywait&quot; to 0</font>
                        <font color="#0000ff">// will cause it to try to connect over and over</font>
                        <font color="#0000ff">// as fast as possible (not recommended).</font>
                        <font color="#0000ff">//</font>
                        <font color="#0000ff">// Each attempt to connect will wait &quot;timeoutsec&quot;</font>
                        <font color="#0000ff">// seconds and &quot;timeoutusec&quot; microseconds for the</font>
                        <font color="#0000ff">// connect to succeed.  Specifying -1 for either</font>
                        <font color="#0000ff">// parameter will cause the attempt to wait until the</font>
                        <font color="#0000ff">// underlying protocol times out which may be up to 2</font>
                        <font color="#0000ff">// minutes.</font>
                        <font color="#0000ff">//</font>
                        <font color="#0000ff">// Returns RESULT_SUCCESS on success and RESULT_ERROR</font>
                        <font color="#0000ff">// on failure.</font>

                <font color="#2e8b57"><b>bool</b></font>  close();
                        <font color="#0000ff">// Hangs up the modem and closes the device.</font>
                        <font color="#0000ff">//</font>
                        <font color="#0000ff">// Returns true on success and false on failure.</font>

<font color="#a020f0">        #include </font><font color="#ff00ff">&lt;rudiments/private/modemclient.h&gt;</font>
};

<font color="#a020f0">#ifdef RUDIMENTS_NAMESPACE</font>
}
<font color="#a020f0">#endif</font>

<font color="#a020f0">#endif</font>
</pre>
</body>
</html>