Port to C027 (using AppShield and Ethernet)
Dependencies: C12832 EthernetInterface LM75B MMA7660 MQTT mbed-rtos mbed
Fork of IBMIoTClientEthernetExample by
MQTT/MQTTEthernet.h@8:80d49dd91542, 2014-10-01 (annotated)
- Committer:
- icraggs
- Date:
- Wed Oct 01 13:27:35 2014 +0000
- Revision:
- 8:80d49dd91542
- Parent:
- 6:37b6d0d56190
Remove conditional compilation for IBM IoT settings
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
samdanbury | 6:37b6d0d56190 | 1 | |
samdanbury | 6:37b6d0d56190 | 2 | #if !defined(MQTTETHERNET_H) |
samdanbury | 6:37b6d0d56190 | 3 | #define MQTTETHERNET_H |
samdanbury | 6:37b6d0d56190 | 4 | |
icraggs | 8:80d49dd91542 | 5 | #include "MQTTmbed.h" |
samdanbury | 6:37b6d0d56190 | 6 | #include "EthernetInterface.h" |
samdanbury | 6:37b6d0d56190 | 7 | #include "MQTTSocket.h" |
samdanbury | 6:37b6d0d56190 | 8 | |
samdanbury | 6:37b6d0d56190 | 9 | class MQTTEthernet : public MQTTSocket |
samdanbury | 6:37b6d0d56190 | 10 | { |
samdanbury | 6:37b6d0d56190 | 11 | public: |
samdanbury | 6:37b6d0d56190 | 12 | MQTTEthernet() |
samdanbury | 6:37b6d0d56190 | 13 | { |
samdanbury | 6:37b6d0d56190 | 14 | eth.init(); // Use DHCP |
samdanbury | 6:37b6d0d56190 | 15 | eth.connect(); |
samdanbury | 6:37b6d0d56190 | 16 | } |
samdanbury | 6:37b6d0d56190 | 17 | |
samdanbury | 6:37b6d0d56190 | 18 | EthernetInterface& getEth() |
samdanbury | 6:37b6d0d56190 | 19 | { |
samdanbury | 6:37b6d0d56190 | 20 | return eth; |
samdanbury | 6:37b6d0d56190 | 21 | } |
samdanbury | 6:37b6d0d56190 | 22 | |
samdanbury | 6:37b6d0d56190 | 23 | void reconnect() |
samdanbury | 6:37b6d0d56190 | 24 | { |
samdanbury | 6:37b6d0d56190 | 25 | eth.connect(); // nothing I've tried actually works to reconnect |
samdanbury | 6:37b6d0d56190 | 26 | } |
samdanbury | 6:37b6d0d56190 | 27 | |
samdanbury | 6:37b6d0d56190 | 28 | private: |
samdanbury | 6:37b6d0d56190 | 29 | |
samdanbury | 6:37b6d0d56190 | 30 | EthernetInterface eth; |
samdanbury | 6:37b6d0d56190 | 31 | |
samdanbury | 6:37b6d0d56190 | 32 | }; |
samdanbury | 6:37b6d0d56190 | 33 | |
samdanbury | 6:37b6d0d56190 | 34 | |
samdanbury | 6:37b6d0d56190 | 35 | #endif |