Search in sources :

Example 1 with BackFillTx

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

the class BlueJayService method getBackFill.

public void getBackFill(int records) {
    if (BlueJay.haveAuthKey(I.address)) {
        if (!flashRunning()) {
            val outbound = new BackFillTx(records);
            val item = new QueueMe().setBytes(outbound.getBytes()).setDescription("Get BackFill " + records).expireInSeconds(30);
            item.setProcessor(new AuthReplyProcessor(new ReplyProcessor(I.connection) {

                @Override
                public void process(byte[] bytes) {
                    UserError.Log.d(TAG, "BackFill request response: " + JoH.bytesToHex(bytes));
                }
            }).setTag(item)).queue();
        } else {
            UserError.Log.d(TAG, "No backfill as flash running");
        }
    } else {
        UserError.Log.d(TAG, "Cannot back fill as we don't have auth key");
    }
}
Also used : lombok.val(lombok.val) BackFillTx(com.eveningoutpost.dexdrip.watch.thinjam.messages.BackFillTx) ReplyProcessor(com.eveningoutpost.dexdrip.utils.bt.ReplyProcessor)

Example 2 with BackFillTx

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

the class BlueJayService method getBackFill.

public void getBackFill(int records) {
    if (BlueJay.haveAuthKey(I.address)) {
        if (!flashRunning()) {
            val outbound = new BackFillTx(records);
            val item = new QueueMe().setBytes(outbound.getBytes()).setDescription("Get BackFill " + records).expireInSeconds(30);
            item.setProcessor(new AuthReplyProcessor(new ReplyProcessor(I.connection) {

                @Override
                public void process(byte[] bytes) {
                    UserError.Log.d(TAG, "BackFill request response: " + JoH.bytesToHex(bytes));
                }
            }).setTag(item)).queue();
        } else {
            UserError.Log.d(TAG, "No backfill as flash running");
        }
    } else {
        UserError.Log.d(TAG, "Cannot back fill as we don't have auth key");
    }
}
Also used : lombok.val(lombok.val) BackFillTx(com.eveningoutpost.dexdrip.watch.thinjam.messages.BackFillTx) ReplyProcessor(com.eveningoutpost.dexdrip.utils.bt.ReplyProcessor)

Aggregations

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