mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-28 04:46:51 +01:00
simplify code
This commit is contained in:
parent
1b2f20160a
commit
c81e28c030
@ -4,6 +4,7 @@ import android.bluetooth.BluetoothGatt;
|
|||||||
import android.bluetooth.BluetoothGattCharacteristic;
|
import android.bluetooth.BluetoothGattCharacteristic;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@ -274,13 +275,11 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object value = null;
|
String value = null;
|
||||||
if (pairResult != null) {
|
if (pairResult != null) {
|
||||||
if (pairResult.length == 1) {
|
if (pairResult.length == 1) {
|
||||||
try {
|
try {
|
||||||
byte b = pairResult[0];
|
if (pairResult[0] == 2) {
|
||||||
Integer intValue = (int) b;
|
|
||||||
if (intValue == 2) {
|
|
||||||
LOG.info("Successfully paired MI device");
|
LOG.info("Successfully paired MI device");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -289,7 +288,7 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
value = pairResult.toString();
|
value = Arrays.toString(pairResult);
|
||||||
}
|
}
|
||||||
LOG.info("MI Band pairing result: " + value);
|
LOG.info("MI Band pairing result: " + value);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user