Main Page | Data Structures | File List | Data Fields | Globals

AVRGSM_FILES/AVRGSM_tools.h File Reference


Detailed Description

Atmel Corporation

Revision
1.2
Date
Wednesday, January 26, 2005 10:43:44 UTC

Definition in file AVRGSM_tools.h.

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Functions

unsigned char * TOOLS__decodeCMGR (int index)
 Get start of compressed string.

int TOOLS_decodeCMTI (void)
 Used to get index of newly received message.


Function Documentation

unsigned char* TOOLS__decodeCMGR int  index  ) 
 

Get start of compressed string.

When a new message has been read from a given index, thsi function
will run through it, and find start of the encoded user text.

Parameters:
void 
Return values:
in_handle if error in_handle points to '', else it will point to the string ready for decompression

Local variables

Definition at line 80 of file AVRGSM_tools.c.

References COM_gets(), COM_trim(), and ZIP_htoi().

Referenced by API_readmsg().

00081 { 00082 00084 unsigned char *in_handle; 00085 int i, len, field_length; 00086 00087 len = COM_trim(); //Trim off OK\r\n 00088 in_handle = COM_gets( ); //Get rx_buff 00089 00090 in_handle += 2; //Skip first \r\n 00091 00092 for( i = 0; ( i < len ) && ( *in_handle++ != '\n' ); i++) //Loop until we get '\n' 00093 { 00094 ; 00095 } 00096 00097 //Error 00098 if( i >= len ) 00099 { 00100 in_handle = '\0'; 00101 return in_handle; 00102 } 00103 00104 //Everything OK 00105 else 00106 { 00107 00108 field_length = 16 * ZIP_htoi( *in_handle++ ); 00109 field_length = ZIP_htoi( *in_handle++ ); 00110 00111 in_handle += 2*field_length + 2; //Skip Service center nmbr 00112 00113 //Find length of sender address 00114 field_length = 16 * ZIP_htoi( *in_handle++ ); 00115 field_length = ZIP_htoi( *in_handle++ ); 00116 00117 if( field_length%2 ) 00118 { 00119 field_length++; //Check for trailing F 00120 } 00121 00122 in_handle += 2 + field_length; //Skip fields in header 00123 00124 in_handle += 14 + 4; //Skip more fields...TP-PID, TP-DCS and TP-SCTS 00125 00126 return ( in_handle + 2 ); //Return correct pointer 00127 } 00128 }

Here is the call graph for this function:

int TOOLS_decodeCMTI void   ) 
 

Used to get index of newly received message.

Will search through the receive buffer found in AVRSMS_com.c, until a
',' is found. If this charcter is found in the buffer, the next parameter will
be the new message index.

Parameters:
void 
Return values:
i index of new message
0 Error with echo off

Local variables

Definition at line 39 of file AVRGSM_tools.c.

References COM_gets(), COM_trim(), and ZIP_atoi().

Referenced by ST_get_index().

00040 { 00041 00043 unsigned char *temp; 00044 int length, i; 00045 00046 //init 00047 length = 0; 00048 00049 length = COM_trim( ); //Trim off trailing OK\r\n 00050 temp = COM_gets( ); //Get rx_buff 00051 00052 for( i = 0; ( i < length ) && ( *temp++ != ',' ); i++) //Loop until we get a ',' 00053 { 00054 ; 00055 } 00056 00057 //Error 00058 if( i >= length ) 00059 { 00060 return 0; 00061 } 00062 00063 else 00064 { 00065 return ZIP_atoi( temp ); //Convert ascii int to integer 00066 } 00067 }

Here is the call graph for this function:


Generated on Tue Nov 1 16:21:41 2005 for AVR323 Interfacing GSM modems by doxygen 1.3.7