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
Diff: ESP8266/ESP8266.h
- Revision:
- 49:cac09a34102c
- Parent:
- 47:04632d22a723
diff -r 6031f70e3914 -r cac09a34102c ESP8266/ESP8266.h --- a/ESP8266/ESP8266.h Thu Jun 04 20:45:00 2015 +0000 +++ b/ESP8266/ESP8266.h Sun Mar 31 00:53:46 2019 +0000 @@ -125,13 +125,20 @@ bool send(const char *buffer, int len); /** - * Read a string without blocking + * Read a string with blocking. + * + * Reads from the connection. This method <b>is</b> blocking, so take care + * to work around this as necessary. It is also <b>not</b> thread safe, so + * it must be locked - it is up to the caller to arrange this. * * @param buffer the buffer that will be written - * @param len the length of the buffer, is replaced by read length - * @return true on success + * @param len the length of the buffer. Up to this many bytes will be read. + * @param offset the offset to read from, inclusive. + * @return -1 on failure, or the number of bytes read. */ - bool recv(char *buffer, int *len); + int recv(char *buffer, int len, int offset); + + bool recv2(char* buffer, int* len); /** * Check if wifi is writable