Without flushing the configuration commands to the serial device, it
never sees them as the telemetry input thread doesn't flush.
Signed-off-by: Keith Packard <keithp@keithp.com>
}
public void flush_output() {
- libaltos.altos_flush(altos);
+ if (altos != null)
+ libaltos.altos_flush(altos);
}
public void flush_input() {
input_thread = new Thread(this);
input_thread.start();
print("~\nE 0\n");
+ flush_output();
set_monitor(monitor_mode);
- flush_input();
}
public void set_channel(int channel) {
printf("m 0\nc r %d\nm 1\n", channel);
else
printf("c r %d\n", channel);
+ flush_output();
}
}
printf("m 1\n");
else
printf("m 0\n");
+ flush_output();
}
}
public void set_callsign(String callsign) {
- if (altos != null)
+ if (altos != null) {
printf ("c c %s\n", callsign);
+ flush_output();
+ }
}
public AltosSerial() {