mbed OS5に対応したMilkcocoaライブラリのテストバージョンです。
Fork of mbed-os-example-mbed5-blinky by
Diff: Milkcocoa/MQTT/MQTTEthernet.h
- Revision:
- 24:6ba1245bf049
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Milkcocoa/MQTT/MQTTEthernet.h Tue Jan 24 13:41:36 2017 +0000 @@ -0,0 +1,35 @@ + +#if !defined(MQTTETHERNET_H) +#define MQTTETHERNET_H + +#include "MQTTmbed.h" +#include "EthernetInterface.h" +#include "MQTTSocket.h" + +class MQTTEthernet : public MQTTSocket +{ +public: + MQTTEthernet() + { + eth.init(); // Use DHCP + eth.connect(); + } + + EthernetInterface& getEth() + { + return eth; + } + + void reconnect() + { + eth.connect(); // nothing I've tried actually works to reconnect + } + +private: + + EthernetInterface eth; + +}; + + +#endif