summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e70f3dc)
Now that Altos only sends config information once every 5 seconds, we
want to keep waiting for that if we're receiving packets successfully.
Signed-off-by: Keith Packard <keithp@keithp.com>
Thread thread;
AltosFrequency[] frequencies;
int frequency_index;
Thread thread;
AltosFrequency[] frequencies;
int frequency_index;
+ int packet_count;
+ int tick_count;
void scan_exception(Exception e) {
if (e instanceof FileNotFoundException) {
void scan_exception(Exception e) {
if (e instanceof FileNotFoundException) {
AltosState state = reader.read();
if (state == null)
continue;
AltosState state = reader.read();
if (state == null)
continue;
if (state.flight != AltosLib.MISSING) {
final AltosScanResult result = new AltosScanResult(state.callsign,
state.serial,
if (state.flight != AltosLib.MISSING) {
final AltosScanResult result = new AltosScanResult(state.callsign,
state.serial,
+ packet_count = 0;
+ tick_count = 0;
++frequency_index;
if (frequency_index >= frequencies.length)
frequency_index = 0;
++frequency_index;
if (frequency_index >= frequencies.length)
frequency_index = 0;
}
void tick_timer() throws InterruptedException, TimeoutException {
}
void tick_timer() throws InterruptedException, TimeoutException {
+ ++tick_count;
+ if (packet_count == 0 || tick_count > 5)
+ next();
}
public void actionPerformed(ActionEvent e) {
}
public void actionPerformed(ActionEvent e) {
if (r != null) {
if (device != null) {
if (reader != null) {
if (r != null) {
if (device != null) {
if (reader != null) {
- System.out.printf("frequency %g rate %d\n", r.frequency.frequency, r.rate);
reader.set_telemetry(r.telemetry);
reader.set_telemetry_rate(r.rate);
reader.set_frequency(r.frequency.frequency);
reader.set_telemetry(r.telemetry);
reader.set_telemetry_rate(r.rate);
reader.set_frequency(r.frequency.frequency);