projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
doc: Convert several more itemizedlists to variablelists
[fw/altos]
/
altosui
/
AltosBTDevice.java
diff --git
a/altosui/AltosBTDevice.java
b/altosui/AltosBTDevice.java
index 7a876c25feae21ee3a56d2a4ccae372ddfd4e50b..727a9f6625ce7953e251c94817cc9f5832c4b1ad 100644
(file)
--- a/
altosui/AltosBTDevice.java
+++ b/
altosui/AltosBTDevice.java
@@
-16,9
+16,8
@@
*/
package altosui;
*/
package altosui;
-import java.lang.*;
-import java.util.*;
import libaltosJNI.*;
import libaltosJNI.*;
+import org.altusmetrum.altosuilib_1.*;
public class AltosBTDevice extends altos_bt_device implements AltosDevice {
public class AltosBTDevice extends altos_bt_device implements AltosDevice {
@@
-42,6
+41,13
@@
public class AltosBTDevice extends altos_bt_device implements AltosDevice {
return getAddr();
}
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 int getSerial() {
String name = getName();
if (name == null)
@@
-72,15
+78,16
@@
public class AltosBTDevice extends altos_bt_device implements AltosDevice {
return libaltos.altos_bt_open(this);
}
return libaltos.altos_bt_open(this);
}
+ /*
private boolean isAltusMetrum() {
if (getName().startsWith(Altos.bt_product_telebt))
return true;
return false;
}
private boolean isAltusMetrum() {
if (getName().startsWith(Altos.bt_product_telebt))
return true;
return false;
}
+ */
public boolean matchProduct(int want_product) {
public boolean matchProduct(int want_product) {
- System.out.printf("matchProduct %s %d\n", toString(), want_product);
// if (!isAltusMetrum())
// return false;
// if (!isAltusMetrum())
// return false;
@@
-100,7
+107,6
@@
public class AltosBTDevice extends altos_bt_device implements AltosDevice {
if (!(o instanceof AltosBTDevice))
return false;
AltosBTDevice other = (AltosBTDevice) o;
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());
}
return getName().equals(other.getName()) && getAddr().equals(other.getAddr());
}
@@
-109,6
+115,7
@@
public class AltosBTDevice extends altos_bt_device implements AltosDevice {
}
public AltosBTDevice(String name, String addr) {
}
public AltosBTDevice(String name, String addr) {
+ Altos.load_library();
libaltos.altos_bt_fill_in(name, addr,this);
}
libaltos.altos_bt_fill_in(name, addr,this);
}