diff options
| author | Keith Packard <keithp@keithp.com> | 2013-01-01 15:30:11 -0800 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2013-01-01 15:30:11 -0800 | 
| commit | d83587c3c66b730cc54ca153714eee520ee40b2c (patch) | |
| tree | f3f77de67c0e918a8681f39a793235be0a66fc50 /micropeak/MicroUSB.java | |
| parent | 65b512c890a3ccf487655b79305ab1cfcf49259c (diff) | |
micropeak is code complete now.
Added save and download functionality. Removed 'new' from file menu.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'micropeak/MicroUSB.java')
| -rw-r--r-- | micropeak/MicroUSB.java | 19 | 
1 files changed, 13 insertions, 6 deletions
| diff --git a/micropeak/MicroUSB.java b/micropeak/MicroUSB.java index d48610fe..244f7bc0 100644 --- a/micropeak/MicroUSB.java +++ b/micropeak/MicroUSB.java @@ -16,10 +16,12 @@   */  package org.altusmetrum.micropeak; +  import java.util.*;  import libaltosJNI.*; +import org.altusmetrum.altosuilib.*; -public class MicroUSB extends altos_device { +public class MicroUSB extends altos_device implements AltosDevice {  	static boolean	initialized = false;  	static boolean	loaded_library = false; @@ -48,16 +50,16 @@ public class MicroUSB extends altos_device {  		String	name = getName();  		if (name == null)  			name = "Altus Metrum"; -		return String.format("%-20.20s %4d %s", -				     name, getSerial(), getPath()); +		return String.format("%-20.20s %s", +				     name, getPath());  	}  	public String toShortString() {  		String	name = getName();  		if (name == null)  			name = "Altus Metrum"; -		return String.format("%s %d %s", -				     name, getSerial(), getPath()); +		return String.format("%s %s", +				     name, getPath());  	} @@ -75,11 +77,15 @@ public class MicroUSB extends altos_device {  	private boolean isMicro() {  		if (getVendor() != 0x0403)  			return false; -		if (getProduct() != 0x6001) +		if (getProduct() != 0x6015)  			return false;  		return true;  	} +	public boolean matchProduct(int product) { +		return isMicro(); +	} +  	static java.util.List<MicroUSB> list() {  		if (!load_library())  			return null; @@ -92,6 +98,7 @@ public class MicroUSB extends altos_device {  				MicroUSB device = new MicroUSB();  				if (libaltos.altos_list_next(list, device) == 0)  					break; +				System.out.printf("Device %s\n", device.toString());  				if (device.isMicro())  					device_list.add(device);  			} | 
