A fork of the original interface for OS/2. Features a correctly-implemented recv (but retains the old behavior via recv2).
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 |
diff -r a5c7a72aa707 -r 4224de23da9e ESP8266/ESP8266.cpp --- 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()))