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.
Dependents: HTTPClient_HelloWorld_IDW01M1 wifigianluigi HTTPClient_HelloWorld_IDW01M1_Fabio_Ricezione
Fork of HTTPClient by
HTTPWifi.h@19:17578cfdb57a, 2016-11-07 (annotated)
- Committer:
- mapellil
- Date:
- Mon Nov 07 17:08:02 2016 +0000
- Revision:
- 19:17578cfdb57a
first committ
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| mapellil | 19:17578cfdb57a | 1 | |
| mapellil | 19:17578cfdb57a | 2 | #if !defined(HTTPWIFI_H) |
| mapellil | 19:17578cfdb57a | 3 | #define HTTPWIFI_H |
| mapellil | 19:17578cfdb57a | 4 | |
| mapellil | 19:17578cfdb57a | 5 | #include "mbed.h" |
| mapellil | 19:17578cfdb57a | 6 | #include "SpwfInterface.h" |
| mapellil | 19:17578cfdb57a | 7 | #include "WiFiInterface.h" |
| mapellil | 19:17578cfdb57a | 8 | #include "HTTPSocket.h" |
| mapellil | 19:17578cfdb57a | 9 | |
| mapellil | 19:17578cfdb57a | 10 | class HTTPWiFi : public HTTPSocket |
| mapellil | 19:17578cfdb57a | 11 | { |
| mapellil | 19:17578cfdb57a | 12 | public: |
| mapellil | 19:17578cfdb57a | 13 | HTTPWiFi(SpwfSAInterface &WiFiIntf, const char *ssid, const char *pass, nsapi_security_t security = NSAPI_SECURITY_NONE) : WiFi(WiFiIntf) |
| mapellil | 19:17578cfdb57a | 14 | { |
| mapellil | 19:17578cfdb57a | 15 | // eth.init(); // Use DHCP |
| mapellil | 19:17578cfdb57a | 16 | WiFi.connect(ssid, pass, security); |
| mapellil | 19:17578cfdb57a | 17 | printf ("WIFI ssid: %s connected\n\r", ssid); |
| mapellil | 19:17578cfdb57a | 18 | } |
| mapellil | 19:17578cfdb57a | 19 | |
| mapellil | 19:17578cfdb57a | 20 | SpwfSAInterface& getWiFi() |
| mapellil | 19:17578cfdb57a | 21 | { |
| mapellil | 19:17578cfdb57a | 22 | return WiFi; |
| mapellil | 19:17578cfdb57a | 23 | } |
| mapellil | 19:17578cfdb57a | 24 | |
| mapellil | 19:17578cfdb57a | 25 | /* void reconnect() |
| mapellil | 19:17578cfdb57a | 26 | { |
| mapellil | 19:17578cfdb57a | 27 | WiFi.connect(); // nothing I've tried actually works to reconnect |
| mapellil | 19:17578cfdb57a | 28 | } |
| mapellil | 19:17578cfdb57a | 29 | */ |
| mapellil | 19:17578cfdb57a | 30 | |
| mapellil | 19:17578cfdb57a | 31 | private: |
| mapellil | 19:17578cfdb57a | 32 | |
| mapellil | 19:17578cfdb57a | 33 | SpwfSAInterface& WiFi; |
| mapellil | 19:17578cfdb57a | 34 | |
| mapellil | 19:17578cfdb57a | 35 | }; |
| mapellil | 19:17578cfdb57a | 36 | #endif |
