void wifiap_init(void)
{
// u8 netpro=1; //íøÂçÄ£ê½
u8 ipbuf[16] = "192.168.4.2"; //IP»o′æ
u8 *p;
atk_8266_send_cmd("AT+CWMODE=2","OK",20);
atk_8266_send_cmd("AT+RST","OK",20);
sprintf((char*)p,"AT+CWSAP=\"%s\",\"%s\",1,4",wifiap_ssid,wifiap_password); //ÅäÖÃÄ£¿éAPÄ£ê½ÎTÏß2Îêy
atk_8266_send_cmd(p,"OK",1000);
sprintf((char*)p,"AT+CIPSTART=\"UDP\",\"%s\",%s",ipbuf,(u8*)portnum); //ÅäÖÃÄ¿±êUDP·tÎñÆ÷
atk_8266_send_cmd("AT+CIPMUX=0","OK",100); //μ¥á′½óÄ£ê½
while(atk_8266_send_cmd(p,"OK",500));
}
void wifiap_send(void)
{
u8 *p;
sprintf((char*)p,"123456\r\n");//2aêÔêy¾Y
atk_8266_send_cmd("AT+CIPSEND=25","OK",200); //·¢ËíÖ¸¶¨3¤¶èμÄêy¾Y
delay_ms(200);
atk_8266_send_data(p,"OK",100); //·¢ËíÖ¸¶¨3¤¶èμÄêy¾Y
}
|