projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
[fw/altos]
/
altosui
/
AltosSerial.java
diff --git
a/altosui/AltosSerial.java
b/altosui/AltosSerial.java
index e609c6b5eeab6d840d541d39e786ebdac62875c8..f9f9e6e425232436d9e8ce4fe6788496b5dc4cb4 100644
(file)
--- a/
altosui/AltosSerial.java
+++ b/
altosui/AltosSerial.java
@@
-48,6
+48,7
@@
public class AltosSerial implements Runnable {
int line_count;
boolean monitor_mode;
static boolean debug;
int line_count;
boolean monitor_mode;
static boolean debug;
+ boolean remote;
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) {
@@
-126,9
+127,13
@@
public class AltosSerial implements Runnable {
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;
do {
try {
do {
try {
- Thread.sleep(
100
);
+ Thread.sleep(
timeout
);
} catch (InterruptedException ie) {
}
got_some = !reply_queue.isEmpty();
} catch (InterruptedException ie) {
}
got_some = !reply_queue.isEmpty();
@@
-259,14
+264,21
@@
public class AltosSerial implements Runnable {
}
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();
+ remote = true;
}
public void stop_remote() {
}
public void stop_remote() {
+ if (debug)
+ System.out.printf("stop remote\n");
+ flush_input();
printf ("~");
flush_output();
printf ("~");
flush_output();
+ remote = false;
}
public AltosSerial(AltosDevice in_device) throws FileNotFoundException, AltosSerialInUseException {
}
public AltosSerial(AltosDevice in_device) throws FileNotFoundException, AltosSerialInUseException {