- public void start () {
- try {
- serial_out.write('?');
- serial_out.write('\r');
- } catch (IOException e) {
- }
- (new Thread(reader)).start();
- (new Thread(this)).start();
+ public void putc(char c) {
+ if (altos != null)
+ libaltos.altos_putchar(altos, c);
+ }
+
+ public void print(String data) {
+// System.out.printf("\"%s\" ", data);
+ for (int i = 0; i < data.length(); i++)
+ putc(data.charAt(i));
+ }
+
+ public void printf(String format, Object ... arguments) {
+ print(String.format(format, arguments));
+ }
+
+ public void open(altos_device device) throws FileNotFoundException {
+ close();
+ altos = libaltos.altos_open(device);
+ if (altos == null)
+ throw new FileNotFoundException(device.getPath());
+ input_thread = new Thread(this);
+ input_thread.start();
+ print("~\nE 0\n");
+ set_monitor(monitor_mode);
+ flush_input();