mbed OS5に対応したMilkcocoaライブラリのテストバージョンです。

Fork of mbed-os-example-mbed5-blinky by mbed-os-examples

Committer:
jksoft
Date:
Tue Jan 24 13:41:36 2017 +0000
Revision:
24:6ba1245bf049
??????????

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jksoft 24:6ba1245bf049 1
jksoft 24:6ba1245bf049 2 #if !defined(MQTTETHERNET_H)
jksoft 24:6ba1245bf049 3 #define MQTTETHERNET_H
jksoft 24:6ba1245bf049 4
jksoft 24:6ba1245bf049 5 #include "MQTTmbed.h"
jksoft 24:6ba1245bf049 6 #include "EthernetInterface.h"
jksoft 24:6ba1245bf049 7 #include "MQTTSocket.h"
jksoft 24:6ba1245bf049 8
jksoft 24:6ba1245bf049 9 class MQTTEthernet : public MQTTSocket
jksoft 24:6ba1245bf049 10 {
jksoft 24:6ba1245bf049 11 public:
jksoft 24:6ba1245bf049 12 MQTTEthernet()
jksoft 24:6ba1245bf049 13 {
jksoft 24:6ba1245bf049 14 eth.init(); // Use DHCP
jksoft 24:6ba1245bf049 15 eth.connect();
jksoft 24:6ba1245bf049 16 }
jksoft 24:6ba1245bf049 17
jksoft 24:6ba1245bf049 18 EthernetInterface& getEth()
jksoft 24:6ba1245bf049 19 {
jksoft 24:6ba1245bf049 20 return eth;
jksoft 24:6ba1245bf049 21 }
jksoft 24:6ba1245bf049 22
jksoft 24:6ba1245bf049 23 void reconnect()
jksoft 24:6ba1245bf049 24 {
jksoft 24:6ba1245bf049 25 eth.connect(); // nothing I've tried actually works to reconnect
jksoft 24:6ba1245bf049 26 }
jksoft 24:6ba1245bf049 27
jksoft 24:6ba1245bf049 28 private:
jksoft 24:6ba1245bf049 29
jksoft 24:6ba1245bf049 30 EthernetInterface eth;
jksoft 24:6ba1245bf049 31
jksoft 24:6ba1245bf049 32 };
jksoft 24:6ba1245bf049 33
jksoft 24:6ba1245bf049 34
jksoft 24:6ba1245bf049 35 #endif