#!/usr/bin/env python

import serial
import time

def test_flow_control():
    comPort = "COM13"

    if isinstance(comPort, serial.Serial):
        port = comPort
    else:
        port = serial.serial_for_url(comPort)

    port.setDTR(False)
    port.setRTS(True)
    time.sleep(0.5)
    port.setDTR(True)
    port.setRTS(False)
    time.sleep(0.5)
    port.setDTR(False)

    port.flushInput()
    port.flushOutput()
    port.write('suuuup')
    port.timeout = 5

if __name__ == '__main__':
    test_flow_control()
