Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
MQTT.h
00001 #ifndef __MQTT_H__ 00002 #define __MQTT_H__ 00003 00004 #include "MQTTmbed.h" 00005 #include "MQTTSocket.h" 00006 00007 template <class T> 00008 class MQTTconnect : public MQTTSocket 00009 { 00010 T eth; 00011 public: 00012 MQTTconnect() : MQTTSocket(ð) 00013 { eth.connect(); } 00014 00015 T& getEth() 00016 { return eth; } 00017 }; 00018 00019 // 00020 // To add additional transports, Define it as: 00021 // 00022 #define MQTT_BG96 100 00023 #define MQTT_WNC14A2A 101 00024 #define MQTT_ETHERNET 102 00025 00026 // 00027 // Then define the interface that will be used: 00028 // 00029 #if MBED_CONF_APP_MQTT_INTERFACE == MQTT_BG96 00030 #define _ift BG96Interface 00031 00032 #elif MBED_CONF_APP_MQTT_INTERFACE == MQTT_WNC14A2A 00033 #define _ift WNC14A2AInterface 00034 00035 #elif MBED_CONF_APP_MQTT_INTERFACE == MQTT_ETHERNET 00036 #define _ift EthernetInterface 00037 00038 #else 00039 #error "No MQTT Network Transport chosen. Please add 'config.mqtt-interfaces.value' to your mbed_app.json (see README.md for more information)." 00040 #endif 00041 00042 typedef MQTTconnect<_ift> MQTTct; 00043 typedef _ift MQTTnet; 00044 00045 #endif 00046
Generated on Mon Jul 18 2022 07:40:17 by
1.7.2