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
MQTTWifi.h
- Committer:
- MACRUM
- Date:
- 2015-03-25
- Revision:
- 17:e921a54608ad
File content as of revision 17:e921a54608ad:
#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
