Send vibration off-commands to Mi2 (#323)

Far from perfect, but a little better.
master
cpfeiffer 2016-10-11 21:38:17 +02:00
parent a559140f67
commit 7c3dc741d2
1 changed files with 2 additions and 2 deletions

View File

@ -26,8 +26,8 @@ public class Mi2NotificationStrategy extends V2NotificationStrategy {
int on = onOffSequence[j];
on = Math.min(500, on); // longer than 500ms is not possible
builder.write(alert, new byte[]{(byte) vibrationProfile.getAlertLevel()});
// builder.wait(on);
// builder.write(alert, new byte[]{GattCharacteristic.NO_ALERT});
builder.wait(on);
builder.write(alert, new byte[]{GattCharacteristic.NO_ALERT});
if (++j < onOffSequence.length) {
int off = Math.max(onOffSequence[j], 25); // wait at least 25ms