1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-28 21:06:50 +01:00

Fix discovery of Mi Band 1S #196

closes #204
This commit is contained in:
cpfeiffer 2016-01-06 23:38:17 +01:00
parent 824382b385
commit a6d3c50f94
2 changed files with 6 additions and 3 deletions

View File

@ -30,7 +30,9 @@ public class MiBandCoordinator extends AbstractDeviceCoordinator {
@Override
public boolean supports(GBDeviceCandidate candidate) {
return candidate.getMacAddress().toUpperCase().startsWith(MiBandService.MAC_ADDRESS_FILTER);
String macAddress = candidate.getMacAddress().toUpperCase();
return macAddress.startsWith(MiBandService.MAC_ADDRESS_FILTER_1_1A)
|| macAddress.startsWith(MiBandService.MAC_ADDRESS_FILTER_1S);
}
@Override
@ -74,7 +76,7 @@ public class MiBandCoordinator extends AbstractDeviceCoordinator {
}
public static boolean hasValidUserInfo() {
String dummyMacAddress = MiBandService.MAC_ADDRESS_FILTER + ":00:00:00";
String dummyMacAddress = MiBandService.MAC_ADDRESS_FILTER_1_1A + ":00:00:00";
try {
UserInfo userInfo = getConfiguredUserInfo(dummyMacAddress);
return true;

View File

@ -9,7 +9,8 @@ import static nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDevi
public class MiBandService {
public static final String MAC_ADDRESS_FILTER = "88:0F:10";
public static final String MAC_ADDRESS_FILTER_1_1A = "88:0F:10";
public static final String MAC_ADDRESS_FILTER_1S = "C8:0F:10";
public static final UUID UUID_SERVICE_MIBAND_SERVICE = UUID.fromString(String.format(BASE_UUID, "FEE0"));