public static int secondsSinceReferenceTime(long serial, long time) { final long stored_time = getTime(serial); if (stored_time == 0) return -1; return (int) ((time - stored_time) / 1000); }
public static void code(byte[] data, long serial) { codeBookProcess(data, getCodeBook(serial)); }
private void check_calibrate() { final Pair<Long, Integer> calibration = Medtrum.getCalibration(); if (calibration != null) { status("Calibrating"); try { sendTx(new CalibrateTx(serial, calibration.first, calibration.second)); } catch (InvalidAlgorithmParameterException e) { UserError.Log.wtf(TAG, "Cannot calibrate: " + e); } } else { changeState(state.next()); } }
public static long doubleSchrage(long ix) { return schrageRandomInt(schrageRandomInt(ix)); }
public static synchronized void clearCalibration() { addCalibration(0, 0); }
public void changeState(STATE new_state) { changeState(new_state, DEFAULT_AUTOMATA_DELAY); }
private boolean backFillIfNeeded(final AnnexARx annex) { return backFillIfNeeded(annex, 0); }
STATE() { this.str = toString(); }
private void check_calibrate() { final Pair<Long, Integer> calibration = Medtrum.getCalibration(); if (calibration != null) { status("Calibrating"); try { sendTx(new CalibrateTx(serial, calibration.first, calibration.second)); } catch (InvalidAlgorithmParameterException e) { UserError.Log.wtf(TAG, "Cannot calibrate: " + e); } } else { changeState(state.next()); } }
public static long doubleSchrage(long ix) { return schrageRandomInt(schrageRandomInt(ix)); }
public static long timeStampFromTickCounter(long serial, int tick) { final long stored_time = getTime(serial); if (stored_time == 0) return -1; return stored_time + (tick * MINUTE_IN_MS * 2); }
public static synchronized void clearCalibration() { addCalibration(0, 0); }
public void changeState(STATE new_state) { changeState(new_state, DEFAULT_AUTOMATA_DELAY); }
private boolean backFillIfNeeded(final AnnexARx annex) { return backFillIfNeeded(annex, 0); }
public static long timeStampFromTickCounter(long serial, int tick) { final long stored_time = getTime(serial); if (stored_time == 0) return -1; return stored_time + (tick * MINUTE_IN_MS * 2); }
public static int tickCounterFromTimeStamp(long serial, long timestmap) { final long stored_time = getTime(serial); if (stored_time == 0) return -1; return (int) ((timestmap - stored_time) / (MINUTE_IN_MS * 2)); }
public static int tickCounterFromTimeStamp(long serial, long timestmap) { final long stored_time = getTime(serial); if (stored_time == 0) return -1; return (int) ((timestmap - stored_time) / (MINUTE_IN_MS * 2)); }
public static int secondsSinceReferenceTime(long serial, long time) { final long stored_time = getTime(serial); if (stored_time == 0) return -1; return (int) ((time - stored_time) / 1000); }