You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I read in https://www.arduino.cc/reference/en/language/functions/communication/stream/ that Stream object is the base of several other objects (namely, five: Serial, SD, Wire, EthernetServer and EthernetClient) and it has several methods (find(), findUntil(), readBytes(), readBytesUntil(), readString(), readStringUntil(), peek(), parseInt(), parseFloat(), setTimeout()...) which are only mentioned there and in Serial's page (https://www.arduino.cc/reference/en/language/functions/communication/serial/) but not in the other four ones (SD, Wire, EthernetServer, EthernetClient). So, it isn't clear if it is possible to use all Stream methods as SD/EthernetServer/etc methods. I mean, for instance,could I write this?
Well, it seems WiFi library also derives from Stream because it has several familiar methods: available(), read(), flush()...but this suspiction is not asserted anywhere.
@q2dg had a good comment on #2919 that might otherwise be missed since that issue was closed as a duplicate of this one:
I think documentation should be refactored to list in one point common methods (Stream page) and then, in library reference pages a link to these (cleaning some redundancies).
I think this would make the reference pages easier to maintain since it would avoid a lot of duplicate content.
Hello. I read in https://www.arduino.cc/reference/en/language/functions/communication/stream/ that Stream object is the base of several other objects (namely, five: Serial, SD, Wire, EthernetServer and EthernetClient) and it has several methods (find(), findUntil(), readBytes(), readBytesUntil(), readString(), readStringUntil(), peek(), parseInt(), parseFloat(), setTimeout()...) which are only mentioned there and in Serial's page (https://www.arduino.cc/reference/en/language/functions/communication/serial/) but not in the other four ones (SD, Wire, EthernetServer, EthernetClient). So, it isn't clear if it is possible to use all Stream methods as SD/EthernetServer/etc methods. I mean, for instance,could I write this?
It compiles but I have'nt right now a Ethernet Shield to check if this sketch works as it should: it isn't clear from documentation.
In conclusion: I think Stream and derived/related pages need a big rewrite to clarify/arrange this.
Thanks.
The text was updated successfully, but these errors were encountered: