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)
}
public String toString() {
- String name = getName();
- if (name == null)
- name = "Altus Metrum";
return String.format("%-20.20s %4d %s",
getProductName(), getSerial(), getAddr());
}
public String toShortString() {
- String name = getName();
- if (name == null)
- name = "Altus Metrum";
return String.format("%s %d %s",
- getProduct(), getSerial(), getAddr());
+ getProductName(), getSerial(), getAddr());
}
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);
}