Modified MQTT for Mbed OS.

Dependencies:   FP MQTTPacket

Dependents:   mbed-os-mqtt door_lock co657_IoT nucleo-f429zi-mbed-os-mqtt

Fork of MQTT by MQTT

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MQTTEthernet.h Source File

MQTTEthernet.h

00001 
00002 #if !defined(MQTTETHERNET_H)
00003 #define MQTTETHERNET_H
00004 
00005 #include "MQTTmbed.h"
00006 #include "EthernetInterface.h"
00007 #include "MQTTSocket.h"
00008 
00009 class MQTTEthernet : public MQTTSocket
00010 {
00011 public:    
00012     MQTTEthernet()
00013     {
00014         connectInterface();  
00015     }
00016     
00017     EthernetInterface& getInterface()
00018     {
00019         return eth;
00020     }
00021     
00022     EthernetInterface& getEth() __attribute__ ((deprecated))
00023     {   
00024         return eth;
00025     }
00026     
00027     const char * get_ip_address()
00028     {
00029         return eth.get_ip_address();
00030     }
00031     
00032     int connectInterface(){
00033         return eth.connect();   
00034     }    
00035 
00036     int reconnectInterface()
00037     {
00038         disconnect();
00039         return eth.connect();
00040     }
00041     
00042     int disconnectInterface()
00043     {
00044         return eth.disconnect(); 
00045     }
00046     
00047 private:
00048 
00049     EthernetInterface eth;
00050     
00051 };
00052 
00053 
00054 #endif