@Synchronized fun scanForDevices(context: Context, scanFilters: List<PeripheralScannerFilter> = emptyList(), resetExistingFilters: Boolean = false, cancelScanOnDispose: Boolean = true): Observable<ScanEvent>
Scan for devices and emits ScanEvents. Will scan until disposed,
Any previous ongoing scan wil be canceled before starting a this new scan operation
context
- the Context used for the Android gatt layer
scanFilters
- filters to apply for this scan operation
resetExistingFilters
- If TRUE existing filters will be reset before applying new one,
when FALSE existing filters will be applied in addition to one
provided with this method (default is FALSE)
cancelScanOnDispose
- will cancel if scan is on-going when the stream is disposed (TRUE by default)
Return
an Observable that emits ScanEvents made during. Disposing of this
stream will stop the scan