}
+ public String getErrorString() {
+ altos_error error = new altos_error();
+
+ libaltos.altos_get_last_error(error);
+ return String.format("%s (%d)", error.getString(), error.getCode());
+ }
+
public SWIGTYPE_p_altos_file open() {
return libaltos.altos_open(this);
}
- public boolean isAltusMetrum() {
+ private boolean isAltusMetrum() {
if (getVendor() != Altos.vendor_altusmetrum)
return false;
if (getProduct() < Altos.product_altusmetrum_min)
return false;
}
- static AltosUSBDevice[] list(int product) {
+ static java.util.List<AltosDevice> list(int product) {
if (!Altos.load_library())
return null;
SWIGTYPE_p_altos_list list = libaltos.altos_list_start();
- ArrayList<AltosUSBDevice> device_list = new ArrayList<AltosUSBDevice>();
+ ArrayList<AltosDevice> device_list = new ArrayList<AltosDevice>();
if (list != null) {
for (;;) {
AltosUSBDevice device = new AltosUSBDevice();
libaltos.altos_list_finish(list);
}
- AltosUSBDevice[] devices = new AltosUSBDevice[device_list.size()];
- for (int i = 0; i < device_list.size(); i++)
- devices[i] = device_list.get(i);
- return devices;
+ return device_list;
}
}
\ No newline at end of file