Page 250 - The Unofficial Guide to Lego Mindstorms Robots
P. 250
239
line = line.trim();
mLastLine = line;
if (line.indexOf("ok") != -1) mComplete = true;
if (line.indexOf("redefine") != -1) mComplete = true;
if (line.indexOf("undefined") != -1) mComplete = mError = true;
if (line.length() == 0) mComplete = true;
}
}
catch (IOException ioe) {
System.out.println("PortListener: ioe " + ioe);
}
}
public void stop() throws IOException {
mThread.interrupt();
}
public void reset() { mComplete = false; mError = false; }
public boolean isComplete() { return mComplete; }
public boolean isError() { return mError; }
public String getLastLine() { return mLastLine; }
}
public class DownloadException
extends IOException {
public DownloadException (String message) { super (message); }
}
}