Search in sources :

Example 1 with StandbyTx

use of com.eveningoutpost.dexdrip.watch.thinjam.messages.StandbyTx in project xDrip-plus by jamorham.

the class BlueJayService method standby.

public void standby() {
    if (BlueJayInfo.getInfo(I.address).buildNumber > 39) {
        addToLog("Requesting watch standby");
        val description = "Watch Standby";
        val item = new QueueMe().setBytes(new StandbyTx().getBytes());
        item.setDescription(description).setProcessor(new AuthReplyProcessor(new ReplyProcessor(I.connection) {

            @Override
            public void process(byte[] bytes) {
                UserError.Log.d(TAG, "Reply for: " + description + " " + JoH.bytesToHex(bytes));
            }
        }).setTag(item)).expireInSeconds(60);
        item.queueUnique();
        doQueue();
        invalidateCache();
    } else {
        JoH.static_toast_long("Needs BlueJay firmware upgrade to support standby");
    }
}
Also used : lombok.val(lombok.val) StandbyTx(com.eveningoutpost.dexdrip.watch.thinjam.messages.StandbyTx) ReplyProcessor(com.eveningoutpost.dexdrip.utils.bt.ReplyProcessor)

Example 2 with StandbyTx

use of com.eveningoutpost.dexdrip.watch.thinjam.messages.StandbyTx in project xDrip by NightscoutFoundation.

the class BlueJayService method standby.

public void standby() {
    if (BlueJayInfo.getInfo(I.address).buildNumber > 39) {
        addToLog("Requesting watch standby");
        val description = "Watch Standby";
        val item = new QueueMe().setBytes(new StandbyTx().getBytes());
        item.setDescription(description).setProcessor(new AuthReplyProcessor(new ReplyProcessor(I.connection) {

            @Override
            public void process(byte[] bytes) {
                UserError.Log.d(TAG, "Reply for: " + description + " " + JoH.bytesToHex(bytes));
            }
        }).setTag(item)).expireInSeconds(60);
        item.queueUnique();
        doQueue();
        invalidateCache();
    } else {
        JoH.static_toast_long("Needs BlueJay firmware upgrade to support standby");
    }
}
Also used : lombok.val(lombok.val) StandbyTx(com.eveningoutpost.dexdrip.watch.thinjam.messages.StandbyTx) ReplyProcessor(com.eveningoutpost.dexdrip.utils.bt.ReplyProcessor)

Aggregations

ReplyProcessor (com.eveningoutpost.dexdrip.utils.bt.ReplyProcessor)2 StandbyTx (com.eveningoutpost.dexdrip.watch.thinjam.messages.StandbyTx)2 lombok.val (lombok.val)2