test

Dependents:   wifigpslcd

Fork of ESP8266 by Antonio Quevedo

Revision:
3:ba8baa31f906
Parent:
2:77388e8f0697
--- a/ESP8266.cpp	Sun Dec 28 21:58:49 2014 +0000
+++ b/ESP8266.cpp	Sat May 23 03:54:26 2015 +0000
@@ -1,5 +1,5 @@
 #include "ESP8266.h"
-
+#include <string.h>
 // Constructor
 ESP8266::ESP8266(PinName tx, PinName rx, int br) : comm(tx, rx) {
     comm.baud(br);
@@ -165,4 +165,11 @@
     char rs[20];
     strcpy(rs, "AT+CIPSERVER=0");
     SendCMD(rs);
+}
+void ESP8266::setAP(char * ssid, char * pass, int channel) {
+    char rs[100];
+    strcpy(rs, "AT+CIPMUX=1");
+    SendCMD(rs);
+    sprintf(rs,"AT+CWSAP=\"%s\",\"%s\",%d,4",ssid,pass,channel);
+    SendCMD(rs);
 }
\ No newline at end of file