*/
package altosui;
-import java.lang.*;
-import java.util.*;
import libaltosJNI.*;
public class AltosBTDevice extends altos_bt_device implements AltosDevice {
return getAddr();
}
+ 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 int getSerial() {
String name = getName();
if (name == null)
return libaltos.altos_bt_open(this);
}
+ /*
private boolean isAltusMetrum() {
if (getName().startsWith(Altos.bt_product_telebt))
return true;
return false;
}
+ */
public boolean matchProduct(int want_product) {
- System.out.printf("matchProduct %s %d\n", toString(), want_product);
// if (!isAltusMetrum())
// return false;
if (!(o instanceof AltosBTDevice))
return false;
AltosBTDevice other = (AltosBTDevice) o;
- System.out.printf("AltosBTDevice equals %s == %s\n", toString(), other.toString());
return getName().equals(other.getName()) && getAddr().equals(other.getAddr());
}
}
public AltosBTDevice(String name, String addr) {
+ Altos.load_library();
libaltos.altos_bt_fill_in(name, addr,this);
}