100ms isn't long enough to capture pending remote serial input, so use
300 ms in that mode.
Signed-off-by: Keith Packard <keithp@keithp.com>
int line_count;
boolean monitor_mode;
static boolean debug;
int line_count;
boolean monitor_mode;
static boolean debug;
LinkedList<String> pending_output = new LinkedList<String>();
static void set_debug(boolean new_debug) {
LinkedList<String> pending_output = new LinkedList<String>();
static void set_debug(boolean new_debug) {
public void flush_input() {
flush_output();
boolean got_some;
public void flush_input() {
flush_output();
boolean got_some;
+
+ int timeout = 100;
+ if (remote)
+ timeout = 300;
} catch (InterruptedException ie) {
}
got_some = !reply_queue.isEmpty();
} catch (InterruptedException ie) {
}
got_some = !reply_queue.isEmpty();
}
public void start_remote() {
}
public void start_remote() {
+ if (debug)
+ System.out.printf("start remote\n");
set_radio();
printf("p\nE 0\n");
flush_input();
set_radio();
printf("p\nE 0\n");
flush_input();
}
public void stop_remote() {
}
public void stop_remote() {
+ if (debug)
+ System.out.printf("stop remote\n");
+ flush_input();
printf ("~");
flush_output();
printf ("~");
flush_output();
}
public AltosSerial(AltosDevice in_device) throws FileNotFoundException, AltosSerialInUseException {
}
public AltosSerial(AltosDevice in_device) throws FileNotFoundException, AltosSerialInUseException {