Keegan Hu
/
仓库
init
Fork of iot_example by
Diff: esp8266.h
- Revision:
- 0:63af4719467f
- Child:
- 1:3b487c4813a2
diff -r 000000000000 -r 63af4719467f esp8266.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/esp8266.h Wed Oct 11 08:40:04 2017 +0000 @@ -0,0 +1,21 @@ + + +class Esp8266 { //声明一个类 + bool network_start; + bool mqtt_start; +public: + // 0--client mode 1--host mode + Esp8266(int mode = 0); + + // 通用 + bool reset(); + + // 连接模式 + bool connect_wifi(); + bool weblogin(); + bool connect_mqtt_broker(char *ip); + + bool publish(char *topic, char *data, int size = -1); + bool subscribe_poll(char *topic, char *data, int size = -1); + // 热点模式 +}; \ No newline at end of file