private void sendReply(BridgeResponse reply) { for (ByteBuffer byteBuffer : reply.getSend()) { Log.d(TAG, "Sending reply message"); sendBtMessage(byteBuffer); } }
public static BridgeResponse decodeTomatoPacket(byte[] buffer, int len) { final BridgeResponse reply = new BridgeResponse(); allowNewSensor.put(0, (byte) 0xD3); allowNewSensor.put(1, (byte) 0x01); reply.add(allowNewSensor); newFreqMessage.put(0, (byte) 0xD1); newFreqMessage.put(1, (byte) 0x05); reply.add(newFreqMessage); reply.add(ackMessage); return reply; reply.setError_message("No sensor found"); return reply; if (JoH.ratelimit("tomato-full-retry",60) || JoH.ratelimit("tomato-full-retry2",60)) { reply.getSend().clear(); reply.getSend().addAll(Tomato.resetTomatoState()); reply.setDelay(8000); reply.setError_message("Checksum failed - retrying"); Log.d(TAG,"Asking for retry of data");
if (reply.shouldDelay()) { Inevitable.task("send-tomato-reply", reply.getDelay(), () -> sendReply(reply)); } else { sendReply(reply); if (reply.hasError()) { JoH.static_toast_long(reply.getError_message()); error(reply.getError_message());
public static BridgeResponse decodeTomatoPacket(byte[] buffer, int len) { final BridgeResponse reply = new BridgeResponse(); allowNewSensor.put(0, (byte) 0xD3); allowNewSensor.put(1, (byte) 0x01); reply.add(allowNewSensor); newFreqMessage.put(0, (byte) 0xD1); newFreqMessage.put(1, (byte) 0x05); reply.add(newFreqMessage); reply.add(ackMessage); return reply; reply.setError_message("No sensor found"); return reply; if (JoH.ratelimit("tomato-full-retry",60) || JoH.ratelimit("tomato-full-retry2",60)) { reply.getSend().clear(); reply.getSend().addAll(Tomato.resetTomatoState()); reply.setDelay(8000); reply.setError_message("Checksum failed - retrying"); Log.d(TAG,"Asking for retry of data");
if (reply.shouldDelay()) { Inevitable.task("send-tomato-reply", reply.getDelay(), () -> sendReply(reply)); } else { sendReply(reply); if (reply.hasError()) { JoH.static_toast_long(reply.getError_message()); error(reply.getError_message());
public static BridgeResponse decodeTomatoPacket(byte[] buffer, int len) { final BridgeResponse reply = new BridgeResponse(); allowNewSensor.put(0, (byte) 0xD3); allowNewSensor.put(1, (byte) 0x01); reply.add(allowNewSensor); newFreqMessage.put(0, (byte) 0xD1); newFreqMessage.put(1, (byte) 0x05); reply.add(newFreqMessage); reply.add(ackMessage); return reply; reply.setError_message("No sensor found"); return reply; if (JoH.ratelimit("tomato-full-retry",60) || JoH.ratelimit("tomato-full-retry2",60)) { reply.getSend().clear(); reply.getSend().addAll(Tomato.resetTomatoState()); reply.setDelay(8000); reply.setError_message("Checksum failed - retrying"); Log.d(TAG,"Asking for retry of data");
if (reply.shouldDelay()) { Inevitable.task("send-tomato-reply", reply.getDelay(), () -> sendReply(reply)); } else { sendReply(reply); if (reply.hasError()) { JoH.static_toast_long(reply.getError_message()); error(reply.getError_message());
private void sendReply(BridgeResponse reply) { for (ByteBuffer byteBuffer : reply.getSend()) { Log.d(TAG, "Sending reply message"); sendBtMessage(byteBuffer); } }
private void sendReply(BridgeResponse reply) { for (ByteBuffer byteBuffer : reply.getSend()) { Log.d(TAG, "Sending reply message"); sendBtMessage(byteBuffer); } }