Package org.robolectric.shadows
Class ShadowBluetoothLeScanner
java.lang.Object
org.robolectric.shadows.ShadowBluetoothLeScanner
@Implements(value=android.bluetooth.le.BluetoothLeScanner.class, minSdk=21) public class ShadowBluetoothLeScanner extends Object
Adds Robolectric support for BLE scanning.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ShadowBluetoothLeScanner.ScanParams
Encapsulates scan params passed toBluetoothAdapter
startScan methods. -
Constructor Summary
Constructors Constructor Description ShadowBluetoothLeScanner()
-
Method Summary
Modifier and Type Method Description List<ShadowBluetoothLeScanner.ScanParams>
getActiveScans()
Returns allShadowBluetoothLeScanner.ScanParams
s representing active scans.Set<ScanCallback>
getScanCallbacks()
Returns all currently activeScanCallback
s.protected int
startScan(List<ScanFilter> filters, ScanSettings settings, PendingIntent pendingIntent)
Tracks ongoing scans.protected void
startScan(List<ScanFilter> filters, ScanSettings settings, ScanCallback callback)
Tracks ongoing scans.protected void
stopScan(PendingIntent pendingIntent)
protected void
stopScan(ScanCallback callback)
-
Constructor Details
-
ShadowBluetoothLeScanner
public ShadowBluetoothLeScanner()
-
-
Method Details
-
startScan
@Implementation protected void startScan(List<ScanFilter> filters, ScanSettings settings, ScanCallback callback)Tracks ongoing scans. UsegetScanCallbacks()
to get a list of any currently registeredScanCallback
s. -
startScan
@Implementation(minSdk=26) protected int startScan(List<ScanFilter> filters, ScanSettings settings, PendingIntent pendingIntent)Tracks ongoing scans. UsegetScanCallbacks()
to get a list of any currently registeredScanCallback
s. -
stopScan
-
stopScan
-
getScanCallbacks
Returns all currently activeScanCallback
s. -
getActiveScans
Returns allShadowBluetoothLeScanner.ScanParams
s representing active scans.
-