private void stopScanWithTimeoutCallback() { stopScan("Stop with Timeout"); processCallBacks(address, SCAN_TIMEOUT_CALLBACK); }
private void stopScanWithTimeoutCallback() { stopScan("Stop with Timeout"); processCallBacks(address, SCAN_TIMEOUT_CALLBACK); }
private void stopScanWithTimeoutCallback() { stopScan("Stop with Timeout"); processCallBacks(address, SCAN_TIMEOUT_CALLBACK); }
protected synchronized void onScanFailure(Throwable throwable) { UserError.Log.d(TAG, "onScanFailure: " + throwable); if (throwable instanceof BleScanException) { final String info = HandleBleScanException.handle(TAG, (BleScanException) throwable); UserError.Log.d(TAG, "Scan failure: " + info); if (!lastFailureReason.equals(info) || JoH.ratelimit("scanmeister-fail-error", 600)) { UserError.Log.e(TAG, "Failed to scan: " + info); lastFailureReason = info; } if (((BleScanException) throwable).getReason() == BleScanException.BLUETOOTH_DISABLED) { // Attempt to turn bluetooth on if (ratelimit("bluetooth_toggle_on", 30)) { UserError.Log.d(TAG, "Pause before Turn Bluetooth on"); JoH.threadSleep(2000); UserError.Log.e(TAG, "Trying to Turn Bluetooth on"); JoH.setBluetoothEnabled(xdrip.getAppContext(), true); } } processCallBacks(address, SCAN_FAILED_CALLBACK); } else if (throwable instanceof TimeoutException) { // note this code path not always reached - see inevitable task processCallBacks(address, SCAN_TIMEOUT_CALLBACK); } stopScan("Scan failure"); releaseWakeLock(); }
protected synchronized void onScanFailure(Throwable throwable) { UserError.Log.d(TAG, "onScanFailure: " + throwable); if (throwable instanceof BleScanException) { final String info = HandleBleScanException.handle(TAG, (BleScanException) throwable); UserError.Log.d(TAG, "Scan failure: " + info); if (!lastFailureReason.equals(info) || JoH.ratelimit("scanmeister-fail-error", 600)) { UserError.Log.e(TAG, "Failed to scan: " + info); lastFailureReason = info; } if (((BleScanException) throwable).getReason() == BleScanException.BLUETOOTH_DISABLED) { // Attempt to turn bluetooth on if (ratelimit("bluetooth_toggle_on", 30)) { UserError.Log.d(TAG, "Pause before Turn Bluetooth on"); JoH.threadSleep(2000); UserError.Log.e(TAG, "Trying to Turn Bluetooth on"); JoH.setBluetoothEnabled(xdrip.getAppContext(), true); } } processCallBacks(address, SCAN_FAILED_CALLBACK); } else if (throwable instanceof TimeoutException) { // note this code path not always reached - see inevitable task processCallBacks(address, SCAN_TIMEOUT_CALLBACK); } stopScan("Scan failure"); releaseWakeLock(); }
protected synchronized void onScanFailure(Throwable throwable) { UserError.Log.d(TAG, "onScanFailure: " + throwable); if (throwable instanceof BleScanException) { final String info = HandleBleScanException.handle(TAG, (BleScanException) throwable); UserError.Log.d(TAG, "Scan failure: " + info); if (!lastFailureReason.equals(info) || JoH.ratelimit("scanmeister-fail-error", 600)) { UserError.Log.e(TAG, "Failed to scan: " + info); lastFailureReason = info; } if (((BleScanException) throwable).getReason() == BleScanException.BLUETOOTH_DISABLED) { // Attempt to turn bluetooth on if (ratelimit("bluetooth_toggle_on", 30)) { UserError.Log.d(TAG, "Pause before Turn Bluetooth on"); JoH.threadSleep(2000); UserError.Log.e(TAG, "Trying to Turn Bluetooth on"); JoH.setBluetoothEnabled(xdrip.getAppContext(), true); } } processCallBacks(address, SCAN_FAILED_CALLBACK); } else if (throwable instanceof TimeoutException) { // note this code path not always reached - see inevitable task processCallBacks(address, SCAN_TIMEOUT_CALLBACK); } stopScan("Scan failure"); releaseWakeLock(); }
stopScan("Got match"); JoH.threadSleep(500); processCallBacks(this_address, SCAN_FOUND_CALLBACK); releaseWakeLock();
stopScan("Got match"); JoH.threadSleep(500); processCallBacks(this_address, SCAN_FOUND_CALLBACK); releaseWakeLock();
stopScan("Got match"); JoH.threadSleep(500); processCallBacks(this_address, SCAN_FOUND_CALLBACK); releaseWakeLock();