Java Code Examples for no.nordicsemi.android.support.v18.scanner.BluetoothLeScannerCompat#stopScan()

The following examples show how to use no.nordicsemi.android.support.v18.scanner.BluetoothLeScannerCompat#stopScan() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public synchronized void stop() {
    if (mIsScanning) {
        BluetoothLeScannerCompat scanner = BluetoothLeScannerCompat.getScanner();
        scanner.stopScan(mScanCallback);
        mIsScanning = false;
        BleScannerListener listener = mWeakListener.get();
        if (listener != null) {
            listener.onScanStatusChanged(false);
        }
    }
}
 
Example 2
/**
 * stop scanning for bluetooth devices.
 */
private void stopScan() {
    mHandler.removeCallbacks(mScannerTimeout);
    final BluetoothLeScannerCompat scanner = BluetoothLeScannerCompat.getScanner();
    scanner.stopScan(scanCallback);
    mIsScanning = false;
}
 
Example 3
/**
 * Stop scan if user tap Cancel button
 */
private void stopScan() {
	if (mIsScanning) {
		mScanButton.setText(R.string.scanner_action_scan);

		final BluetoothLeScannerCompat scanner = BluetoothLeScannerCompat.getScanner();
		scanner.stopScan(scanCallback);

		mIsScanning = false;
	}
}
 
Example 4
/**
 * Stop scanning for bluetooth devices.
 */
public void stopScan() {
	if (scannerStateLiveData.isScanning() && scannerStateLiveData.isBluetoothEnabled()) {
		final BluetoothLeScannerCompat scanner = BluetoothLeScannerCompat.getScanner();
		scanner.stopScan(scanCallback);
		scannerStateLiveData.scanningStopped();
	}
}
 
Example 5
public void stopLeScan() {
	if (!scanning)
		return;

	final BluetoothLeScannerCompat scanner = BluetoothLeScannerCompat.getScanner();
	scanner.stopScan(scanCallback);

	handler.removeCallbacks(stopScanTask);
	scanning = false;
	notifyItemChanged(devices.size());
}
 
Example 6
/**
 * Stop scan if user tap Cancel button
 */
private void stopScan() {
	if (scanning) {
		scanButton.setText(R.string.scanner_action_scan);

		final BluetoothLeScannerCompat scanner = BluetoothLeScannerCompat.getScanner();
		scanner.stopScan(scanCallback);

		scanning = false;
	}
}
 
Example 7
/**
 * Stop scan if user tap Cancel button
 */
private void stopScan() {
	if (mIsScanning) {
		mScanButton.setText(R.string.scanner_action_scan);

		final BluetoothLeScannerCompat scanner = BluetoothLeScannerCompat.getScanner();
		scanner.stopScan(scanCallback);

		mIsScanning = false;
	}
}
 
Example 8
/**
 * stop scanning for bluetooth devices.
 */
public void stopScan() {
    final BluetoothLeScannerCompat scanner = BluetoothLeScannerCompat.getScanner();
    scanner.stopScan(mScanCallbacks);
    mScannerStateLiveData.scanningStopped();
}
 
Example 9
Source Project: mcumgr-android   File: ScannerViewModel.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Stop scanning for Bluetooth LE devices.
 */
public void stopScan() {
    final BluetoothLeScannerCompat scanner = BluetoothLeScannerCompat.getScanner();
    scanner.stopScan(scanCallback);
    mScannerStateLiveData.scanningStopped();
}