Add function to check if socket is connected.

Dependencies:   FP MQTTPacket

Fork of MQTT by Christoph W.

MQTTEthernet.h

Committer:
walser
Date:
2016-02-25
Revision:
47:f62dc079fc86
Parent:
43:21da1f744243

File content as of revision 47:f62dc079fc86:


#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