1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-10-31 22:52:59 +01:00

Amazfit GTR: Enforce auth key input when pairing, try to fix notifications

This commit is contained in:
Andreas Shimokawa 2019-10-24 21:51:10 +02:00
parent cbd47a81cc
commit c2c240d7be
2 changed files with 7 additions and 2 deletions

View File

@ -58,4 +58,9 @@ public class AmazfitGTRCoordinator extends AmazfitBipCoordinator {
public InstallHandler findInstallHandler(Uri uri, Context context) {
return null;
}
@Override
public int getBondingStyle() {
return BONDING_STYLE_REQUIRE_KEY;
}
}

View File

@ -124,7 +124,7 @@ public class AmazfitBipSupport extends HuamiSupport {
appSuffix = appName.getBytes();
suffixlength = appSuffix.length;
}
if (gbDevice.getType() == DeviceType.MIBAND4) {
if (gbDevice.getType() == DeviceType.MIBAND4 || gbDevice.getType() == DeviceType.AMAZFITGTR) {
prefixlength += 4;
}
@ -134,7 +134,7 @@ public class AmazfitBipSupport extends HuamiSupport {
byte[] command = new byte[length + prefixlength + suffixlength];
int pos = 0;
command[pos++] = (byte) alertCategory.getId();
if (gbDevice.getType() == DeviceType.MIBAND4) {
if (gbDevice.getType() == DeviceType.MIBAND4 || gbDevice.getType() == DeviceType.AMAZFITGTR) {
command[pos++] = 0; // TODO
command[pos++] = 0;
command[pos++] = 0;