📄 avrgsm__zip_8h.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>AVR323 Interfacing GSM modems: AVRGSM_zip.h File Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.7 --><div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a></div><h1>AVRGSM_FILES/AVRGSM_zip.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>Atmel Corporation<p><ul><li>File : AVR_zip.h</li><li>Compiler : IAR EWAAVR 4.11a</li></ul><p><ul><li>Support mail : <a href="mailto:avr@atmel.com">avr@atmel.com</a></li></ul><p><ul><li>Supported devices : All devices with a UART/USART can be used. The example is written for ATmega128</li></ul><p><ul><li>AppNote : AVR323 - Interfacing GSM modems</li></ul><p><ul><li>Description : Example of how to use AT-Commands to control a GSM modem</li></ul><p><dl compact><dt><b>Revision</b></dt><dd>1.2 </dd></dl><dl compact><dt><b>Date</b></dt><dd>Wednesday, January 26, 2005 10:43:44 UTC </dd></dl><p>Definition in file <a class="el" href="AVRGSM__zip_8h-source.html">AVRGSM_zip.h</a>.<p><p>This graph shows which files directly or indirectly include this file:<p><center><img src="AVRGSM__zip_8h__dep__incl.png" border="0" usemap="#AVRGSM_zip.hdep_map" alt="Included by dependency graph"></center><map name="AVRGSM_zip.hdep_map"><area href="AVRGSM__api_8c.html" shape="rect" coords="7,7,121,34" alt=""><area href="AVRGSM__tools_8c.html" shape="rect" coords="145,7,271,34" alt=""><area href="AVRGSM__zip_8c.html" shape="rect" coords="295,7,409,34" alt=""></map><p><a href="AVRGSM__zip_8h-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0><tr><td></td></tr><tr><td colspan=2><br><h2>Defines</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="AVRGSM__zip_8h.html#a2">hex_nmbr</a> "0123456789ABCDEF"</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Flash string container, look up table. <a href="#a2"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="AVRGSM__zip_8h.html#a0">MESSAGE_ENCODED_SIZE</a> 70</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Size of SMS payload. <a href="#a0"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="AVRGSM__zip_8h.html#a1">MESSAGE_LENGTH</a> 80</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Max allowed text in SMS. <a href="#a1"></a><br><br></td></tr><tr><td colspan=2><br><h2>Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="AVRGSM__zip_8h.html#a5">ZIP_atoi</a> (unsigned char *a)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Converting ascii char string to int. <a href="#a5"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="AVRGSM__zip_8h.html#a3">ZIP_compress</a> (unsigned char *in, unsigned char *discarded, unsigned char ret[])</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">ZIP_compress will take a user defined text code it into the PDU format. <a href="#a3"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="AVRGSM__zip_8h.html#a4">ZIP_decompress</a> (unsigned char *compressed, unsigned char *decompressed)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">ZIP_decompress will decode a message in PDU format into a readable string. <a href="#a4"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="AVRGSM__zip_8h.html#a6">ZIP_htoi</a> (unsigned char hex)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Convert hex to int. <a href="#a6"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="AVRGSM__zip_8h.html#a7">ZIP_itoh</a> (int n, unsigned char *ret)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Converting int [0->255] to hex value. <a href="#a7"></a><br><br></td></tr></table><hr><h2>Define Documentation</h2><a class="anchor" name="a2" doxytag="AVRGSM_zip.h::hex_nmbr" ></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"> #define hex_nmbr "0123456789ABCDEF" </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Flash string container, look up table. <p><p>Definition at line <a class="el" href="AVRGSM__zip_8h-source.html#l00027">27</a> of file <a class="el" href="AVRGSM__zip_8h-source.html">AVRGSM_zip.h</a>. </td> </tr></table><a class="anchor" name="a0" doxytag="AVRGSM_zip.h::MESSAGE_ENCODED_SIZE" ></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"> #define MESSAGE_ENCODED_SIZE 70 </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Size of SMS payload. <p><p>Definition at line <a class="el" href="AVRGSM__zip_8h-source.html#l00025">25</a> of file <a class="el" href="AVRGSM__zip_8h-source.html">AVRGSM_zip.h</a>. </td> </tr></table><a class="anchor" name="a1" doxytag="AVRGSM_zip.h::MESSAGE_LENGTH" ></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"> #define MESSAGE_LENGTH 80 </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Max allowed text in SMS. <p><p>Definition at line <a class="el" href="AVRGSM__zip_8h-source.html#l00026">26</a> of file <a class="el" href="AVRGSM__zip_8h-source.html">AVRGSM_zip.h</a>.<p>Referenced by <a class="el" href="AVRGSM__zip_8c-source.html#l00040">ZIP_compress()</a>. </td> </tr></table><hr><h2>Function Documentation</h2><a class="anchor" name="a5" doxytag="AVRGSM_zip.h::ZIP_atoi" ></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"> int ZIP_atoi </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">unsigned char * </td> <td class="mdname1" valign="top" nowrap> <em>a</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Converting ascii char string to int. <p><dl compact><dt><b>Note:</b></dt><dd>Will return value as int.</dd></dl><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>*a</em> </td><td>ASCII string to be converted. </td></tr> <tr><td></td><td valign=top><em>n</em> </td><td>Return Integer.</td></tr> </table></dl><dl compact><dt><b>Return values:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>int</em> </td><td>integer value </td></tr> </table></dl><p>Definition at line <a class="el" href="AVRGSM__zip_8c-source.html#l00140">140</a> of file <a class="el" href="AVRGSM__zip_8c-source.html">AVRGSM_zip.c</a>.<p>Referenced by <a class="el" href="AVRGSM__tools_8c-source.html#l00039">TOOLS_decodeCMTI()</a>.<p><pre class="fragment"><div>00141 {00142 00143 <span class="keywordtype">int</span> i, n; <span class="comment">//Help variables</span>00144 00145 n = 0; <span class="comment">//Init</span>00146 00147 <span class="keywordflow">for</span>( i=0; ( a[ i ] >= <span class="charliteral">'0'</span> ) && ( a[ i ] <= <span class="charliteral">'9'</span> ); ++i ) <span class="comment">//Running through string converting from ascii to integer</span>00148 {00149 n = 10*n + ( a[ i ] - <span class="charliteral">'0'</span> ); <span class="comment">//Adding value to return Integer</span>00150 }00151 00152 <span class="keywordflow">return</span> n;00153 }</div></pre> </td> </tr></table><a class="anchor" name="a3" doxytag="AVRGSM_zip.h::ZIP_compress" ></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"> int ZIP_compress </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">unsigned char * </td> <td class="mdname" nowrap> <em>in</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap>unsigned char * </td> <td class="mdname" nowrap> <em>discarded</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td></td> <td class="md" nowrap>unsigned char </td> <td class="mdname" nowrap> <em>ret</em>[]</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>ZIP_compress will take a user defined text code it into the PDU format. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>*in</em> </td><td>Pointer to user defined text </td></tr> <tr><td></td><td valign=top><em>*discarded</em> </td><td>Number of discarded chars, used later to calculate message length </td></tr> <tr><td></td><td valign=top><em>ret[]</em> </td><td>return array for the encoded message</td></tr> </table></dl><dl compact><dt><b>Return values:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>i</em> </td><td>Length of read string</td></tr> </table></dl><p>Local variables <p>Definition at line <a class="el" href="AVRGSM__zip_8c-source.html#l00040">40</a> of file <a class="el" href="AVRGSM__zip_8c-source.html">AVRGSM_zip.c</a>.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -