use of com.eveningoutpost.dexdrip.utils.BytesGenerator in project xDrip by NightscoutFoundation.
the class BlueJayService method setTime.
public void setTime() {
new QueueMe().setGenerator(new BytesGenerator() {
@Override
public byte[] produce() {
timeOutbound = new SetTimeTx();
return timeOutbound.getBytes();
}
}).setDescription("Set time").expireInSeconds(30).setProcessor(new ReplyProcessor(I.connection) {
@Override
public void process(byte[] bytes) {
final SetTimeTx reply = new SetTimeTx(bytes);
UserError.Log.d(TAG, "Time Process callback: " + JoH.bytesToHex(bytes));
getInfo().parseSetTime(reply, timeOutbound);
UserError.Log.d(TAG, "Time difference with watch: " + ((timeOutbound.getTimestamp() - reply.getTimestamp()) / 1000d));
}
}).queue();
}
use of com.eveningoutpost.dexdrip.utils.BytesGenerator in project xDrip-plus by jamorham.
the class BlueJayService method setTime.
public void setTime() {
new QueueMe().setGenerator(new BytesGenerator() {
@Override
public byte[] produce() {
timeOutbound = new SetTimeTx();
return timeOutbound.getBytes();
}
}).setDescription("Set time").expireInSeconds(30).setProcessor(new ReplyProcessor(I.connection) {
@Override
public void process(byte[] bytes) {
final SetTimeTx reply = new SetTimeTx(bytes);
UserError.Log.d(TAG, "Time Process callback: " + JoH.bytesToHex(bytes));
getInfo().parseSetTime(reply, timeOutbound);
UserError.Log.d(TAG, "Time difference with watch: " + ((timeOutbound.getTimestamp() - reply.getTimestamp()) / 1000d));
}
}).queue();
}
Aggregations