Definition in file AVRGSM_api.c.
#include <inavr.h>
#include "AVRGSM_com.h"
#include "AVRGSM_zip.h"
#include "AVRGSM_header.h"
#include "AVRGSM_tools.h"
#include "AVRGSM_api.h"
Include dependency graph for AVRGSM_api.c:
Go to the source code of this file.
Functions | |
int | API_check_acknowledge (void) |
Function prototype. | |
int | API_deletemsg (int index) |
Delete a message from a given index. | |
int | API_modem_init (void) |
Used to setup the connected GSM modem. | |
int | API_readmsg (int ind) |
Read message from a given index. | |
int | API_sendmsg (unsigned char *msg) |
Send message. | |
Variables | |
const unsigned char __flash | AT_CMGD [] = "AT+CMGD=" |
Delete message at index. | |
const unsigned char __flash | AT_CMGR [] = "AT+CMGR=" |
Read from index. | |
const unsigned char __flash | AT_CMGS [] = "AT+CMGS=" |
Send mmessage. | |
const unsigned char __flash | AT_CNMI [] = "AT+CNMI=1,1,,,1\r\n" |
Identification of new sms. | |
const unsigned char __flash | AT_CPMS [] = "AT+CPMS=\"ME\",\"ME\",\"ME\"\r\n" |
Preferred storage. | |
const unsigned char __flash | ATE0 [] = "ATE0\r\n" |
Echo off. | |
const unsigned char __flash | CRLF [] = "\r\n" |
Carrige return Line feed. | |
unsigned char | msgbuff [161] |
Message buffer for coded and decoded messages. | |
int | rx_ack |
Extern flag from AVRSMS_com.c. |
|
Function prototype. This function is very important. It checks if an acknowledge has been received from the phone. A counting loop is also included to avoid waiting for a acknowledge that never arrives.
Local variables Definition at line 278 of file AVRGSM_api.c. References COM_rx_off(), COM_rx_reset(), and rx_ack. Referenced by API_deletemsg(), API_modem_init(), API_readmsg(), and API_sendmsg().
Here is the call graph for this function: ![]() |
|
Delete a message from a given index. This function will use the "AT+CMGD" command to delete the message @ index
Definition at line 125 of file AVRGSM_api.c. References API_check_acknowledge(), AT_CMGD, COM_put_integer(), COM_putsf(), COM_rx_on(), COM_rx_reset(), COM_setSearchString(), CRLF, and OK_. Referenced by ST_delete_msg().
Here is the call graph for this function: ![]() |
|
Used to setup the connected GSM modem. This function will send AT-Commands to the phone. These commands will setup the phone to: -Use correct storage, AT+CPMS -Indicate new message, AT+CNMI -Turn echo off, ATE0
Definition at line 73 of file AVRGSM_api.c. References API_check_acknowledge(), AT_CNMI, AT_CPMS, ATE0, COM_putsf(), COM_rx_on(), COM_rx_reset(), COM_setSearchString(), and OK_. Referenced by ST_init_phone().
Here is the call graph for this function: ![]() |
|
Read message from a given index. This function is used to read a newly arrived message from a given index. The message is decoded, and stored in the msgbuff.
Local variables Definition at line 232 of file AVRGSM_api.c. References API_check_acknowledge(), AT_CMGR, COM_put_integer(), COM_putsf(), COM_rx_on(), COM_rx_reset(), COM_setSearchString(), CRLF, msgbuff, OK_, TOOLS__decodeCMGR(), and ZIP_decompress(). Referenced by ST_read().
Here is the call graph for this function: ![]() |
|
Send message. This function will take your user defined message, encode this text, add the header information found in AVRSMS_header.h. If successful, the message will be forwarded to the connected GSM modem
Local variables Definition at line 160 of file AVRGSM_api.c. References API_check_acknowledge(), AT_CMGS, COM_put_integer(), COM_putchar(), COM_puts(), COM_putsf(), COM_rx_on(), COM_rx_reset(), COM_setSearchString(), CRLF, HEADER_LEN, msgbuff, OK_, PDU_HEADER, READY_, ZIP_compress(), and ZIP_itoh(). Referenced by ST_send().
Here is the call graph for this function: ![]() |
|
Delete message at index.
Definition at line 48 of file AVRGSM_api.c. Referenced by API_deletemsg(). |
|
Read from index.
Definition at line 49 of file AVRGSM_api.c. Referenced by API_readmsg(). |
|
Send mmessage.
Definition at line 50 of file AVRGSM_api.c. Referenced by API_sendmsg(). |
|
Identification of new sms.
Definition at line 46 of file AVRGSM_api.c. Referenced by API_modem_init(). |
|
Preferred storage.
Definition at line 47 of file AVRGSM_api.c. Referenced by API_modem_init(). |
|
Echo off.
Definition at line 45 of file AVRGSM_api.c. Referenced by API_modem_init(). |
|
Carrige return Line feed.
Definition at line 51 of file AVRGSM_api.c. Referenced by API_deletemsg(), API_readmsg(), and API_sendmsg(). |
|
Message buffer for coded and decoded messages.
Definition at line 42 of file AVRGSM_api.c. Referenced by API_readmsg(), API_sendmsg(), and ST_read(). |
|
Extern flag from AVRSMS_com.c.
Definition at line 39 of file AVRGSM_api.c. Referenced by API_check_acknowledge(), COM_rx_reset(), main(), and USART0_RX_interrupt(). |