ROS does not define how to use a generic serial port. There are several libraries which implement protocols on top of serial ports such as serial as well as a way to use ROS over the serial port rosserial
But if you just want to talk to a serial port, both python and C?C++ have ways to do that.