add BP3595
Fork of MQTT by
Revision 48:aef707bd0f35, committed 2017-01-19
- Comitter:
- shosoai
- Date:
- Thu Jan 19 00:59:58 2017 +0000
- Parent:
- 47:f9841b2adaa2
- Commit message:
- add BP3595 module
Changed in this revision
MQTTBP3595.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r f9841b2adaa2 -r aef707bd0f35 MQTTBP3595.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MQTTBP3595.h Thu Jan 19 00:59:58 2017 +0000 @@ -0,0 +1,35 @@ +#if !defined(MQTTBP3595_H) +#define MQTTBP3595_H + +#include "MQTTmbed.h" +#include "MQTTSocket.h" +#include "GR_PEACH_WlanBP3595.h" +#include "EthernetInterface.h" + +class MQTTBP3595 : public MQTTSocket +{ +public: + MQTTBP3595(char* wlanssid, char* wlanpsk) + { + wlan.init(); // Use DHCP + wlan.connect(wlanssid, wlanpsk); + ssid=wlanssid; + psk=wlanpsk; + } + + EthernetInterface& getEth() + { + return (EthernetInterface&)wlan; + } + + void reconnect() + { + wlan.connect(ssid, psk); // nothing I've tried actually works to reconnect + } + +private: + GR_PEACH_WlanBP3595 wlan; + char* ssid; + char* psk; +}; +#endif