Home > other >  Bc20 main function
Bc20 main function

Time:10-03

The great god, see, this bc20 what meaning the main function of routine


# include "led. H"
# include "delay. H"
# include "sys. H"
# include "usart. H"
# include "math. H"
# include "stdio.h"
# include "stm32f10x_flash. H"
# include "stdlib. H"
# include "string. H"
# include "WDG. H"
# include "timer. H"
# include "stm32f10x_tim. H"
# include "bc20. H"
Extern char RxBuffer [100], RxCounter;
Extern unsigned char uart1_getok;
Extern char RxCounter1, RxBuffer1 [100];
Extern unsigned char Timeout, restflag;


Void Send_ATcmd (void) char I;
for(i=0; I{
While ((USART3 - & gt; SR& 0 x40)==0);
USART3 - & gt; DR=RxBuffer1 [I];
}
}

Void OPEN_BC20 (void)
{
Char * STRX;

Printf (" ats \ r \ n ");
Delay_ms (300);
STRX=STRSTR ((const char *) RxBuffer, (const char *) "OK");//mu???? OK
Printf (" ats \ r \ n ");
Delay_ms (300);
STRX=STRSTR ((const char *) RxBuffer, (const char *) "OK");

IWDG_Feed ();
If (STRX==NULL)
{
PWRKEY=1;
Delay_ms (300);
Delay_ms (300);
Delay_ms (300);
Delay_ms (300);
PWRKEY=0;
IWDG_Feed ();
}
Printf (" ATE0 & amp; W \ r \ n ");
Delay_ms (300);
LED1=0;
IWDG_Feed ();
}

Int main (void)
{
Delay_init ();
NVIC_Configuration ();
LED_Init ();
BC20CTR_Init ();
Uart_init (115200);
Uart2_init (115200);
IWDG_Init (7625);
OPEN_BC20 ();
BC20_Init ();
BC20_ConTCP ();
BC20_CreateTCPSokcet ();
While (1)
{
BC20_Senddata (" 8 ", "12345678");
Delay_ms (1000);
LED2=! LED2;
RxCounter=0;
BC20_RECTCPData ();
IWDG_Feed ();
}
}
  • Related