附录一 发送端程序清单
“Moderm.h”文件:
#define rBufLen 200
uint16 RecBufferLen_Uart1;//串口接收的数据总数
uint8 RecBuffer_Uart1[rBufLen];
uint8 backduanxin[100];//短信缓冲
uint8 phone_num[12]="13120832861";//电话号码
uint8 sms_pdu[]="at+cmgs=000";
uint8 pduhead[]="0011000D91683188464708F600080108";
uint8 password[]="5BC67801FF1A";//密码
/*a t + c m g s =
"*/
uint8 sms_txt_head[]={0x61,0x74,0x2b,0x63,0x6d,0x67,0x73,0x3d,0x22,
/* 1 3 1 2 0 8 3 7 5 9 5 " */
0x31,0x33,0x38,0x31,0x38,0x36,0x35,0x33,0x39,0x34,0x39,0x22,0x0d};
uint8 sms_txt_body[100];
uint8 sms_txt_test[]="hello world";
/****************************************************************************
* 名称:
* 功能:
* 入口参数:
* 出口参数:
****************************************************************************/
void SendChar_Uart1(unsigned char ch)
{
U1THR = ch;
while((U1LSR&0x40)==0);
}
/****************************************************************************
* 名称:
* 功能:
* 入口参数:
* 出口参数:
****************************************************************************/
void SendStr_Uart1(unsigned char *str,unsigned int ilen)
{
unsigned int i;