YX ZHANG
/
iot_example
IoT demo
Fork of my_example_esp8266 by
esp8266.h@0:63af4719467f, 2017-10-11 (annotated)
- Committer:
- brainliang
- Date:
- Wed Oct 11 08:40:04 2017 +0000
- Revision:
- 0:63af4719467f
- Child:
- 1:3b487c4813a2
esp8266
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
brainliang | 0:63af4719467f | 1 | |
brainliang | 0:63af4719467f | 2 | |
brainliang | 0:63af4719467f | 3 | class Esp8266 { //声明一个类 |
brainliang | 0:63af4719467f | 4 | bool network_start; |
brainliang | 0:63af4719467f | 5 | bool mqtt_start; |
brainliang | 0:63af4719467f | 6 | public: |
brainliang | 0:63af4719467f | 7 | // 0--client mode 1--host mode |
brainliang | 0:63af4719467f | 8 | Esp8266(int mode = 0); |
brainliang | 0:63af4719467f | 9 | |
brainliang | 0:63af4719467f | 10 | // 通用 |
brainliang | 0:63af4719467f | 11 | bool reset(); |
brainliang | 0:63af4719467f | 12 | |
brainliang | 0:63af4719467f | 13 | // 连接模式 |
brainliang | 0:63af4719467f | 14 | bool connect_wifi(); |
brainliang | 0:63af4719467f | 15 | bool weblogin(); |
brainliang | 0:63af4719467f | 16 | bool connect_mqtt_broker(char *ip); |
brainliang | 0:63af4719467f | 17 | |
brainliang | 0:63af4719467f | 18 | bool publish(char *topic, char *data, int size = -1); |
brainliang | 0:63af4719467f | 19 | bool subscribe_poll(char *topic, char *data, int size = -1); |
brainliang | 0:63af4719467f | 20 | // 热点模式 |
brainliang | 0:63af4719467f | 21 | }; |