I'm writing a library that parses TSIP packets employed by some GPS units.
For libraries requiring a serial port, I've read that it is recommended to utilize the Stream class vs. specific serial port classes. It certainly does simplify using the library and works fine. However, it is also recommended to avoid using pointers in public accessible library interfaces... and I have so far failed to uncover a way to achieve that with using serial ports.
Some libraries provide a second method for passing initialized hardware serial port instances, passing an integer representing the hardware serial port number, then using #ifdefs to "detect" what HW serial ports are available on a system. That method also works, but I've had problems with that on Due devices. (note: there also seems to be several different #defines for HW serial ports and I am confused a bit there too)
My C++ is pretty rusty, and I probably have missed something. Is there a recommended method or construct that would meet the "no pointers" design principle for this use case?
Thanks in advance, Dan