558 lines
15 KiB
HTML
558 lines
15 KiB
HTML
<html>
|
|
|
|
<head>
|
|
<meta http-equiv="Content-Type"
|
|
content="text/html; charset=iso-8859-1">
|
|
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
|
|
<title>CommServ</title>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
|
<tr>
|
|
<td width="400" height="40"> </td>
|
|
<td width="30" height="40"><a
|
|
href="../../../epoc32/doc/group/sdk.html"><img
|
|
src="../../../epoc32/doc/group/library.gif"
|
|
alt="SDK Home" align="top" border="0" width="30"
|
|
height="30"></a></td>
|
|
<td width="30" height="40"><a
|
|
href="../../../epoc32/doc/glossary/glossary.html"><img
|
|
src="../../../epoc32/doc/group/glossary.gif"
|
|
alt="Glossary" align="top" border="0" width="30"
|
|
height="30"></a></td>
|
|
<td width="30" height="40"><a
|
|
href="../../../epoc32/doc/index/id-toc.html"><img
|
|
src="../../../epoc32/doc/group/index.gif" alt="Index"
|
|
align="top" border="0" width="30" height="30"></a></td>
|
|
<td width="30" height="40"><a href="commcfg1.htm"><b><img
|
|
src="../../../epoc32/doc/group/stoneleft.gif" alt="Left"
|
|
align="top" border="0" width="30" height="30"></b></a></td>
|
|
<td width="30" height="40"><a href="commservcfg.htm"><b><img
|
|
src="../../../epoc32/doc/group/stoneright.gif"
|
|
alt="Right" align="top" border="0" width="30" height="30"></b></a></td>
|
|
<td width="30" height="40"><a href="programm.htm"><b><img
|
|
src="../../../epoc32/doc/group/stoneup.gif" alt="Up"
|
|
align="top" border="0" width="30" height="30"></b></a></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<hr>
|
|
|
|
<h1>CommServ class</h1>
|
|
|
|
<hr>
|
|
|
|
<p><em>Section contents</em></p>
|
|
|
|
<ul>
|
|
<li><a href="#Overview"><strong>Overview</strong></a></li>
|
|
<li><a href="#Construction"><strong>Construction /
|
|
destruction</strong></a><ul>
|
|
<li><a href="#NewCommServ"><strong>NewCommServ -
|
|
Constructor</strong></a></li>
|
|
<li><a href="#DeleteCommServ"><strong>DeleteCommServ
|
|
- Destructor</strong></a></li>
|
|
</ul>
|
|
</li>
|
|
<li><a href="#Methods provided"><strong>Methods provided</strong></a><ul>
|
|
<li><a href="#Close"><strong>CommServClose</strong></a></li>
|
|
<li><a href="#Connect"><strong>CommServConnect</strong></a></li>
|
|
<li><a href="#GetPortInfo"><strong>CommServGetPortInfo</strong></a></li>
|
|
<li><a href="commserv.htm#GetPortInfo2"><strong>CommServGetPortInfo2</strong></a></li>
|
|
<li><a href="#LoadCommModule"><strong>CommServLoadCommModule</strong></a></li>
|
|
<li><a href="#NumPorts"><strong>CommServNumPorts</strong></a></li>
|
|
<li><a href="#UnloadCommModule"><strong>CommServUnloadCommModule</strong></a></li>
|
|
<li><a href="#Version"><strong>CommServVersion</strong></a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
<hr>
|
|
|
|
<h2><a name="Overview">Overview</a></h2>
|
|
|
|
<h5>Defined in</h5>
|
|
|
|
<p><code>ccomms.oxh</code></p>
|
|
|
|
<hr>
|
|
|
|
<h2><a name="Construction">Construction / destruction</a></h2>
|
|
|
|
<hr size="1">
|
|
|
|
<h3><a name="NewCommServ">NewCommServ - Constructor</a></h3>
|
|
|
|
<h5>Usage</h5>
|
|
|
|
<p><code>this& = NewCommServ&:</code></p>
|
|
|
|
<h5>Description</h5>
|
|
|
|
<p>Creates a comms server object and returns a handle which
|
|
allows the object to be manipulated.</p>
|
|
|
|
<h5>Return Value</h5>
|
|
|
|
<table border="1">
|
|
<tr>
|
|
<td><code>this&</code></td>
|
|
<td>An value which represents the created object</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h5>Error Handling</h5>
|
|
|
|
<p>If the object could not be created then an error is generated
|
|
which should be trapped by an <font face="Times New Roman"><code>ONERR</code></font>
|
|
handler.</p>
|
|
|
|
<h5>Example</h5>
|
|
|
|
<pre> LOCAL this&
|
|
|
|
<strong>this& = NewCommServ&:</strong>
|
|
DeleteCommServ:(this&) </pre>
|
|
|
|
<hr size="1">
|
|
|
|
<h3><a name="DeleteCommServ">DeleteCommServ - Destructor</a></h3>
|
|
|
|
<h5>Usage</h5>
|
|
|
|
<p><code>DeleteCommServ:(BYREF this&)</code></p>
|
|
|
|
<h5>Description</h5>
|
|
|
|
<p>Destroys the comms server object.</p>
|
|
|
|
<h5>Arguments</h5>
|
|
|
|
<table border="1">
|
|
<tr>
|
|
<td><code>BYREF this&</code></td>
|
|
<td>A handle to a comms server object</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h5>Example</h5>
|
|
|
|
<pre> LOCAL this&
|
|
|
|
this& = NewCommServ&:
|
|
<strong>DeleteCommServ:(this&)</strong> </pre>
|
|
|
|
<hr>
|
|
|
|
<h2><a name="Methods provided">Methods provided</a></h2>
|
|
|
|
<hr size="1">
|
|
|
|
<h3><a name="Close">CommServClose</a></h3>
|
|
|
|
<h5>Usage</h5>
|
|
|
|
<p><code>CommServClose:(this&)</code></p>
|
|
|
|
<h5>Description</h5>
|
|
|
|
<p>Closes a connection to the comms server.</p>
|
|
|
|
<h5>Arguments</h5>
|
|
|
|
<table border="1">
|
|
<tr>
|
|
<td><code>this&</code></td>
|
|
<td>A handle to a comms server object</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h5>Example</h5>
|
|
|
|
<pre> LOCAL this&,result%
|
|
|
|
this& = NewCommServ&:
|
|
result% = CommServConnect%:(this&)
|
|
<strong>CommServClose:(this&)</strong>
|
|
DeleteCommServ:(this&) </pre>
|
|
|
|
<h5>See Also</h5>
|
|
|
|
<p><a href="#Connect">CommServConnect</a></p>
|
|
|
|
<hr size="1">
|
|
|
|
<h3><a name="Connect">CommServConnect</a></h3>
|
|
|
|
<h5>Usage</h5>
|
|
|
|
<p><code>result% = CommServConnect%:(this&)</code></p>
|
|
|
|
<h5>Description</h5>
|
|
|
|
<p>Opens a connection to the comms server.</p>
|
|
|
|
<h5>Arguments</h5>
|
|
|
|
<table border="1">
|
|
<tr>
|
|
<td><code>this&</code></td>
|
|
<td>A handle to a comms server object</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h5>Return value</h5>
|
|
|
|
<table border="1">
|
|
<tr>
|
|
<td><code>result%</code></td>
|
|
<td>An error code</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h5>Example</h5>
|
|
|
|
<pre> LOCAL this&,result%
|
|
|
|
this& = NewCommServ&:
|
|
<strong>result% = CommServConnect%:(this&)</strong>
|
|
CommServClose:(this&)
|
|
DeleteCommServ:(this&) </pre>
|
|
|
|
<h5>See Also</h5>
|
|
|
|
<p><a href="#Close">CommServClose</a></p>
|
|
|
|
<hr size="1">
|
|
|
|
<h3><a name="GetPortInfo">CommServGetPortInfo</a></h3>
|
|
|
|
<h5>Usage</h5>
|
|
|
|
<p><code>result% = CommServGetPortInfo%:(this&,name$,info&)</code></p>
|
|
|
|
<h5>Description</h5>
|
|
|
|
<p>Obtains the port information for a comms module specified by
|
|
name (for example, <code>ECUART</code> for RS232).</p>
|
|
|
|
<h5>Arguments</h5>
|
|
|
|
<table border="1">
|
|
<tr>
|
|
<td><code>this&</code></td>
|
|
<td>A handle to a comms server object</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>name$</code></td>
|
|
<td>A name of a serial port</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>info&</code></td>
|
|
<td>A handle to a <a href="../Documentation/serialin.htm">serial
|
|
information</a> object</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h5>Return value</h5>
|
|
|
|
<table border="1">
|
|
<tr>
|
|
<td><code>result%</code></td>
|
|
<td>An error code</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h5>Example</h5>
|
|
|
|
<pre> LOCAL this&,info&,result%
|
|
|
|
this& = NewCommServ&:
|
|
info& = NewSerialInfo&:
|
|
result% = CommServConnect%:(this&)
|
|
<strong>result% = CommServGetPortInfo%:(this&,"ECUART",info&)</strong>
|
|
CommServClose:(this&)
|
|
DeleteSerialInfo:(info&)
|
|
DeleteCommServ:(this&) </pre>
|
|
|
|
<h5>See Also</h5>
|
|
|
|
<p><a href="#GetPortInfo2">CommServGetPortInfo2</a></p>
|
|
|
|
<hr size="1">
|
|
|
|
<h3><a name="GetPortInfo2">CommServGetPortInfo2</a></h3>
|
|
|
|
<h5>Usage</h5>
|
|
|
|
<p><code>result% = CommServGetPortInfo2%:(this&,index&,module&,info&)</code></p>
|
|
|
|
<h5>Description</h5>
|
|
|
|
<p>Obtains the port information for a comms module specified by
|
|
an index number from 0. This allows you to enumerate through the
|
|
loaded comms modules. You can obtain the current number of loaded
|
|
comms modules by calling <a href="#NumPorts"><font size="4"><code><tt>CommServNumPorts</tt></code></font></a>.</p>
|
|
|
|
<h5>Arguments</h5>
|
|
|
|
<table border="1">
|
|
<tr>
|
|
<td><code>this&</code></td>
|
|
<td>A handle to a comms server object</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>index&</code></td>
|
|
<td>Index of the port (starting at 0)</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>modeul&</code></td>
|
|
<td>A <a href="../../CDescriptor/Documentation/des.htm">descriptor</a>
|
|
to return the name of a loaded module</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>info&</code></td>
|
|
<td>A handle to a <a href="../Documentation/serialin.htm">serial
|
|
information</a> object</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h5>Return value</h5>
|
|
|
|
<table border="1">
|
|
<tr>
|
|
<td><code>result%</code></td>
|
|
<td>An error code</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h5>See Also</h5>
|
|
|
|
<p><a href="#GetPortInfo">CommServGetPortInfo</a></p>
|
|
|
|
<hr size="1">
|
|
|
|
<h3><a name="LoadCommModule">CommServLoadCommModule</a></h3>
|
|
|
|
<h5>Usage</h5>
|
|
|
|
<p><code>result% = CommServLoadCommModule%:(this&,name$)</code></p>
|
|
|
|
<h5>Description</h5>
|
|
|
|
<p>Use this function to load a comms module.</p>
|
|
|
|
<h5>Arguments</h5>
|
|
|
|
<table border="1">
|
|
<tr>
|
|
<td><code>this&</code></td>
|
|
<td>A handle to a comms server object</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h5>Return value</h5>
|
|
|
|
<table border="1">
|
|
<tr>
|
|
<td><code>result%</code></td>
|
|
<td>An error code</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h5>Notes</h5>
|
|
|
|
<ol>
|
|
<li>There is no need for an extension (<code>.CSY</code>) is
|
|
automatically appended by this function. </li>
|
|
<li>This function automatically searches the <code>/System/Libs</code>
|
|
directories on all drives for this file </li>
|
|
<li>Two module are always available as standard. ECUART
|
|
drives the built in serial port on an ARM in RS232 mode.
|
|
IRCOMM drives the infra-red port on an ARM in infra-red
|
|
mode. </li>
|
|
</ol>
|
|
|
|
<h5>Example</h5>
|
|
|
|
<pre> LOCAL this&
|
|
|
|
this& = NewCommServ&:
|
|
result% = CommServConnect%:(this&)
|
|
<strong>result% = CommServLoadCommModule%:(this&,"IRCOMM")</strong>
|
|
result% = CommServUnloadCommModule%:(this&,"IRCOMM")
|
|
CommServClose:(this&)
|
|
DeleteCommServ:(this&) </pre>
|
|
|
|
<h5>See Also</h5>
|
|
|
|
<p><a href="#UnloadCommModule">CommServUnloadCommModule</a></p>
|
|
|
|
<hr size="1">
|
|
|
|
<h3><a name="NumPorts">CommServNumPorts</a></h3>
|
|
|
|
<h5>Usage</h5>
|
|
|
|
<p><code>result% = CommServNumPorts%:(this&,BYREF num&)</code></p>
|
|
|
|
<h5>Description</h5>
|
|
|
|
<p>Use this function to find out how many comms module (CSYs) are
|
|
loaded</p>
|
|
|
|
<h5>Arguments</h5>
|
|
|
|
<table border="1">
|
|
<tr>
|
|
<td><code>this&</code></td>
|
|
<td>A handle to a comms server object</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>BYREF num&</code></td>
|
|
<td>On return, holds the number of loaded CSYs</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h5>Return value</h5>
|
|
|
|
<table border="1">
|
|
<tr>
|
|
<td><code>result%</code></td>
|
|
<td>An error code</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<hr size="1">
|
|
|
|
<h3><a name="UnloadCommModule">CommServUnloadCommModule</a></h3>
|
|
|
|
<h5>Usage</h5>
|
|
|
|
<p><code>result% = CommServUnloadCommModule%:(this&,name$)</code></p>
|
|
|
|
<h5>Description</h5>
|
|
|
|
<p>Use this function to unload a comms module — for
|
|
instance, if switching from RS232 to infra-red operation.</p>
|
|
|
|
<h5>Arguments</h5>
|
|
|
|
<table border="1">
|
|
<tr>
|
|
<td><code>this&</code></td>
|
|
<td>A handle to a comms server object</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h5>Return value</h5>
|
|
|
|
<table border="1">
|
|
<tr>
|
|
<td><code>result%</code></td>
|
|
<td>An error code</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h5>Example</h5>
|
|
|
|
<pre> LOCAL this&
|
|
|
|
this& = NewCommServ&:
|
|
result% = CommServConnect%:(this&)
|
|
result% = CommServLoadCommModule%:(this&,"IRCOMM")
|
|
<strong>result% = CommServUnloadCommModule%:(this&,"IRCOMM")</strong>
|
|
CommServClose:(this&)
|
|
DeleteCommServ:(this&) </pre>
|
|
|
|
<h5>Note</h5>
|
|
|
|
<p>There is no need to unload a comms module when the connection
|
|
to the server is closed, as this is done automatically.</p>
|
|
|
|
<h5>See Also</h5>
|
|
|
|
<p><a href="#LoadCommModule">CommServLoadCommModule</a></p>
|
|
|
|
<hr size="1">
|
|
|
|
<h3><a name="Version">CommServVersion</a></h3>
|
|
|
|
<h5>Usage</h5>
|
|
|
|
<p><code>version& = CommServVersion&:(this&)</code></p>
|
|
|
|
<h5>Description</h5>
|
|
|
|
<p>Creates and returns a handle to a version object.</p>
|
|
|
|
<p>The version number may be incremented in future releases of
|
|
the file server. If extra features are added in such releases,
|
|
the version number may be used by application programs as a basis
|
|
for assessing the capabilities of the file server</p>
|
|
|
|
<h5>Arguments</h5>
|
|
|
|
<table border="1">
|
|
<tr>
|
|
<td><code>this&</code></td>
|
|
<td>A handle to a comms server object</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h5>Return value</h5>
|
|
|
|
<table border="1">
|
|
<tr>
|
|
<td><code>version&</code></td>
|
|
<td>A handle to a <a
|
|
href="../../CE32Base/Documentation/version.htm">version</a>
|
|
object. This must be freeded with a call to <a
|
|
href="../../CE32Base/Documentation/version.htm#DeleteVersion"><code>DeleteVersion:</code></a></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h5>Example</h5>
|
|
|
|
<pre> LOCAL this&,version&
|
|
|
|
this& = NewCommServ&:
|
|
<strong>version& = CommServVersion&:(this&)</strong>
|
|
DeleteVersion:(version&)
|
|
DeleteCommServ:(this&) </pre>
|
|
|
|
<hr>
|
|
|
|
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
|
<tr>
|
|
<td width="400" height="40"> </td>
|
|
<td width="30" height="40"><a
|
|
href="../../../epoc32/doc/group/sdk.html"><img
|
|
src="../../../epoc32/doc/group/library.gif"
|
|
alt="SDK Home" align="top" border="0" width="30"
|
|
height="30"></a></td>
|
|
<td width="30" height="40"><a
|
|
href="../../../epoc32/doc/glossary/glossary.html"><img
|
|
src="../../../epoc32/doc/group/glossary.gif"
|
|
alt="Glossary" align="top" border="0" width="30"
|
|
height="30"></a></td>
|
|
<td width="30" height="40"><a
|
|
href="../../../epoc32/doc/index/id-toc.html"><img
|
|
src="../../../epoc32/doc/group/index.gif" alt="Index"
|
|
align="top" border="0" width="30" height="30"></a></td>
|
|
<td width="30" height="40"><a href="commcfg1.htm"><b><img
|
|
src="../../../epoc32/doc/group/stoneleft.gif" alt="Left"
|
|
align="top" border="0" width="30" height="30"></b></a></td>
|
|
<td width="30" height="40"><a href="commservcfg.htm"><b><img
|
|
src="../../../epoc32/doc/group/stoneright.gif"
|
|
alt="Right" align="top" border="0" width="30" height="30"></b></a></td>
|
|
<td width="30" height="40"><a href="programm.htm"><b><img
|
|
src="../../../epoc32/doc/group/stoneup.gif" alt="Up"
|
|
align="top" border="0" width="30" height="30"></b></a></td>
|
|
</tr>
|
|
</table>
|
|
</body>
|
|
</html>
|