1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-06 18:27:02 +01:00

Mi2: Attempt to support non-repetitive alarms #323

This commit is contained in:
cpfeiffer 2016-10-28 23:18:10 +02:00
parent e5ade5c0ef
commit 3db9748136

View File

@ -1070,9 +1070,14 @@ public class MiBand2Support extends AbstractBTLEDeviceSupport {
return; return;
} }
int base = 0;
if (alarm.isEnabled()) {
base = 128;
}
int daysMask = alarm.getRepetitionMask(); int daysMask = alarm.getRepetitionMask();
int base = alarm.isEnabled() ? 128 : 0; if (!alarm.isRepetitive()) {
daysMask = 128;
}
byte[] alarmMessage = new byte[] { byte[] alarmMessage = new byte[] {
(byte) 0x2, // TODO what is this? (byte) 0x2, // TODO what is this?
(byte) (base + alarm.getIndex()), // 128 is the base, alarm slot is added (byte) (base + alarm.getIndex()), // 128 is the base, alarm slot is added