From e26306c9350ef1d107d4257ef1c09d15165c9154 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 18 Dec 2013 01:14:11 -0800 Subject: altoslib: Pass InterruptedException up the stack instead of hiding it When interrupting a thread that is talking to a serial device, it's important not to have that thread discard the InterruptedException so that it will actually terminate. This patch removes a bunch of places that were discarding InterruptedExceptions and lets higher level code see them so that they can exit cleanly. Signed-off-by: Keith Packard --- altoslib/AltosSensorMetrum.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'altoslib/AltosSensorMetrum.java') diff --git a/altoslib/AltosSensorMetrum.java b/altoslib/AltosSensorMetrum.java index 4a51d492..c30eaebd 100644 --- a/altoslib/AltosSensorMetrum.java +++ b/altoslib/AltosSensorMetrum.java @@ -52,14 +52,13 @@ class AltosSensorMetrum { } } - static public void update_state(AltosState state, AltosLink link, AltosConfigData config_data) { + static public void update_state(AltosState state, AltosLink link, AltosConfigData config_data) throws InterruptedException { try { AltosSensorMetrum sensor_metrum = new AltosSensorMetrum(link); state.set_battery_voltage(AltosConvert.mega_battery_voltage(sensor_metrum.v_batt)); state.set_apogee_voltage(AltosConvert.mega_pyro_voltage(sensor_metrum.sense_a)); state.set_main_voltage(AltosConvert.mega_pyro_voltage(sensor_metrum.sense_m)); } catch (TimeoutException te) { - } catch (InterruptedException ie) { } } } -- cgit v1.2.3