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.
Dependencies: C12832_fix LM75B MMA7660 MQTT PowerControl SNICInterface mbed-rtos mbed
Fork of IBMIoTClientWifiExample by
Diff: MQTTWifi.h
- Revision:
- 17:e921a54608ad
diff -r c57dac84da92 -r e921a54608ad MQTTWifi.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/MQTTWifi.h Wed Mar 25 10:35:23 2015 +0000
@@ -0,0 +1,53 @@
+
+#if !defined(MQTTWIFI_H)
+#define MQTTWIFI_H
+
+#include "MQTTmbed.h"
+#include "SNIC_WifiInterface.h"
+#include "MQTTSocket.h"
+#include "WiFi_Config.h"
+
+class MQTTWifi : public MQTTSocket
+{
+public:
+ MQTTWifi()
+ {
+ wifi.create(WIFI_TX, WIFI_RX, WIFI_CTS, WIFI_RTS, WIFI_RESET);
+ wifi.init();
+ wait(0.5);
+ wifi.disconnect();
+ wait(0.3);
+ wifi.connect( DEMO_AP_SSID
+ , strlen(DEMO_AP_SSID)
+ , DEMO_AP_SECURITY_TYPE
+ , DEMO_AP_SECUTIRY_KEY
+ , strlen(DEMO_AP_SECUTIRY_KEY) );
+ wait(0.5);
+ wifi.setIPConfig(true);
+ }
+
+ C_SNIC_WifiInterface& getEth()
+ {
+ return wifi;
+ }
+
+ void reconnect()
+ {
+ wifi.init();
+ wait(0.5);
+ wifi.disconnect();
+ wait(0.3);
+ wifi.connect( DEMO_AP_SSID
+ , strlen(DEMO_AP_SSID)
+ , DEMO_AP_SECURITY_TYPE
+ , DEMO_AP_SECUTIRY_KEY
+ , strlen(DEMO_AP_SECUTIRY_KEY) );
+ wait(0.5);
+ wifi.setIPConfig(true);
+ }
+
+private:
+ C_SNIC_WifiInterface wifi;
+};
+
+#endif
