public static void clearSensorStats() { Pref.setInt("nfc_sensor_age", 0); // reset for nfc sensors sensorAge = 0; }
public static void clearSensorStats() { Pref.setInt("nfc_sensor_age", 0); // reset for nfc sensors sensorAge = 0; }
public static void clearSensorStats() { Pref.setInt("nfc_sensor_age", 0); // reset for nfc sensors sensorAge = 0; }
public static ByteBuffer initialize() { Log.i(TAG, "initialize blueReader!"); Pref.setInt("bridge_battery", 0); PersistentStore.setDouble("blueReaderFirmwareValue", 0); //command to get Firmware ByteBuffer ackMessage = ByteBuffer.allocate(3); ackMessage.put(0, (byte) 0x49); ackMessage.put(1, (byte) 0x44); ackMessage.put(2, (byte) 0x4E); return ackMessage; }
public static ByteBuffer initialize() { Log.i(TAG, "initialize blueReader!"); Pref.setInt("bridge_battery", 0); PersistentStore.setDouble("blueReaderFirmwareValue", 0); //command to get Firmware ByteBuffer ackMessage = ByteBuffer.allocate(3); ackMessage.put(0, (byte) 0x49); ackMessage.put(1, (byte) 0x44); ackMessage.put(2, (byte) 0x4E); return ackMessage; }
public static ByteBuffer initialize() { Log.i(TAG, "initialize blueReader!"); Pref.setInt("bridge_battery", 0); PersistentStore.setDouble("blueReaderFirmwareValue", 0); //command to get Firmware ByteBuffer ackMessage = ByteBuffer.allocate(3); ackMessage.put(0, (byte) 0x49); ackMessage.put(1, (byte) 0x44); ackMessage.put(2, (byte) 0x4E); return ackMessage; }
@Override public void onClick(DialogInterface dialog, int which) { // save result and refresh Pref.setInt(pref, picker.getColor()); ColorCache.invalidateCache(); if (runnable != null) { runnable.run(); } } });
@Override public void onClick(DialogInterface dialog, int which) { // save result and refresh Pref.setInt(pref, picker.getColor()); ColorCache.invalidateCache(); if (runnable != null) { runnable.run(); } } });
public static ArrayList<ByteBuffer> initialize() { Log.i(TAG, "initialize!"); Pref.setInt("bridge_battery", 0); //force battery to no-value before first reading return resetTomatoState(); }
public static ArrayList<ByteBuffer> initialize() { Log.i(TAG, "initialize!"); Pref.setInt("bridge_battery", 0); //force battery to no-value before first reading return resetTomatoState(); }
public static ArrayList<ByteBuffer> initialize() { Log.i(TAG, "initialize!"); Pref.setInt("bridge_battery", 0); //force battery to no-value before first reading return resetTomatoState(); }
private static void saveWearBattery() { int wearBatteryLevel = CheckBridgeBattery.getBatteryLevel(Home.getAppContext()); Log.i(TAG, "create wearBatteryLevel=" + wearBatteryLevel); Pref.setInt("bridge_battery", wearBatteryLevel);//TODO confirm wear battery should be used as bridge CheckBridgeBattery.checkBridgeBattery(); }
static void AreWeDone() { if(s_recviedEnoughData) { // This reading already ended return; } if(s_acumulatedSize < 344 + TOMATO_HEADER_LENGTH + 1) { return; } byte[] data = Arrays.copyOfRange(s_full_data, TOMATO_HEADER_LENGTH, TOMATO_HEADER_LENGTH+344); s_recviedEnoughData = true; long now = JoH.tsl(); // Important note, the actual serial number is 8 bytes long and starts at addresses 5. String SensorSn = LibreUtils.decodeSerialNumberKey(Arrays.copyOfRange(s_full_data, 5, 13)); boolean checksum_ok = NFCReaderX.HandleGoodReading(SensorSn, data, now, true); Log.e(TAG, "We have all the data that we need " + s_acumulatedSize + " checksum_ok = " + checksum_ok + HexDump.dumpHexString(data)); if(!checksum_ok) { throw new RuntimeException(CHECKSUM_FAILED); } PersistentStore.setString("Tomatobattery", Integer.toString(s_full_data[13])); Pref.setInt("bridge_battery", s_full_data[13]); PersistentStore.setString("TomatoHArdware",HexDump.toHexString(s_full_data,16,2)); PersistentStore.setString("TomatoFirmware",HexDump.toHexString(s_full_data,14,2)); PersistentStore.setString("LibreSN", SensorSn); }
static void AreWeDone() { if(s_recviedEnoughData) { // This reading already ended return; } if(s_acumulatedSize < 344 + TOMATO_HEADER_LENGTH + 1) { return; } byte[] data = Arrays.copyOfRange(s_full_data, TOMATO_HEADER_LENGTH, TOMATO_HEADER_LENGTH+344); s_recviedEnoughData = true; long now = JoH.tsl(); // Important note, the actual serial number is 8 bytes long and starts at addresses 5. String SensorSn = LibreUtils.decodeSerialNumberKey(Arrays.copyOfRange(s_full_data, 5, 13)); boolean checksum_ok = NFCReaderX.HandleGoodReading(SensorSn, data, now, true); Log.e(TAG, "We have all the data that we need " + s_acumulatedSize + " checksum_ok = " + checksum_ok + HexDump.dumpHexString(data)); if(!checksum_ok) { throw new RuntimeException(CHECKSUM_FAILED); } PersistentStore.setString("Tomatobattery", Integer.toString(s_full_data[13])); Pref.setInt("bridge_battery", s_full_data[13]); PersistentStore.setString("TomatoHArdware",HexDump.toHexString(s_full_data,16,2)); PersistentStore.setString("TomatoFirmware",HexDump.toHexString(s_full_data,14,2)); PersistentStore.setString("LibreSN", SensorSn); }
static void AreWeDone() { if(s_recviedEnoughData) { // This reading already ended return; } if(s_acumulatedSize < 344 + TOMATO_HEADER_LENGTH + 1) { return; } byte[] data = Arrays.copyOfRange(s_full_data, TOMATO_HEADER_LENGTH, TOMATO_HEADER_LENGTH+344); s_recviedEnoughData = true; long now = JoH.tsl(); // Important note, the actual serial number is 8 bytes long and starts at addresses 5. String SensorSn = LibreUtils.decodeSerialNumberKey(Arrays.copyOfRange(s_full_data, 5, 13)); boolean checksum_ok = NFCReaderX.HandleGoodReading(SensorSn, data, now, true); Log.e(TAG, "We have all the data that we need " + s_acumulatedSize + " checksum_ok = " + checksum_ok + HexDump.dumpHexString(data)); if(!checksum_ok) { throw new RuntimeException(CHECKSUM_FAILED); } PersistentStore.setString("Tomatobattery", Integer.toString(s_full_data[13])); Pref.setInt("bridge_battery", s_full_data[13]); PersistentStore.setString("TomatoHArdware",HexDump.toHexString(s_full_data,16,2)); PersistentStore.setString("TomatoFirmware",HexDump.toHexString(s_full_data,14,2)); PersistentStore.setString("LibreSN", SensorSn); }
Pref.setInt("bridge_battery", localBridgeBattery); sensor.latest_battery_level = localBridgeBattery; blueReaderDays = 6.129200670865791d / (1d + Math.pow(((double)transmitterData.sensor_battery_level/3763.700630306379d),(-61.04241888028577d))); //todo compare with test-formular, and new Data of batterylog
Pref.setInt("bridge_battery", localBridgeBattery); sensor.latest_battery_level = localBridgeBattery; blueReaderDays = 6.129200670865791d / (1d + Math.pow(((double)transmitterData.sensor_battery_level/3763.700630306379d),(-61.04241888028577d))); //todo compare with test-formular, and new Data of batterylog