Fork for fixes

Revision:
14:7648334eb41b
Parent:
9:a156d3de5647
--- a/utility/Udp.h	Sat Aug 31 20:34:52 2019 +0000
+++ b/utility/Udp.h	Tue Sep 03 09:16:55 2019 +0000
@@ -67,21 +67,21 @@
     virtual int         parsePacket(void) = 0;
 
     // Number of bytes remaining in the current packet
-    virtual int         available(void) = 0;
+    virtual size_t      available(void) = 0;
 
-    // Read a single byte from the current packet
+    // Read a single byte from the current packet. Returns -1 if no byte is available.
     virtual int         read(void) = 0;
 
     // Read up to len bytes from the current packet and place them into buffer
     // Returns the number of bytes read, or 0 if none are available
-    virtual int         read(unsigned char* buffer, size_t len) = 0;
+    virtual size_t      read(unsigned char* buffer, size_t len) = 0;
 
     // Read up to len characters from the current packet and place them into buffer
     // Returns the number of characters read, or 0 if none are available
-    virtual int         read(char* buffer, size_t len) = 0;
+    virtual size_t      read(char* buffer, size_t len) = 0;
 
     // Return the next byte from the current packet without moving on to the next byte
-    virtual int         peek(void) = 0;
+    virtual int         peek(void) = 0;         // returns -1 if fails
     virtual void        flush(void) = 0;        // Finish reading the current packet
 
     // Return the IP address of the host who sent the current incoming packet
@@ -90,6 +90,6 @@
     // Return the port of the host who sent the current incoming packet
     virtual uint16_t    remotePort(void) = 0;
 protected:
-    uint8_t*    rawIPAddress(IpAddress& addr)   { return addr.rawAddress(); };
+    uint8_t*    rawIPAddress(IpAddress& addr)   { return addr.rawAddress(); }
 };
 #endif