I have tried today to compare my declared Stream& stream that could be Serial, Serial1....,Serial3. To use the same code and define in a function the serial port to use, does it exists something like that?
if(stream == Serial) {.......}
I got the error that the stream class does not have this operation. Is it possible to see if it is used for example Serial1 in a function and if yes, then make this, else make that?
Thanks to both answers! It is not working this way. If I declare it as &stream == &Serial it compiles nearly without issues (it says, it contains a unsigned long and overflows), but does not make something.
Perhaps it is possible with switch/case?
switch(stream)
case Serial: ......
case Serial3: .....
I will post some code soon. I have to finish it to post something that makes a little sense.
Post an MRE. That's the smallest complete code that compiles and demonstrates the problem. Leave out any extraneous clutter that's unrelated to the problem.