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: weather_clock weather_clock
Revision 53:4224de23da9e, committed 2019-05-24
- Comitter:
- alexhrao
- Date:
- Fri May 24 23:36:22 2019 +0000
- Parent:
- 52:a5c7a72aa707
- Commit message:
- Final changes for preliminary new node support
Changed in this revision
| ESP8266/ESP8266.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/ESP8266/ESP8266.cpp Fri May 24 23:19:03 2019 +0000
+++ b/ESP8266/ESP8266.cpp Fri May 24 23:36:22 2019 +0000
@@ -42,6 +42,11 @@
#define ESP8226_NEW_NODE 0
#endif
+#if ESP8226_NEW_NODE == 0
+#define ESP8226_CON_CMD "c=net.createConnection("
+#else
+#define ESP8226_CON_CMD "c=tls.createConnection("
+#endif
ESP8266 *ESP8266::_inst;
ESP8266::ESP8266(PinName tx, PinName rx, PinName reset, int baud, int timeout) :
@@ -137,7 +142,7 @@
bool ESP8266::open(bool type, char* ip, int port, int id) {
// Create the actual connection
- if (!(command("c=net.createConnection(") &&
+ if (!(command(ESP8226_CON_CMD) &&
command(type ? "net.TCP" : "net.UDP") &&
command(")") &&
execute()))
