stm32l432 esp8266,MQ13,MQ7,SSD1306,SD1303,HC04
Dependents: Nucleo_SSD1306_DS1302_ESP8266_AM2320_BME280
Fork of ESP8266 by
Diff: ESP8266.cpp
- Revision:
- 1:399414d48048
- Parent:
- 0:e58f27687450
- Child:
- 2:77388e8f0697
diff -r e58f27687450 -r 399414d48048 ESP8266.cpp --- a/ESP8266.cpp Tue Dec 16 01:08:47 2014 +0000 +++ b/ESP8266.cpp Wed Dec 17 13:54:34 2014 +0000 @@ -87,4 +87,34 @@ strcpy(cmd, "AT+CIFSR"); SendCMD(cmd); RcvReply(ip, 2000); +} + +//Defines wifi mode; Parameter: mode; 1= STA, 2= AP, 3=both +void ESP8266::SetMode(char mode) { + char cmd[15]; + strcpy(cmd, "AT+CWMODE="); + mode = mode + 0x30; // Converts number into corresponding ASCII character + AddChar(cmd, mode); // Completes command string + SendCMD(cmd); +} + +// Quits the AP +void ESP8266::Quit(void) { + char cmd[15]; + strcpy(cmd, "AT+CWQAP"); + SendCMD(cmd); +} + +// Sets single connection +void ESP8266::SetSingle(void) { + char cmd[15]; + strcpy(cmd, "AT+CIPMUX=0"); + SendCMD(cmd); +} + +// Sets multiple connection +void ESP8266::SetMultiple(void) { + char rs[15]; + strcpy(rs, "AT+CIPMUX=1"); + SendCMD(rs); } \ No newline at end of file