[NOTE: this is mostly a collection of notes and not quite a specification nor an implementation thereof]
"How do I identify what I should open()
for my RS-232 or RS-485 serial port?" is a surprisingly
difficult question to answer on Linux.
You might think that "/dev/ttyS0, /dev/ttyS1, etc are my serial ports in order, right?" and the answer to that is Maybe.