ATcmdSet.c
上传用户:xhjmsc
上传日期:2019-09-13
资源大小:389k
文件大小:17k
- #include "includeH.h"
- void SendATcmdModemSoftReset(void) //
- {
- unsigned char ucGeneralCnt=0,ATcmdSoftReset[]={0x41,0x54,0x5a,0x0d}; //add a ";" , a bug of Jan. 9,2007
- unsigned int wGeneralCount=0;
- gwTxNum=sizeof (ATcmdSoftReset);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=ATcmdSoftReset[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- while (wGeneralCount++<0xffff)
- {
- if ((aucUartRxBuf[gucUartRxCnt-2]==0x0d)&&(aucUartRxBuf[gucUartRxCnt-3]==0x4B))
- break;
-
- //if check time>min. 5S, Receive Fax error, progra should be quit
- //RxFaxTimeOverflowErrorQuit();
- }
- }
- void SendATcmd(void) //
- {
- unsigned char ucGeneralCnt=0,ATcmdPrefix[]={0x41,0x54,0x0d};
- gwTxNum=sizeof (ATcmdPrefix);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=ATcmdPrefix[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- void SendATcmdPrefix(void) //
- {
- unsigned char ucGeneralCnt=0,ATcmdPrefix[]={0x41,0x54};
- gwTxNum=sizeof (ATcmdPrefix);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=ATcmdPrefix[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- void SendATcmdSuffix(void) //
- {
- unsigned char ucGeneralCnt=0,ATcmdSuffix[]={0x0D};
- gwTxNum=sizeof (ATcmdSuffix);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=ATcmdSuffix[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
-
- void SendATconfigFS0(void)
- {
- unsigned char ucGeneralCnt=0,
- ATFS0[] = {0x41,0x54,0x26,0x46,0x53,0x30,0x3d,0x30,0x45,0x31,0x56,0x31,0x51,0x30,0X0d};
- gwTxNum=sizeof (ATFS0);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=ATFS0[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- void SendATconfigS7(void)
- {
- unsigned char ucGeneralCnt=0,
- //ATS7[] = {0x41,0x54,0x53,0x37,0x3d,0x36,0x30,0x26,0x44,0x33,0x26,
- //0x4b,0x34,0x5c,0x51,0x31,0x5c,0x4a,0x30,0x0d};//Ambient
- ATS7[] = {0x41,0x54,0x53,0x37,0x3d,0x36,0x30,0x26,0x44,0x33,0x26,0x4b,0x34,0x0d};//Conexant
- gwTxNum=sizeof (ATS7);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=ATS7[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- void SendATconfigX4M1(void)
- {
- unsigned char ucGeneralCnt=0,ATX4M1L0[] = {0x41,0x54,0x58,0x34,0x4d,0x31,0x4c,0x30,0x0d};
- gwTxNum= sizeof (ATX4M1L0);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=ATX4M1L0[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- void SendATconfigFE0EndofRX(void)
- {
- unsigned char ucGeneralCnt=0;
- //Ambient
- //unsigned char ATFE0EndofRX[] = {0x41,0x54,0x26, 0x46, 0x45, 0x31, 0x56, 0x31, 0x57, 0x32, 0x26, 0x44, 0x32, 0x26, 0x43,
- //0x31, 0x53, 0x30, 0x3d, 0x30, 0x2d, 0x43, 0x30, 0x0d}; // 26 is different of 2b a bug of Sep. 22
- //Conexant
- unsigned char ATFE0EndofRX[] = {0x41,0x54,0x26, 0x46, 0x45, 0x30, 0x56, 0x31, 0x26, 0x43, 0x31, 0x26, 0x44,
- 0x32, 0x53, 0x39, 0x35, 0x3d, 0x34, 0x37, 0x53, 0x30, 0x3d, 0x30,0x0d}; // 26 is different of 2b a bug of Sep. 22
- gwTxNum=sizeof (ATFE0EndofRX);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=ATFE0EndofRX[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- void SendATconfigS7RX(void)
- {
- unsigned char ucGeneralCnt=0;
- unsigned char ATS7RX[] = {0x41,0x54,0x53,0x37,0x3d,0x36,0x30,
- 0x4c,0x30,0x4d,0x31,0x26,0x4b,0x33,0x4e,0x31,0x58,0x34,0x0d};
- gwTxNum=sizeof (ATS7RX);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=ATS7RX[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- void SendATconfigS0RX(void)
- {
- unsigned char ucGeneralCnt=0,ATS0RX[]={0x41,0x54,0x53,0x30,0x3d,0x30,0x0d};
- gwTxNum=sizeof (ATS0RX);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=ATS0RX[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- void SendATcmdFCLASS0(void)
- {
- unsigned char ucGeneralCnt=0,
- FCLASS0[]={0x41,0x54,0x2b,0x46,0x43,0x4c,0x41,0x53,0x53,0x3d,0x30,0x0d};
- gwTxNum=sizeof (FCLASS0);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=FCLASS0[ucGeneralCnt];//a bug of Sep. 21 Fclass---->Fclass0
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- void SendATcmdFCLASS(void)
- {
- unsigned char ucGeneralCnt=0,
- FCLASS[]={0x41,0x54,0x2b,0x46,0x43,0x4c,0x41,0x53,0x53,0x3d,0x31,0x0d};
- gwTxNum=sizeof (FCLASS);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=FCLASS[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
-
- void SendATcmdDT(void) //ATDT
- {
- unsigned char ucGeneralCnt=0,
- DT[]={0x41,0x54,0x44,0x54,0x39,0x36,0x31,0x31,0x33,0x39,0x35,0x30,0x39,0x0d};
- gwTxNum=sizeof (DT);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=DT[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- void SendATcmdFRH(void) //AT+FRH
- {
- unsigned char ucGeneralCnt=0,
- FRH[]={0x41,0x54,0x2b,0x46,0x52,0x48,0x3d,0x33,0x0d};
- gwTxNum=sizeof (FRH);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=FRH[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- void SendATcmdFTH(void) //AT+FTH
- {
- unsigned char ucGeneralCnt=0,
- FTH[]={0x41,0x54,0x2b,0x46,0x54,0x48,0x3d,0x33,0x0d};
- gwTxNum=sizeof (FTH);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=FTH[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- /*
- void SendATdataFTHNSF(void) //DataFTHNSF
- {
- unsigned char ucGeneralCnt=0;
- unsigned char FTHNSF[] = {0xff,0x13,0x54,0x47,0x46,0x33,0x36,0x36,0x43,0x00,0x77,0x9C,0x10,0x03};
- gwTxNum=sizeof (FTHNSF);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=FTHNSF[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- */
- void SendATdataFTHTSI(void) //DataFTHTSI
- {
- unsigned char ucGeneralCnt=0,
- FTHTSI[]={0xff,0x03,0x43,0x78,0x61,0x46,0x10,0x03};
- gwTxNum=sizeof (FTHTSI);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=FTHTSI[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- void SendATdataFTHCSI(void) //DataFTHCSI
- {
- unsigned char ucGeneralCnt=0;//, a bug of Jan.5,2007
- //FTHCSI[]={0xff,0x03,0x40,0x20,0x20,0x20,0x20,0x20,
- //0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
- //0x36,0x33,0x38,0x10,0x03};
- gwTxNum = sizeof (FTHCSI);//gwTxNum=ucDataNum;
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=FTHCSI[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- void SendATdataFTHDIS(void) //DataFTHDIS
- {
- unsigned char ucGeneralCnt=0;
- //FTHDIS[]={0xff,0x13,0x80,0x00,0x46,0x78,0x10,0x03};//c6 T.4 2D
- gwTxNum=sizeof (FTHDIS);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=FTHDIS[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- /*
- void SendATdataFTHDCS(void) //DataFTHDCS
- {
- unsigned char ucGeneralCnt=0,
- FTHDCS[]={0xff,0x13,0x83,0x00,0x46,0x78,0x10,0x03};
- gwTxNum=sizeof (FTHDCS);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=FTHDCS[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- */
- void SendATdataFTHCFR(void) //DataFTHCFR
- {
- unsigned char ucGeneralCnt=0,
- FTHCFR[]={0xff,0x13,0x84,0x10,0x03};
- gwTxNum=sizeof (FTHCFR);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=FTHCFR[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- void SendATdataFTHMCF(void) //DataFTHMCF
- {
- unsigned char ucGeneralCnt=0,
- FTHMCF[]={0xff,0x13,0x8C,0x10,0x03};
- gwTxNum=sizeof (FTHMCF);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=FTHMCF[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- void SendATdataFTHEOP(void) //DataFTHEOP
- {
- unsigned char ucGeneralCnt=0,
- FTHEOP[]={0xff,0x13,0x2f,0x10,0x03};
- gwTxNum=sizeof (FTHEOP);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=FTHEOP[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- void SendATdataFTHDNC(void) //DataFTHDNC
- {
- unsigned char ucGeneralCnt=0,
- FTHDNC[]={0xff,0x13,0xfb,0x10,0x03};
- gwTxNum=sizeof (FTHDNC);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=FTHDNC[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- /*
- void SendATcmdFTS(void) //
- {
- unsigned char ucGeneralCnt=0,
- FTS[]={0x41,0x54,0x2b,0x46,0x54,0x53,0x3d,0x38,0x0d};
- gwTxNum=sizeof (FTS);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=FTS[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- */
- void SendATcmdFTM(void) //
- {
- unsigned char ucGeneralCnt=0,
- FTM[]={0x41,0x54,0x2b,0x46,0x54,0x4d,0x3d,0x39,0x36,0x0d};
- gwTxNum=sizeof (FTM);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=FTM[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- void SendATcmdFRM(void) //
- {
- unsigned char ucGeneralCnt=0,
- FRM[]={0x41,0x54,0x2b,0x46,0x52,0x4d,0x3d,0x39,0x36,0x0d};
- gwTxNum=sizeof (FRM);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=FRM[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- /*
- void SendATcmdFRM146(void) //
- {
- unsigned char ucGeneralCnt=0,
- FRM[]={0x41,0x54,0x2b,0x46,0x52,0x4d,0x3d,0x31,0x34,0x36,0x0d};
- gwTxNum=sizeof (FRM);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=FRM[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- void SendATdataTF(void) //Data DLE ETX
- {
- unsigned char ucGeneralCnt=0,
- TerminalFlag[]={0x10,0x03};
- gwTxNum=sizeof (TerminalFlag);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=TerminalFlag[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- */
- void SendATcmdH0(void) //H 0(0x30) Num 0
- {
- unsigned char ucGeneralCnt=0,
- H0[]={0x41,0x54,0x48,0x30,0x0d};//H0[]={0x41,0x54,0x48,0x4f,0x0d};
- gwTxNum=sizeof (H0);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=H0[ucGeneralCnt];
- }
-
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }
- void SendATcmdATA(void) //
- {
- unsigned char ucGeneralCnt=0,ATA[]={0x41,0x54,0x41,0x0d};
- gwTxNum=sizeof (ATA);
- gpucTxBufPnt=0;
-
- for(ucGeneralCnt=0;ucGeneralCnt<gwTxNum;ucGeneralCnt++)
- {
- aucUartTxBuf[ucGeneralCnt]=ATA[ucGeneralCnt];
- }
- TXBUF0=aucUartTxBuf[0];
- gucTxBufCnt=1;
- }