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.
Fork of MQTT by
MQTTWiFi.h@50:87ef607e1494, 2017-11-07 (annotated)
- Committer:
- vlasov01
- Date:
- Tue Nov 07 00:29:08 2017 +0000
- Revision:
- 50:87ef607e1494
- Parent:
- 47:24f2bf2819a5
Integration with MultiEvent_IKS01A2
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| mapellil | 47:24f2bf2819a5 | 1 | |
| mapellil | 47:24f2bf2819a5 | 2 | #if !defined(MQTTWIFI_H) |
| mapellil | 47:24f2bf2819a5 | 3 | #define MQTTWIFI_H |
| mapellil | 47:24f2bf2819a5 | 4 | |
| mapellil | 47:24f2bf2819a5 | 5 | #include "MQTTmbed.h" |
| mapellil | 47:24f2bf2819a5 | 6 | #include "WiFiInterface.h" |
| mapellil | 47:24f2bf2819a5 | 7 | #include "MQTTSocket.h" |
| mapellil | 47:24f2bf2819a5 | 8 | |
| mapellil | 47:24f2bf2819a5 | 9 | class MQTTWiFi : public MQTTSocket |
| mapellil | 47:24f2bf2819a5 | 10 | { |
| mapellil | 47:24f2bf2819a5 | 11 | public: |
| mapellil | 47:24f2bf2819a5 | 12 | MQTTWiFi(SpwfSAInterface &WiFiIntf, const char *ssid, const char *pass, nsapi_security_t security = NSAPI_SECURITY_NONE) : WiFi(WiFiIntf) |
| mapellil | 47:24f2bf2819a5 | 13 | { |
| mapellil | 47:24f2bf2819a5 | 14 | // eth.init(); // Use DHCP |
| mapellil | 47:24f2bf2819a5 | 15 | WiFi.connect(ssid, pass, security); |
| mapellil | 47:24f2bf2819a5 | 16 | } |
| mapellil | 47:24f2bf2819a5 | 17 | |
| mapellil | 47:24f2bf2819a5 | 18 | SpwfSAInterface& getWiFi() |
| mapellil | 47:24f2bf2819a5 | 19 | { |
| mapellil | 47:24f2bf2819a5 | 20 | return WiFi; |
| mapellil | 47:24f2bf2819a5 | 21 | } |
| mapellil | 47:24f2bf2819a5 | 22 | |
| mapellil | 47:24f2bf2819a5 | 23 | /* void reconnect() |
| mapellil | 47:24f2bf2819a5 | 24 | { |
| mapellil | 47:24f2bf2819a5 | 25 | WiFi.connect(); // nothing I've tried actually works to reconnect |
| mapellil | 47:24f2bf2819a5 | 26 | } |
| mapellil | 47:24f2bf2819a5 | 27 | */ |
| mapellil | 47:24f2bf2819a5 | 28 | private: |
| mapellil | 47:24f2bf2819a5 | 29 | |
| mapellil | 47:24f2bf2819a5 | 30 | SpwfSAInterface& WiFi; |
| mapellil | 47:24f2bf2819a5 | 31 | |
| mapellil | 47:24f2bf2819a5 | 32 | }; |
| mapellil | 47:24f2bf2819a5 | 33 | |
| mapellil | 47:24f2bf2819a5 | 34 | |
| mapellil | 47:24f2bf2819a5 | 35 | #endif |
