求大神們,看看,這個bc20主函式的例程什么意思
#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<RxCounter1;i++)
{
while((USART3->SR&0X40)==0);
USART3->DR = RxBuffer1[i];
}
}
void OPEN_BC20(void)
{
char *strx;
printf("AT\r\n");
delay_ms(300);
strx=strstr((const char*)RxBuffer,(const char*)"OK");//·μ??OK
printf("AT\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&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(7,625);
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();
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/108529.html
標籤:單片機/工控
上一篇:海思3516的影像縮放實作問題
