I am attempting to write a library for communicating with a piece of lab equipment and I would like to be able to select, in the constructor, which serial port on an arduino mega to use for the communication. I can certainly hard code it, but hopefully someone knows a nice way to do this.
I was able to successfully create a test library based on your example code, thank you! The error messages I generated by playing with it also led me to some information on references.