![](/media/cache/profiles/5f14615696649541a025d3d0f8e0447f.jpg.50x50_q85.jpg)
mbed OS5に対応したMilkcocoaライブラリのテストバージョンです。
Fork of mbed-os-example-mbed5-blinky by
Diff: Milkcocoa/MQTT/MQTTEthernet.h
- Revision:
- 24:6ba1245bf049
diff -r f732f7a1db63 -r 6ba1245bf049 Milkcocoa/MQTT/MQTTEthernet.h --- /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