1 ret = ESP8266_Cmd ( "AT+RST", "OK", "ready", ); //复位
ret = ESP8266_Cmd ( "AT", "OK", NULL, );//测试AT启动
ret = ESP8266_Cmd ( "AT+CWMODE=3", "OK", NULL, );//选择WIFI应用模式softAP+station
//ret = ESP8266_Cmd ( "AT+CWLAP", "OK", NULL, 2000 );//列出当前可用的接入点
ret = ESP8266_Cmd ( "AT+CWJAP=\"macUser_ESP8266_ApSsid\",\"macUser_ESP8266_ApPwd\"", "OK", NULL, );
//ret = ESP8266_Cmd ( "AT+CWJAP=\"BEILIN\",\"BEILIN12345\"", "OK", NULL, 5000 );//连接路由
//ret = ESP8266_Cmd ( "AT+CIFSR", "OK", NULL, 2000 ); ret = ESP8266_Cmd ( "AT+CIPSTART=\"TCP\",\"192.168.1.126\",8081", "OK", NULL, );//protocol IP port
ret = ESP8266_Cmd ("AT+CIPMODE=1","OK",NULL,);//使能透传模式
ESP8266_Cmd ( "AT+CIPSEND", "OK",">", );//进入透传
进如透传之后,接下来就可以发送数据了,发送+++退出透传模式。