RS232 communication optimisation

Need help for RS232 communication with switches in order to optimise the data traffic. How to manipulate different flags in termios struct to do the same?

I'm not sure what you're looking for here. RS232 is just a stream of serial characters. Use the fastest baud rate that works, don't use two stop bits, and don't use any delays. After that you might experiment with 7 bit characters if you are sending just ascii. There is not much to optimize with rs-232...