IBM IoT Client WiFi example using Murata Type-YD WiFi module

Dependencies:   C12832_fix LM75B MMA7660 MQTT PowerControl SNICInterface mbed-rtos mbed

Fork of IBMIoTClientEthernetExample by Toyomasa Watarai

/media/uploads/MACRUM/ibm_iotkit.jpg

Revision:
18:ff8b191de621
Parent:
17:e921a54608ad
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MQTTWiFi_SNIC.h	Wed Mar 25 10:44:55 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