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

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

Milkcocoa/MQTTInterface.h

Committer:
jksoft
Date:
2017-01-24
Revision:
24:6ba1245bf049

File content as of revision 24:6ba1245bf049:


#if !defined(MQTTINTERFACE_H)
#define MQTTINTERFACE_H

#include "mbed.h"
#include "MQTTmbed.h"
#include "TCPSocket.h"
#include "MQTTSocket.h"

class MQTTInterface : public MQTTSocket
{
public:    
    MQTTInterface(NetworkInterface* nif)
    {
		_nif = nif;
		open(_nif);
    }
    
    NetworkInterface& getEth()
    {
        return *_nif;
    }
    
    void reconnect()
    {
		_nif->disconnect();
        _nif->connect();
    }
    
private:

    NetworkInterface* _nif;
    
};


#endif