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
All Methods Instance Methods Concrete Methods 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)
-
-
-
Method Detail
-
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
@Implementation protected void stopScan(ScanCallback callback)
-
stopScan
@Implementation(minSdk=26) protected void stopScan(PendingIntent pendingIntent)
-
getScanCallbacks
public Set<ScanCallback> getScanCallbacks()
Returns all currently activeScanCallback
s.
-
getActiveScans
public List<ShadowBluetoothLeScanner.ScanParams> getActiveScans()
Returns allShadowBluetoothLeScanner.ScanParams
s representing active scans.
-
-