+ 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");
+ flush_output();
+ set_monitor(monitor_mode);
+ }
+
+ public void set_channel(int channel) {
+ if (altos != null) {
+ if (monitor_mode)
+ printf("m 0\nc r %d\nm 1\n", channel);
+ else
+ printf("c r %d\n", channel);
+ flush_output();