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

ATAVRBFLY_FILES/STATE_functions.h File Reference


Detailed Description

Atmel Corporation

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

Definition in file STATE_functions.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

char ST_delete_msg (char input)
 This function will delete the newly arrived message.

char ST_get_index (char input)
 This function extract the storage location of the newly arrived message.

char ST_init_phone (char input)
 Init phone.

char ST_read (char input)
 This function will read message at memory location index.

char ST_send (char input)
 This function will send a user defined text string.


Function Documentation

char ST_delete_msg char  input  ) 
 

This function will delete the newly arrived message.

State function

Parameters:
input Dummy input...joypad value.
Return values:
char Next state.

Definition at line 118 of file STATE_functions.c.

References API_deletemsg(), CMTI_, COM_rx_on(), COM_rx_reset(), COM_setSearchString(), index, and ST_AVR_READY.

00119 { 00120 API_deletemsg( index ); 00121 00122 index = 0; 00123 00124 COM_rx_reset( ); //Reset receive buffer after API_phoneinit() 00125 COM_setSearchString( CMTI_ ); //Wait for "+CMTI: ,Storage,index\r\n" 00126 COM_rx_on( ); //Ready to receive 00127 00128 return ST_AVR_READY; 00129 }

Here is the call graph for this function:

char ST_get_index char  input  ) 
 

This function extract the storage location of the newly arrived message.

State function

Parameters:
input Dummy input...joypad value.
Return values:
char Next state.

Definition at line 141 of file STATE_functions.c.

References index, ST_AVR_NEW_SMS, and TOOLS_decodeCMTI().

Referenced by main().

00142 { 00143 00144 index = TOOLS_decodeCMTI( ); //Find index 00145 return ST_AVR_NEW_SMS; 00146 }

Here is the call graph for this function:

char ST_init_phone char  input  ) 
 

Init phone.

State function

Parameters:
input Dummy input...joypad value.
Return values:
char Next state.

Definition at line 51 of file STATE_functions.c.

References API_modem_init(), CMTI_, COM_rx_on(), COM_rx_reset(), COM_setSearchString(), ST_AVR_NO_ECHO, ST_AVR_READY, ST_AVR_WRONG_OPTION, and ST_AVR_WRONG_STORAGE.

00052 { 00053 //Local variables 00054 int result; 00055 00056 //Initialization 00057 result = 0; 00058 00059 result = API_modem_init(); //Setup phone 00060 00061 if( result == 1 ) 00062 { 00063 00064 COM_rx_reset( ); //Reset receive buffer after API_phoneinit() 00065 COM_setSearchString( CMTI_ ); //Wait for "+CMTI: ,Storage,index\r\n" 00066 COM_rx_on( ); //Ready to receive 00067 00068 return ST_AVR_READY; 00069 } 00070 00071 else if( result == 0 ) 00072 { 00073 00074 return ST_AVR_NO_ECHO; //Could not set echo off 00075 } 00076 00077 else if( result == -1 ) 00078 { 00079 00080 return ST_AVR_WRONG_STORAGE; //No such storage locations 00081 } 00082 00083 else 00084 { 00085 00086 return ST_AVR_WRONG_OPTION; //The chosen forward option is not valid for this GSM modem 00087 } 00088 }

Here is the call graph for this function:

char ST_read char  input  ) 
 

This function will read message at memory location index.

State function

Parameters:
input Dummy input...joypad value.
Return values:
char Next state.

Definition at line 158 of file STATE_functions.c.

References API_readmsg(), COM_rx_on(), COM_rx_reset(), COM_setSearchString(), index, LCD_puts(), msgbuff, and ST_AVR_DISPLAY.

00159 { 00160 00161 API_readmsg( index ); //Read new message, and decode 00162 LCD_puts((char *)msgbuff,1); //Cast pointer 00163 00164 COM_setSearchString( 1 ); //Set searchstring to "+CMTI: " again, wait for new message. 00165 COM_rx_reset( ); //Reset buffer and interrupt routine 00166 COM_rx_on( ); //Ready to receive*/ 00167 00168 return ST_AVR_DISPLAY; 00169 }

Here is the call graph for this function:

char ST_send char  input  ) 
 

This function will send a user defined text string.

State function

Parameters:
input Dummy input...joypad value.
Return values:
char Next state.

Definition at line 100 of file STATE_functions.c.

References API_sendmsg(), and ST_AVR_READY.

00101 { 00102 00103 API_sendmsg("ATMEL AVR"); 00104 00105 return ST_AVR_READY; 00106 }

Here is the call graph for this function:


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