for WIZwiki-W7500 board
Dependents: IBMIoTClientEthernetExample_WIZnet
Fork of MQTT by
MQTTEthernet.h
- Committer:
- hkjung
- Date:
- 2015-09-15
- Revision:
- 48:1de971b62543
- Parent:
- 47:0f7cec2a7058
- Child:
- 49:66f37eda441b
File content as of revision 48:1de971b62543:
#if !defined(MQTTETHERNET_H) #define MQTTETHERNET_H #include "MQTTmbed.h" #include "EthernetInterface.h" #include "MQTTSocket.h" uint8_t mac_addr[6] = {0x00, 0x08, 0xDC, 0x1D, 0x69, 0xF3}; //uint8_t mac_addr[6] = {0x00, 0x02, 0xf7, 0xf2, 0x05, 0x00}; //const char * ip_addr = "222.98.173.213"; //const char * gw_addr = "222.98.173.254"; //const char * snmask = "255.255.255.192"; class MQTTEthernet : public MQTTSocket { public: MQTTEthernet() { wait(1); this->createSocket(); //eth.init(mac_addr,ip_addr,snmask,gw_addr); // Use Static IP eth.init(mac_addr); // Use DHCP eth.connect(); } EthernetInterface& getEth() { return eth; } void reconnect() { eth.connect(); // nothing I've tried actually works to reconnect } private: EthernetInterface eth; }; #endif