1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-08 11:22:40 +03:00

write(), print(), and println() now return number of bytes written.

The type is long, and negative values indicate errors.  Needs more testing.
http://code.google.com/p/arduino/issues/detail?id=551
This commit is contained in:
David A. Mellis
2011-08-23 19:12:03 -04:00
parent b788ad593f
commit 8059abe581
24 changed files with 290 additions and 174 deletions

View File

@@ -67,11 +67,11 @@ public:
// Returns 1 if the packet was sent successfully, 0 if there was an error
int endPacket();
// Write a single byte into the packet
virtual void write(uint8_t);
virtual long write(uint8_t);
// Write a string of characters into the packet
virtual void write(const char *str);
virtual long write(const char *str);
// Write size bytes from buffer into the packet
virtual void write(const uint8_t *buffer, size_t size);
virtual long write(const uint8_t *buffer, size_t size);
// Start processing the next available incoming packet
// Returns the size of the packet in bytes, or 0 if no packets are available