From 88df7cd314269fa1debe226b49b7e4e9dc238d8e Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 24 Oct 2014 21:21:19 -0700 Subject: altoslib: synchronize access to serial debug output list This list is access by both the receiver and the monitor task, so it needs to be locked to prevent collisions. Signed-off-by: Keith Packard --- altoslib/AltosLink.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'altoslib') diff --git a/altoslib/AltosLink.java b/altoslib/AltosLink.java index 62bd82b9..c0031cad 100644 --- a/altoslib/AltosLink.java +++ b/altoslib/AltosLink.java @@ -55,8 +55,11 @@ public abstract class AltosLink implements Runnable { public void printf(String format, Object ... arguments) { String line = String.format(format, arguments); - if (debug) - pending_output.add(line); + if (debug) { + synchronized (pending_output) { + pending_output.add(line); + } + } try { print(line); } catch (InterruptedException ie) { @@ -286,12 +289,14 @@ public abstract class AltosLink implements Runnable { binary_queue.put(dup); } - public void flush_output() { + public synchronized void flush_output() { if (pending_output == null) return; - for (String s : pending_output) - System.out.print(s); - pending_output.clear(); + synchronized (pending_output) { + for (String s : pending_output) + System.out.print(s); + pending_output.clear(); + } } public void flush_input(int timeout) throws InterruptedException { -- cgit v1.2.3 From b0e903a76276e33f531eade42ac721c9490c6758 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 30 Oct 2014 21:59:45 -0700 Subject: altosui: Pop up 'Connecting' dialog during Monitor Idle This was a bit harder than expected as I had to wire up a way to shut down the whole monitor idle window when you clicked on the cancel button. Signed-off-by: Keith Packard --- altoslib/AltosIdleMonitor.java | 32 ++++++++++++------------------ altoslib/AltosIdleMonitorListener.java | 3 ++- altoslib/AltosLib.java | 1 + altoslib/AltosLink.java | 8 +++++--- altosui/AltosIdleMonitorUI.java | 36 +++++++++++++++++++++++----------- 5 files changed, 46 insertions(+), 34 deletions(-) (limited to 'altoslib') diff --git a/altoslib/AltosIdleMonitor.java b/altoslib/AltosIdleMonitor.java index 85bcff10..57c77c47 100644 --- a/altoslib/AltosIdleMonitor.java +++ b/altoslib/AltosIdleMonitor.java @@ -35,20 +35,6 @@ public class AltosIdleMonitor extends Thread { AltosConfigData config_data; AltosGPS gps; - int AltosRSSI() throws TimeoutException, InterruptedException { - link.printf("s\n"); - String line = link.get_reply_no_dialog(5000); - if (line == null) - throw new TimeoutException(); - String[] items = line.split("\\s+"); - if (items.length < 2) - return 0; - if (!items[0].equals("RSSI:")) - return 0; - int rssi = Integer.parseInt(items[1]); - return rssi; - } - void start_link() throws InterruptedException, TimeoutException { if (remote) { link.set_radio_frequency(frequency); @@ -58,26 +44,30 @@ public class AltosIdleMonitor extends Thread { link.flush_input(); } - void stop_link() throws InterruptedException, TimeoutException { + boolean stop_link() throws InterruptedException, TimeoutException { if (remote) link.stop_remote(); + return link.reply_abort; } - void update_state(AltosState state) throws InterruptedException, TimeoutException { + boolean update_state(AltosState state) throws InterruptedException, TimeoutException { boolean worked = false; + boolean aborted = false; try { start_link(); fetch.update_state(state); - worked = true; + if (!link.has_error && !link.reply_abort) + worked = true; } finally { - stop_link(); + aborted = stop_link(); if (worked) { if (remote) state.set_rssi(link.rssi(), 0); listener_state.battery = link.monitor_battery(); } } + return aborted; } public void set_frequency(double in_frequency) { @@ -102,13 +92,17 @@ public class AltosIdleMonitor extends Thread { public void run() { AltosState state = new AltosState(); try { - while (!link.has_error) { + for (;;) { try { link.config_data(); update_state(state); listener.update(state, listener_state); } catch (TimeoutException te) { } + if (link.has_error || link.reply_abort) { + listener.failed(); + break; + } Thread.sleep(1000); } } catch (InterruptedException ie) { diff --git a/altoslib/AltosIdleMonitorListener.java b/altoslib/AltosIdleMonitorListener.java index 4382430c..36484763 100644 --- a/altoslib/AltosIdleMonitorListener.java +++ b/altoslib/AltosIdleMonitorListener.java @@ -19,4 +19,5 @@ package org.altusmetrum.altoslib_5; public interface AltosIdleMonitorListener { public void update(AltosState state, AltosListenerState listener_state); -} \ No newline at end of file + public void failed(); +} diff --git a/altoslib/AltosLib.java b/altoslib/AltosLib.java index 0edc0b43..be69519b 100644 --- a/altoslib/AltosLib.java +++ b/altoslib/AltosLib.java @@ -188,6 +188,7 @@ public class AltosLib { }; public static final String launch_sites_url = "http://www.altusmetrum.org/AltOS/launch-sites.txt"; +// public static final String launch_sites_url = "file:///home/keithp/misc/text/altusmetrum/AltOS/launch-sites.txt"; public static final int ao_telemetry_standard_len = 32; public static final int ao_telemetry_0_9_len = 95; diff --git a/altoslib/AltosLink.java b/altoslib/AltosLink.java index c0031cad..639d2ac7 100644 --- a/altoslib/AltosLink.java +++ b/altoslib/AltosLink.java @@ -427,8 +427,10 @@ public abstract class AltosLink implements Runnable { public void set_callsign(String callsign) { this.callsign = callsign; - printf ("c c %s\n", callsign); - flush_output(); + if (callsign != null) { + printf ("c c %s\n", callsign); + flush_output(); + } } public boolean is_loader() throws InterruptedException { @@ -467,7 +469,7 @@ public abstract class AltosLink implements Runnable { if (telemetry_rate < 0) telemetry_rate = AltosPreferences.telemetry_rate(serial); set_telemetry_rate(telemetry_rate); - if (callsign.equals("")) + if (callsign == null || callsign.equals("")) callsign = AltosPreferences.callsign(); set_callsign(callsign); printf("p\nE 0\n"); diff --git a/altosui/AltosIdleMonitorUI.java b/altosui/AltosIdleMonitorUI.java index 67b7a989..0230ff2f 100644 --- a/altosui/AltosIdleMonitorUI.java +++ b/altosui/AltosIdleMonitorUI.java @@ -102,6 +102,15 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl SwingUtilities.invokeLater(r); } + public void failed() { + Runnable r = new Runnable() { + public void run() { + close(); + } + }; + SwingUtilities.invokeLater(r); + } + Container bag; AltosUIFreqList frequencies; JTextField callsign_value; @@ -174,6 +183,19 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl } } + private void close() { + try { + disconnect(); + } catch (Exception ex) { + System.out.printf("Exception %s\n", ex.toString()); + for (StackTraceElement el : ex.getStackTrace()) + System.out.printf("%s\n", el.toString()); + } + setVisible(false); + dispose(); + AltosUIPreferences.unregister_font_listener(AltosIdleMonitorUI.this); + } + public AltosIdleMonitorUI(JFrame in_owner) throws FileNotFoundException, TimeoutException, InterruptedException { @@ -184,9 +206,10 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl serial = device.getSerial(); - AltosLink link; + AltosSerial link; try { link = new AltosSerial(device); + link.set_frame(this); } catch (Exception ex) { idle_exception(in_owner, ex); return; @@ -248,16 +271,7 @@ public class AltosIdleMonitorUI extends AltosUIFrame implements AltosFlightDispl addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { - try { - disconnect(); - } catch (Exception ex) { - System.out.printf("Exception %s\n", ex.toString()); - for (StackTraceElement el : ex.getStackTrace()) - System.out.printf("%s\n", el.toString()); - } - setVisible(false); - dispose(); - AltosUIPreferences.unregister_font_listener(AltosIdleMonitorUI.this); + close(); } }); -- cgit v1.2.3 From 4d4fee0b0091a1b6257a06f62b1078778cdb417f Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 10 Nov 2014 14:41:17 -0800 Subject: altoslib: Missing headers for mag sensor in CSV output Kelsey Black reported that the TeleMega CSV output was missing the header labels for the mag sensor data. Signed-off-by: Keith Packard --- altoslib/AltosCSV.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'altoslib') diff --git a/altoslib/AltosCSV.java b/altoslib/AltosCSV.java index 2357dbc7..2ad50097 100644 --- a/altoslib/AltosCSV.java +++ b/altoslib/AltosCSV.java @@ -158,7 +158,7 @@ public class AltosCSV implements AltosWriter { } void write_advanced_header() { - out.printf("accel_x,accel_y,accel_z,gyro_x,gyro_y,gyro_z"); + out.printf("accel_x,accel_y,accel_z,gyro_x,gyro_y,gyro_z,mag_x,mag_y,mag_z"); } void write_advanced(AltosState state) { -- cgit v1.2.3 From 60edcfe410e7fa848813d6c1ed8dc9808887d041 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 15 Nov 2014 16:03:32 -0800 Subject: altoslib: Make AltosState serializable This involved making every class it references serializable as well Signed-off-by: Keith Packard --- altoslib/AltosAccel.java | 6 ++++-- altoslib/AltosCompanion.java | 4 +++- altoslib/AltosGPS.java | 3 ++- altoslib/AltosGreatCircle.java | 3 ++- altoslib/AltosIMU.java | 3 ++- altoslib/AltosListenerState.java | 4 +++- altoslib/AltosMag.java | 3 ++- altoslib/AltosMs5607.java | 3 ++- altoslib/AltosSavedState.java | 30 ++++++++++++++++++++++++++++++ altoslib/AltosState.java | 24 +++++++++++++----------- altoslib/Makefile.am | 1 + 11 files changed, 64 insertions(+), 20 deletions(-) create mode 100644 altoslib/AltosSavedState.java (limited to 'altoslib') diff --git a/altoslib/AltosAccel.java b/altoslib/AltosAccel.java index d91da4da..e40a47b4 100644 --- a/altoslib/AltosAccel.java +++ b/altoslib/AltosAccel.java @@ -17,7 +17,9 @@ package org.altusmetrum.altoslib_5; -public class AltosAccel extends AltosUnits { +import java.io.*; + +public class AltosAccel extends AltosUnits implements Serializable { public double value(double v, boolean imperial_units) { if (imperial_units) @@ -46,4 +48,4 @@ public class AltosAccel extends AltosUnits { public int show_fraction(int width, boolean imperial_units) { return width / 9; } -} \ No newline at end of file +} diff --git a/altoslib/AltosCompanion.java b/altoslib/AltosCompanion.java index 47deb2a3..7e9ab2f1 100644 --- a/altoslib/AltosCompanion.java +++ b/altoslib/AltosCompanion.java @@ -17,7 +17,9 @@ package org.altusmetrum.altoslib_5; -public class AltosCompanion { +import java.io.*; + +public class AltosCompanion implements Serializable { public final static int board_id_telescience = 0x0a; public final static int MAX_CHANNELS = 12; diff --git a/altoslib/AltosGPS.java b/altoslib/AltosGPS.java index 0154e95d..285b5b45 100644 --- a/altoslib/AltosGPS.java +++ b/altoslib/AltosGPS.java @@ -19,8 +19,9 @@ package org.altusmetrum.altoslib_5; import java.text.*; import java.util.concurrent.*; +import java.io.*; -public class AltosGPS implements Cloneable { +public class AltosGPS implements Cloneable, Serializable { public final static int MISSING = AltosLib.MISSING; diff --git a/altoslib/AltosGreatCircle.java b/altoslib/AltosGreatCircle.java index 716eeef9..22a8e0e5 100644 --- a/altoslib/AltosGreatCircle.java +++ b/altoslib/AltosGreatCircle.java @@ -18,8 +18,9 @@ package org.altusmetrum.altoslib_5; import java.lang.Math; +import java.io.*; -public class AltosGreatCircle implements Cloneable { +public class AltosGreatCircle implements Cloneable, Serializable { public double distance; public double bearing; public double range; diff --git a/altoslib/AltosIMU.java b/altoslib/AltosIMU.java index d7373f3c..02b458b8 100644 --- a/altoslib/AltosIMU.java +++ b/altoslib/AltosIMU.java @@ -18,8 +18,9 @@ package org.altusmetrum.altoslib_5; import java.util.concurrent.*; +import java.io.*; -public class AltosIMU implements Cloneable { +public class AltosIMU implements Cloneable, Serializable { public int accel_along; public int accel_across; public int accel_through; diff --git a/altoslib/AltosListenerState.java b/altoslib/AltosListenerState.java index 054ff1d0..ed1f0f19 100644 --- a/altoslib/AltosListenerState.java +++ b/altoslib/AltosListenerState.java @@ -17,7 +17,9 @@ package org.altusmetrum.altoslib_5; -public class AltosListenerState { +import java.io.*; + +public class AltosListenerState implements Serializable { public int crc_errors; public double battery; diff --git a/altoslib/AltosMag.java b/altoslib/AltosMag.java index 1fa8877b..8784bb81 100644 --- a/altoslib/AltosMag.java +++ b/altoslib/AltosMag.java @@ -18,8 +18,9 @@ package org.altusmetrum.altoslib_5; import java.util.concurrent.*; +import java.io.*; -public class AltosMag implements Cloneable { +public class AltosMag implements Cloneable, Serializable { public int along; public int across; public int through; diff --git a/altoslib/AltosMs5607.java b/altoslib/AltosMs5607.java index 81e0641c..97e17164 100644 --- a/altoslib/AltosMs5607.java +++ b/altoslib/AltosMs5607.java @@ -18,8 +18,9 @@ package org.altusmetrum.altoslib_5; import java.util.concurrent.*; +import java.io.*; -public class AltosMs5607 { +public class AltosMs5607 implements Serializable { public int reserved; public int sens; public int off; diff --git a/altoslib/AltosSavedState.java b/altoslib/AltosSavedState.java new file mode 100644 index 00000000..4b010b31 --- /dev/null +++ b/altoslib/AltosSavedState.java @@ -0,0 +1,30 @@ +/* + * Copyright © 2014 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +package org.altusmetrum.altoslib_5; + +import java.io.*; + +public class AltosSavedState implements Serializable { + public AltosState state; + public AltosListenerState listener_state; + + public AltosSavedState(AltosState state, AltosListenerState listener_state) { + this.state = state; + this.listener_state = listener_state; + } +} diff --git a/altoslib/AltosState.java b/altoslib/AltosState.java index 830e95f3..5be008b7 100644 --- a/altoslib/AltosState.java +++ b/altoslib/AltosState.java @@ -21,7 +21,9 @@ package org.altusmetrum.altoslib_5; -public class AltosState implements Cloneable { +import java.io.*; + +public class AltosState implements Cloneable, Serializable { public static final int set_position = 1; public static final int set_gps = 2; @@ -43,7 +45,7 @@ public class AltosState implements Cloneable { private int prev_tick; public int boost_tick; - class AltosValue { + class AltosValue implements Serializable{ double value; double prev_value; private double max_value; @@ -179,9 +181,9 @@ public class AltosState implements Cloneable { } } - class AltosCValue { + class AltosCValue implements Serializable { - class AltosIValue extends AltosValue { + class AltosIValue extends AltosValue implements Serializable { boolean can_max() { return c_can_max(); } @@ -312,7 +314,7 @@ public class AltosState implements Cloneable { ground_altitude.set_measured(a, time); } - class AltosGpsGroundAltitude extends AltosValue { + class AltosGpsGroundAltitude extends AltosValue implements Serializable { void set(double a, double t) { super.set(a, t); pad_alt = value(); @@ -336,7 +338,7 @@ public class AltosState implements Cloneable { gps_ground_altitude.set(a, time); } - class AltosGroundPressure extends AltosCValue { + class AltosGroundPressure extends AltosCValue implements Serializable { void set_filtered(double p, double time) { computed.set_filtered(p, time); if (!is_measured()) @@ -359,7 +361,7 @@ public class AltosState implements Cloneable { ground_pressure.set_measured(pressure, time); } - class AltosAltitude extends AltosCValue { + class AltosAltitude extends AltosCValue implements Serializable { private void set_speed(AltosValue v) { if (!acceleration.is_measured() || !ascent) @@ -381,7 +383,7 @@ public class AltosState implements Cloneable { private AltosAltitude altitude; - class AltosGpsAltitude extends AltosValue { + class AltosGpsAltitude extends AltosValue implements Serializable { private void set_gps_height() { double a = value(); @@ -464,7 +466,7 @@ public class AltosState implements Cloneable { return gps_speed.max(); } - class AltosPressure extends AltosValue { + class AltosPressure extends AltosValue implements Serializable { void set(double p, double time) { super.set(p, time); if (state == AltosLib.ao_flight_pad) @@ -534,7 +536,7 @@ public class AltosState implements Cloneable { return AltosLib.MISSING; } - class AltosSpeed extends AltosCValue { + class AltosSpeed extends AltosCValue implements Serializable { boolean can_max() { return state < AltosLib.ao_flight_fast || state == AltosLib.ao_flight_stateless; @@ -588,7 +590,7 @@ public class AltosState implements Cloneable { return AltosLib.MISSING; } - class AltosAccel extends AltosCValue { + class AltosAccel extends AltosCValue implements Serializable { boolean can_max() { return state < AltosLib.ao_flight_fast || state == AltosLib.ao_flight_stateless; diff --git a/altoslib/Makefile.am b/altoslib/Makefile.am index 2805742e..8aff2767 100644 --- a/altoslib/Makefile.am +++ b/altoslib/Makefile.am @@ -82,6 +82,7 @@ altoslib_JAVA = \ AltosProgrammer.java \ AltosReplayReader.java \ AltosRomconfig.java \ + AltosSavedState.java \ AltosSelfFlash.java \ AltosSensorMM.java \ AltosSensorEMini.java \ -- cgit v1.2.3 From deda23963586eb07a32f9a3c83a0355178e19340 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 15 Nov 2014 22:48:15 -0800 Subject: altoslib: Add getBytes/putBytes interface to AltosPreferencesBackend This lets us store arbitrary binary data in the preferences database Signed-off-by: Keith Packard --- .../AltosDroid/AltosDroidPreferencesBackend.java | 16 ++++++++++++++++ altoslib/AltosPreferencesBackend.java | 3 +++ altosuilib/AltosUIPreferencesBackend.java | 8 ++++++++ 3 files changed, 27 insertions(+) (limited to 'altoslib') diff --git a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferencesBackend.java b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferencesBackend.java index be41ae7c..09a2a7a2 100644 --- a/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferencesBackend.java +++ b/altosdroid/src/org/altusmetrum/AltosDroid/AltosDroidPreferencesBackend.java @@ -22,6 +22,7 @@ import java.util.Map; import android.content.Context; import android.content.SharedPreferences; import android.os.Environment; +import android.util.*; import org.altusmetrum.altoslib_5.*; @@ -71,6 +72,16 @@ public class AltosDroidPreferencesBackend implements AltosPreferencesBackend { return prefs.getString(key, def); } + public byte[] getBytes(String key, byte[] def) { + String save = prefs.getString(key, null); + + if (save == null) + return def; + + byte[] bytes = Base64.decode(save, Base64.DEFAULT); + return bytes; + } + public void putBoolean(String key, boolean value) { editor.putBoolean(key, value); } @@ -87,6 +98,11 @@ public class AltosDroidPreferencesBackend implements AltosPreferencesBackend { editor.putString(key, value); } + public void putBytes(String key, byte[] bytes) { + String save = Base64.encodeToString(bytes, Base64.DEFAULT); + editor.putString(key, save); + } + public void remove(String key) { editor.remove(key); } diff --git a/altoslib/AltosPreferencesBackend.java b/altoslib/AltosPreferencesBackend.java index 76a99acb..9bb4c99b 100644 --- a/altoslib/AltosPreferencesBackend.java +++ b/altoslib/AltosPreferencesBackend.java @@ -33,6 +33,9 @@ public interface AltosPreferencesBackend { public boolean getBoolean(String key, boolean def); public void putBoolean(String key, boolean value); + public byte[] getBytes(String key, byte[] def); + public void putBytes(String key, byte[] value); + public boolean nodeExists(String key); public AltosPreferencesBackend node(String key); diff --git a/altosuilib/AltosUIPreferencesBackend.java b/altosuilib/AltosUIPreferencesBackend.java index 4048fd83..8d4431f1 100644 --- a/altosuilib/AltosUIPreferencesBackend.java +++ b/altosuilib/AltosUIPreferencesBackend.java @@ -62,6 +62,14 @@ public class AltosUIPreferencesBackend implements AltosPreferencesBackend { _preferences.putBoolean(key, value); } + public byte[] getBytes(String key, byte[] def) { + return _preferences.getByteArray(key, def); + } + + public void putBytes(String key, byte[] value) { + _preferences.putByteArray(key, value); + } + public boolean nodeExists(String key) { try { return _preferences.nodeExists(key); -- cgit v1.2.3 From 52ce23327bd81e2d40a1817442e75bd6b60ffe95 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 15 Nov 2014 22:50:31 -0800 Subject: altoslib: add AltosPreferences state save/restore interfaces This serializes an entire AltosState object and stores it in the preferences database for later retrieval. AltosDroid uses this to recover the old state data when restarting. Signed-off-by: Keith Packard --- altoslib/AltosPreferences.java | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'altoslib') diff --git a/altoslib/AltosPreferences.java b/altoslib/AltosPreferences.java index dba57dcb..5fe810d7 100644 --- a/altoslib/AltosPreferences.java +++ b/altoslib/AltosPreferences.java @@ -41,6 +41,9 @@ public class AltosPreferences { /* log file format preference name */ public final static String logfilePreferenceFormat = "LOGFILE-%d"; + /* state preference name */ + public final static String statePreferenceFormat = "STATE-%d"; + /* voice preference name */ public final static String voicePreference = "VOICE"; @@ -333,6 +336,48 @@ public class AltosPreferences { } } + public static void set_state(int serial, AltosState state, AltosListenerState listener_state) { + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + try { + ObjectOutputStream oos = new ObjectOutputStream(baos); + + AltosSavedState saved_state = new AltosSavedState(state, listener_state); + oos.writeObject(saved_state); + + byte[] bytes = baos.toByteArray(); + + synchronized(backend) { + backend.putBytes(String.format(statePreferenceFormat, serial), bytes); + flush_preferences(); + } + } catch (IOException ie) { + } + } + + public static AltosSavedState state(int serial) { + byte[] bytes = null; + + synchronized(backend) { + bytes = backend.getBytes(String.format(statePreferenceFormat, serial), null); + } + + if (bytes == null) + return null; + + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); + + try { + ObjectInputStream ois = new ObjectInputStream(bais); + AltosSavedState saved_state = (AltosSavedState) ois.readObject(); + return saved_state; + } catch (IOException ie) { + } catch (ClassNotFoundException ce) { + } + return null; + } + public static void set_scanning_telemetry(int new_scanning_telemetry) { synchronized (backend) { scanning_telemetry = new_scanning_telemetry; -- cgit v1.2.3