add BP3595

Dependencies:   FP MQTTPacket

Fork of MQTT by Junichi Katsu

Committer:
shosoai
Date:
Thu Jan 19 00:59:58 2017 +0000
Revision:
48:aef707bd0f35
add BP3595 module

Who changed what in which revision?

UserRevisionLine numberNew contents of line
shosoai 48:aef707bd0f35 1 #if !defined(MQTTBP3595_H)
shosoai 48:aef707bd0f35 2 #define MQTTBP3595_H
shosoai 48:aef707bd0f35 3
shosoai 48:aef707bd0f35 4 #include "MQTTmbed.h"
shosoai 48:aef707bd0f35 5 #include "MQTTSocket.h"
shosoai 48:aef707bd0f35 6 #include "GR_PEACH_WlanBP3595.h"
shosoai 48:aef707bd0f35 7 #include "EthernetInterface.h"
shosoai 48:aef707bd0f35 8
shosoai 48:aef707bd0f35 9 class MQTTBP3595 : public MQTTSocket
shosoai 48:aef707bd0f35 10 {
shosoai 48:aef707bd0f35 11 public:
shosoai 48:aef707bd0f35 12 MQTTBP3595(char* wlanssid, char* wlanpsk)
shosoai 48:aef707bd0f35 13 {
shosoai 48:aef707bd0f35 14 wlan.init(); // Use DHCP
shosoai 48:aef707bd0f35 15 wlan.connect(wlanssid, wlanpsk);
shosoai 48:aef707bd0f35 16 ssid=wlanssid;
shosoai 48:aef707bd0f35 17 psk=wlanpsk;
shosoai 48:aef707bd0f35 18 }
shosoai 48:aef707bd0f35 19
shosoai 48:aef707bd0f35 20 EthernetInterface& getEth()
shosoai 48:aef707bd0f35 21 {
shosoai 48:aef707bd0f35 22 return (EthernetInterface&)wlan;
shosoai 48:aef707bd0f35 23 }
shosoai 48:aef707bd0f35 24
shosoai 48:aef707bd0f35 25 void reconnect()
shosoai 48:aef707bd0f35 26 {
shosoai 48:aef707bd0f35 27 wlan.connect(ssid, psk); // nothing I've tried actually works to reconnect
shosoai 48:aef707bd0f35 28 }
shosoai 48:aef707bd0f35 29
shosoai 48:aef707bd0f35 30 private:
shosoai 48:aef707bd0f35 31 GR_PEACH_WlanBP3595 wlan;
shosoai 48:aef707bd0f35 32 char* ssid;
shosoai 48:aef707bd0f35 33 char* psk;
shosoai 48:aef707bd0f35 34 };
shosoai 48:aef707bd0f35 35 #endif