Search in sources :

Example 1 with AlertLevelMessage

use of com.eveningoutpost.dexdrip.watch.miband.message.AlertLevelMessage in project xDrip-plus by jamorham.

the class MiBandService method vibrateAlert.

private void vibrateAlert(AlertLevelMessage.AlertLevelType level) {
    if (level == AlertLevelMessage.AlertLevelType.NoAlert) {
        new QueueMe().setBytes(COMMAND_DISABLE_CALL).setDescription("Send specific disable command for" + level).setQueueWriteCharacterstic(Const.UUID_CHARACTERISTIC_CHUNKEDTRANSFER).expireInSeconds(QUEUE_EXPIRED_TIME).setDelayMs(QUEUE_DELAY).queue();
    }
    AlertLevelMessage message = new AlertLevelMessage();
    new QueueMe().setBytes(message.getAlertLevelMessage(level)).setDescription("Send vibrateAlert: " + level).setQueueWriteCharacterstic(message.getCharacteristicUUID()).expireInSeconds(QUEUE_EXPIRED_TIME).setDelayMs(QUEUE_DELAY).queue();
}
Also used : AlertLevelMessage(com.eveningoutpost.dexdrip.watch.miband.message.AlertLevelMessage)

Example 2 with AlertLevelMessage

use of com.eveningoutpost.dexdrip.watch.miband.message.AlertLevelMessage in project xDrip by NightscoutFoundation.

the class MiBandService method vibrateAlert.

private void vibrateAlert(AlertLevelMessage.AlertLevelType level) {
    if (level == AlertLevelMessage.AlertLevelType.NoAlert) {
        new QueueMe().setBytes(COMMAND_DISABLE_CALL).setDescription("Send specific disable command for" + level).setQueueWriteCharacterstic(Const.UUID_CHARACTERISTIC_CHUNKEDTRANSFER).expireInSeconds(QUEUE_EXPIRED_TIME).setDelayMs(QUEUE_DELAY).queue();
    }
    AlertLevelMessage message = new AlertLevelMessage();
    new QueueMe().setBytes(message.getAlertLevelMessage(level)).setDescription("Send vibrateAlert: " + level).setQueueWriteCharacterstic(message.getCharacteristicUUID()).expireInSeconds(QUEUE_EXPIRED_TIME).setDelayMs(QUEUE_DELAY).queue();
}
Also used : AlertLevelMessage(com.eveningoutpost.dexdrip.watch.miband.message.AlertLevelMessage)

Example 3 with AlertLevelMessage

use of com.eveningoutpost.dexdrip.watch.miband.message.AlertLevelMessage in project xDrip by NightscoutFoundation.

the class MiBandService method periodicVibrateAlert.

private void periodicVibrateAlert(int count, int activeVibrationTime, int pauseVibrationTime) {
    AlertLevelMessage message = new AlertLevelMessage();
    new QueueMe().setBytes(message.getPeriodicVibrationMessage((byte) count, (short) activeVibrationTime, (short) pauseVibrationTime)).setDescription(String.format("Send periodicVibrateAlert c:%d a:%d p:%d", count, activeVibrationTime, pauseVibrationTime)).setQueueWriteCharacterstic(message.getCharacteristicUUID()).expireInSeconds(QUEUE_EXPIRED_TIME).setDelayMs((activeVibrationTime + pauseVibrationTime) * count).queue();
}
Also used : AlertLevelMessage(com.eveningoutpost.dexdrip.watch.miband.message.AlertLevelMessage)

Example 4 with AlertLevelMessage

use of com.eveningoutpost.dexdrip.watch.miband.message.AlertLevelMessage in project xDrip-plus by jamorham.

the class MiBandService method periodicVibrateAlert.

private void periodicVibrateAlert(int count, int activeVibrationTime, int pauseVibrationTime) {
    AlertLevelMessage message = new AlertLevelMessage();
    new QueueMe().setBytes(message.getPeriodicVibrationMessage((byte) count, (short) activeVibrationTime, (short) pauseVibrationTime)).setDescription(String.format("Send periodicVibrateAlert c:%d a:%d p:%d", count, activeVibrationTime, pauseVibrationTime)).setQueueWriteCharacterstic(message.getCharacteristicUUID()).expireInSeconds(QUEUE_EXPIRED_TIME).setDelayMs((activeVibrationTime + pauseVibrationTime) * count).queue();
}
Also used : AlertLevelMessage(com.eveningoutpost.dexdrip.watch.miband.message.AlertLevelMessage)

Aggregations

AlertLevelMessage (com.eveningoutpost.dexdrip.watch.miband.message.AlertLevelMessage)4