Remade using native COM port functionality.