Mi2: Attempt to support non-repetitive alarms #323

here
cpfeiffer 2016-10-28 23:18:10 +02:00
parent e5ade5c0ef
commit 3db9748136
1 changed files with 7 additions and 2 deletions

View File

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