use of com.eveningoutpost.dexdrip.watch.miband.message.DisplayControllMessage in project xDrip by NightscoutFoundation.
the class MiBandService method sendSettings.
private void sendSettings() {
List<Pair<Integer, Boolean>> features = PrefBindingFactory.getInstance(getPrefBinder()).getStates("miband_feature_");
FeaturesControllMessage featureMessage = new FeaturesControllMessage();
for (Pair<Integer, Boolean> item : features) {
byte[] message = featureMessage.getMessage(item);
if (message.length != 0) {
new QueueMe().setBytes(message).setQueueWriteCharacterstic(featureMessage.getCharacteristicUUID()).setDescription("Set feature:" + item.first + ":" + item.second).expireInSeconds(QUEUE_EXPIRED_TIME).setDelayMs(QUEUE_DELAY).queue();
}
}
List<Integer> screenOpt = PrefBindingFactory.getInstance(getPrefBinder()).getEnabled("miband_screen");
DisplayControllMessage dispMessage;
MiBand.MiBandType type = MiBand.getMibandType();
if (type == MI_BAND2)
dispMessage = new DisplayControllMessageMiBand2();
else
dispMessage = new DisplayControllMessageMiband3_4();
new QueueMe().setBytes(dispMessage.getDisplayItemsCmd(screenOpt)).setQueueWriteCharacterstic(dispMessage.getCharacteristicUUID()).setDescription("Set screens").expireInSeconds(QUEUE_EXPIRED_TIME).setDelayMs(QUEUE_DELAY).queue();
setNightMode();
}
use of com.eveningoutpost.dexdrip.watch.miband.message.DisplayControllMessage in project xDrip-plus by jamorham.
the class MiBandService method sendSettings.
private void sendSettings() {
List<Pair<Integer, Boolean>> features = PrefBindingFactory.getInstance(getPrefBinder()).getStates("miband_feature_");
FeaturesControllMessage featureMessage = new FeaturesControllMessage();
for (Pair<Integer, Boolean> item : features) {
byte[] message = featureMessage.getMessage(item);
if (message.length != 0) {
new QueueMe().setBytes(message).setQueueWriteCharacterstic(featureMessage.getCharacteristicUUID()).setDescription("Set feature:" + item.first + ":" + item.second).expireInSeconds(QUEUE_EXPIRED_TIME).setDelayMs(QUEUE_DELAY).queue();
}
}
List<Integer> screenOpt = PrefBindingFactory.getInstance(getPrefBinder()).getEnabled("miband_screen");
DisplayControllMessage dispMessage;
MiBand.MiBandType type = MiBand.getMibandType();
if (type == MI_BAND2)
dispMessage = new DisplayControllMessageMiBand2();
else
dispMessage = new DisplayControllMessageMiband3_4();
new QueueMe().setBytes(dispMessage.getDisplayItemsCmd(screenOpt)).setQueueWriteCharacterstic(dispMessage.getCharacteristicUUID()).setDescription("Set screens").expireInSeconds(QUEUE_EXPIRED_TIME).setDelayMs(QUEUE_DELAY).queue();
setNightMode();
}
Aggregations