I don't like the use of '+ 1' in the code

perhaps dd another define, like this...
#define SERIALPORT_COUNT (SERIAL_PORT_MAX + 1)

otherwise you have to look to see why the +1 is there since it's not always obvious