【mbed OS5対応バージョン】データの保存、更新、取得ができるWebサービス「milkcocoa」に接続し、データのプッシュ、送信、取得ができるライブラリです。 https://mlkcca.com/

Dependents:   mbed-os-example-wifi-milkcocoa MilkcocoaOsSample_Eth MilkcocoaOsSample_ESP8266 MilkcocoaOsSample_Eth_DigitalIn

MQTTInterface.h

Committer:
jksoft
Date:
2018-03-26
Revision:
13:61e0cc093180
Parent:
0:0a2f634d3324

File content as of revision 13:61e0cc093180:


#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