Example of AWS IoT connection and Web Dashboard thru STM32 Nucleo evaluation board and mbed OS.

Dependencies:   X_NUCLEO_IKS01A1 mbed FP MQTTPacket DnsQuery ATParser

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MQTTWiFi.h Source File

MQTTWiFi.h

00001 
00002 #if !defined(MQTTWIFI_H)
00003 #define MQTTWIFI_H
00004 
00005 #include "MQTTmbed.h"
00006 #include "WiFiInterface.h"
00007 #include "MQTTSocket.h"
00008 
00009 class MQTTWiFi : public MQTTSocket
00010 {
00011 public:    
00012     MQTTWiFi(SpwfSAInterface &WiFiIntf, const char *ssid, const char *pass, nsapi_security_t security = NSAPI_SECURITY_NONE) : WiFi(WiFiIntf)
00013     {
00014         WiFi.reset_chip();
00015         WiFi.connect(ssid, pass,  security);
00016     }
00017     
00018     SpwfSAInterface& getWiFi()
00019     {
00020         return WiFi;
00021     }
00022 
00023 private:
00024 
00025     SpwfSAInterface& WiFi;
00026     
00027 };
00028 
00029 
00030 #endif