-
- All Implemented Interfaces:
-
com.polidea.rxandroidble2.scan.BackgroundScanner
public class BackgroundScannerImpl implements BackgroundScanner
-
-
Method Summary
Modifier and Type Method Description voidscanBleDeviceInBackground(@NonNull() PendingIntent callbackIntent, ScanSettings scanSettings, Array<ScanFilter> scanFilters)Submits a scan request that will work even if your process gets killed by the system. voidstopBackgroundBleScan(@NonNull() PendingIntent callbackIntent)Stops previously initiated scan with a PendingIntent callback. List<ScanResult>onScanResultReceived(@NonNull() Intent intent)Callback that may be used to map received Intent from a PendingIntent based scan to a handy RxAndroidBLE enabled ScanResult -
-
Method Detail
-
scanBleDeviceInBackground
void scanBleDeviceInBackground(@NonNull() PendingIntent callbackIntent, ScanSettings scanSettings, Array<ScanFilter> scanFilters)
Submits a scan request that will work even if your process gets killed by the system. You can use this API to maintain abackground scan without a need to keep your application foreground and active. The system will manage the scan for you andwill wake your process up once a result is available.
When the PendingIntent is delivered, the Intent passed to the receiver or activitywill contain one or more of the extras EXTRA_CALLBACK_TYPE, EXTRA_ERROR_CODE and EXTRA_LIST_SCAN_RESULT to indicate the result of the scan.
- Parameters:
callbackIntent- Intent that will be executed when the scan result becomes availablescanSettings- Scan settingsscanFilters- Filtering settings
-
stopBackgroundBleScan
void stopBackgroundBleScan(@NonNull() PendingIntent callbackIntent)
Stops previously initiated scan with a PendingIntent callback.
- Parameters:
callbackIntent- A callback intent that was previously used to initiate a scan
-
onScanResultReceived
List<ScanResult> onScanResultReceived(@NonNull() Intent intent)
Callback that may be used to map received Intent from a PendingIntent based scan to a handy RxAndroidBLE enabled ScanResult
- Parameters:
intent- Intent containing scan result or an error code
-
-
-
-