pengfei wu
/
ESP8266Program
For test
Diff: ESP8266.h
- Revision:
- 23:4cec7b9e3715
- Parent:
- 22:f5d148878815
- Child:
- 28:c25aff31dcc5
diff -r f5d148878815 -r 4cec7b9e3715 ESP8266.h --- a/ESP8266.h Wed Feb 04 09:55:33 2015 +0000 +++ b/ESP8266.h Wed Feb 04 10:06:39 2015 +0000 @@ -6,7 +6,6 @@ #include "ArduinoSerial.h" -//The way of encrypstion typedef enum { ESP8266_ECN_OPEN = 0, ESP8266_ECN_WEP = 1, @@ -27,8 +26,6 @@ } ESP8266WorkMode; -class ArduinoSerial; - class ESP8266 { public: @@ -36,21 +33,21 @@ bool begin(void); - //Initialize port - bool Initialize(uint8_t mode, String ssid, String pwd, uint8_t chl = 7, uint8_t ecn = ESP8266_ECN_WAP_WAP2_PSK); + //init port + bool init(uint8_t mode, String ssid, String pwd, uint8_t chl = 7, uint8_t ecn = ESP8266_ECN_WAP_WAP2_PSK); bool ipConfig(uint8_t type, String addr, int port, uint8_t mux = 0, uint8_t id = 0); //send data in sigle connection mode - bool Send(String str); + bool send(String str); //send data int multiple connection mode - bool Send(uint8_t id, String str); + bool send(uint8_t id, String str); - int ReceiveMessage(char *buf); + int recvData(char *buf); //reset the module - void Reset(void); + void reset(void); //set the working mode of module bool confMode(uint8_t mode); @@ -103,12 +100,12 @@ //set the parameter of server bool confServer(uint8_t mode, int port); - // get chlID - int get_chlID(void); + // get m_chl_id + int getChannelID(void); private: - ArduinoSerial esp_uart; - int chlID; + ArduinoSerial m_esp_uart; + int m_chl_id; }; #endif /* #ifndef __ESP8266_H__ */ \ No newline at end of file