diff options
| author | Keith Packard <keithp@keithp.com> | 2010-07-28 12:24:53 -0700 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2010-07-28 12:24:53 -0700 |
| commit | e76b9cc32bbcc5176d9bdd6f8d79778024627382 (patch) | |
| tree | 331a16ed7d14f8362dc85af04dcf1693b3b1ee6e /ao-tools/altosui/AltosDevice.java | |
| parent | 172a2817dde6718724f2b5fad5a7761801446fa0 (diff) | |
altosui: Catch errors opening USB devices. Limit list to relevant devices
Avoids a segfault when failing to open a device. Limit listed telemetry
devices to just TeleDongle units.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/altosui/AltosDevice.java')
| -rw-r--r-- | ao-tools/altosui/AltosDevice.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ao-tools/altosui/AltosDevice.java b/ao-tools/altosui/AltosDevice.java index 0e7d01da..f488174c 100644 --- a/ao-tools/altosui/AltosDevice.java +++ b/ao-tools/altosui/AltosDevice.java @@ -42,7 +42,8 @@ public class AltosDevice extends altos_device { AltosDevice device = new AltosDevice(); if (libaltos.altos_list_next(list, device) == 0) break; - device_list.add(device); + if (product == null || device.getProduct().startsWith(product)) + device_list.add(device); } libaltos.altos_list_finish(list); } |
