2015-04-19 22:20:47 +02:00
|
|
|
package nodomain.freeyourgadget.gadgetbridge.miband;
|
|
|
|
|
2015-05-01 01:49:43 +02:00
|
|
|
import java.util.Locale;
|
|
|
|
|
2015-05-01 01:26:12 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.R;
|
|
|
|
|
2015-04-19 22:20:47 +02:00
|
|
|
public class DeviceInfo extends AbstractInfo {
|
|
|
|
public DeviceInfo(byte[] data) {
|
|
|
|
super(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getFirmwareVersion() {
|
|
|
|
if (mData.length == 16) {
|
|
|
|
int last = 15;
|
2015-04-20 11:58:59 +02:00
|
|
|
return String.format(Locale.US, "%d.%d.%d.%d", mData[last], mData[last - 1], mData[last - 2], mData[last - 3]);
|
2015-04-19 22:20:47 +02:00
|
|
|
}
|
2015-05-01 01:26:12 +02:00
|
|
|
return GBApplication.getContext().getString(R.string._unknown_);
|
2015-04-19 22:20:47 +02:00
|
|
|
}
|
|
|
|
}
|