bblanchon / ArduinoStreamUtils

💪 Power-ups for Arduino streams
MIT License
257 stars 21 forks source link

BufferingPrint needs to take Print (not Stream) #3

Closed skyhisi closed 5 years ago

skyhisi commented 5 years ago

Can't currently use BufferingPrint with PubSubClient which inherits from Print.

Need to change the BasicBufferingPrint to use Print (not Stream).

--- BufferingPrint.hpp  2019-07-17 20:51:17.329167200 +0100
+++ BufferingPrint.hpp  2019-07-17 20:51:27.962692900 +0100
@@ -12,7 +12,7 @@

 template <typename TAllocator>
 struct BasicBufferingPrint : PrintProxy<WriteBufferingPolicy<TAllocator>> {
-  explicit BasicBufferingPrint(Stream &upstream, size_t capacity,
+  explicit BasicBufferingPrint(Print &upstream, size_t capacity,
                                TAllocator allocator = TAllocator())
       : PrintProxy<WriteBufferingPolicy<TAllocator>>(upstream,
                                                      {capacity, allocator}) {}