Files
uip/doc/html/a00084.html
2013-03-27 21:30:25 +01:00

240 lines
11 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>uIP 0.9: Serial Line IP (SLIP) protocol</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>Serial Line IP (SLIP) protocol<br>
<small>
[<a class="el" href="a00075.html">The uIP TCP/IP stack</a>]</small>
</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
The SLIP protocol is a very simple way to transmit IP packets over a serial line. It does not provide any framing or error control, and is therefore not very widely used today.<p>
This SLIP implementation requires two functions for accessing the serial device: <a class="el" href="a00084.html#a5">slipdev_char_poll()</a> and <a class="el" href="a00084.html#a4">slipdev_char_put()</a>. These must be implemented specifically for the system on which the SLIP protocol is to be run.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Files</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>file &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00067.html">slipdev.c</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">SLIP protocol implementation. <br><br></td></tr>
<p>
<tr><td class="memItemLeft" nowrap align=right valign=top>file &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00068.html">slipdev.h</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">SLIP header file. <br><br></td></tr>
<p>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00084.html#a4">slipdev_char_put</a> (<a class="el" href="a00086.html#a0">u8_t</a> c)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Put a character on the serial device. </em> <a href="#a4"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a0">u8_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00084.html#a5">slipdev_char_poll</a> (<a class="el" href="a00086.html#a0">u8_t</a> *c)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Poll the serial device for a character. </em> <a href="#a5"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00084.html#a6">slipdev_init</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Initialize the SLIP module. </em> <a href="#a6"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00084.html#a7">slipdev_send</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Send the packet in the uip_buf and uip_appdata buffers using the SLIP protocol. </em> <a href="#a7"></a><em><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a00086.html#a1">u16_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a00084.html#a8">slipdev_poll</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Poll the SLIP device for an available packet. </em> <a href="#a8"></a><em><br><br></td></tr>
</table>
<hr><h2>Function Documentation</h2>
<a name="a5" doxytag="slipdev.h::slipdev_char_poll"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a0">u8_t</a> slipdev_char_poll </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a0">u8_t</a> *&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>c</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Poll the serial device for a character.
<p>
This function is used by the SLIP implementation to poll the serial device for a character. It must be implemented specifically for the system on which the SLIP implementation is to be run.<p>
The function should return immediately regardless if a character is available or not. If a character is available it should be placed at the memory location pointed to by the pointer supplied by the arguement c.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>c</em>&nbsp;</td><td>A pointer to a byte that is filled in by the function with the received character, if available.</td></tr>
</table>
</dl>
<dl compact><dt><b>Return values:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>0</em>&nbsp;</td><td>If no character is available. </td></tr>
<tr><td valign=top><em>Non-zero</em>&nbsp;</td><td>If a character is available. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a4" doxytag="slipdev.h::slipdev_char_put"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void slipdev_char_put </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="a00086.html#a0">u8_t</a>&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>c</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Put a character on the serial device.
<p>
This function is used by the SLIP implementation to put a character on the serial device. It must be implemented specifically for the system on which the SLIP implementation is to be run.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>c</em>&nbsp;</td><td>The character to be put on the serial device. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="a6" doxytag="slipdev.h::slipdev_init"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void slipdev_init </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">void&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Initialize the SLIP module.
<p>
This function does not initialize the underlying RS232 device, but only the SLIP part. </td>
</tr>
</table>
<a name="a8" doxytag="slipdev.h::slipdev_poll"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="a00086.html#a1">u16_t</a> slipdev_poll </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">void&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Poll the SLIP device for an available packet.
<p>
This function will poll the SLIP device to see if a packet is available. It uses a buffer in which all avaliable bytes from the RS232 interface are read into. When a full packet has been read into the buffer, the packet is copied into the uip_buf buffer and the length of the packet is returned.<p>
<dl compact><dt><b>Returns:</b></dt><dd>The length of the packet placed in the uip_buf buffer, or zero if no packet is available. </dd></dl>
</td>
</tr>
</table>
<p>
Here is the call graph for this function:<p><center><img src="a00084_a9_cgraph.png" border="0" usemap="#a00084_a9_cgraph_map" alt=""></center>
<map name="a00084_a9_cgraph_map">
<area href="a00084.html#a5" shape="rect" coords="151,5,268,26" alt="">
</map>
<a name="a7" doxytag="slipdev.h::slipdev_send"></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void slipdev_send </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">void&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Send the packet in the uip_buf and uip_appdata buffers using the SLIP protocol.
<p>
The first 40 bytes of the packet (the IP and TCP headers) are read from the uip_buf buffer, and the following bytes (the application data) are read from the uip_appdata buffer. </td>
</tr>
</table>
<p>
Here is the call graph for this function:<p><center><img src="a00084_a8_cgraph.png" border="0" usemap="#a00084_a8_cgraph_map" alt=""></center>
<map name="a00084_a8_cgraph_map">
<area href="a00084.html#a4" shape="rect" coords="159,5,276,26" alt="">
</map>
<hr size="1"><address style="align: right;"><small>Generated on Tue Oct 7 15:51:45 2003 for uIP 0.9 by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.3 </small></address>
</body>
</html>