1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-04 09:17:29 +01:00

Send vibration off-commands to Mi2 (#323)

Far from perfect, but a little better.
This commit is contained in:
cpfeiffer 2016-10-11 21:38:17 +02:00
parent a559140f67
commit 7c3dc741d2

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