These are chat archives for ReactiveX/RxJava

Aug 2018
Ignacio Baca Moreno-Torres
Aug 09 2018 05:21
Not sure, but add various ".doOnNext" to log element to see which operator is not doing what you expect
Aug 09 2018 07:48
Aug 09 2018 21:00
Thanks for the suggestion. I did try that, and didn't see any .doOnNext methods ever get hit anywhere. Anyway, I figured out how to do what I want, but I still am not certain why what I had did not work. What I came up with looks like this:
    button_scan3.setOnClickListener {
        Log.d(TAG, "\n\nFiring up Scanner3")

        val scanner = SuiteScanner.create(this.applicationContext)
        val set = mutableSetOf<String>()

                .doOnComplete { Log.d(TAG, "Completed...Scanner3")
                    for(name in set ) {
                        Log.d(TAG, "BLE Device: $name")
                .subscribe { scanResult ->
                    val rxBleDevice = scanResult.getBleDevice()
                    Log.d(TAG, "The device has name ${}")
                    val name =
                    if (name != null) {


    fun scanForAllBLEDevices3(prefix: String): Observable<ScanResult> {

    Log.w(TAG, "We are in scanForAllBLEDevices3.")

    return rxBleScanner()
            .take(2, TimeUnit.SECONDS, timeoutScheduler)
            .filter { device -> inspectScanResult(, prefix) }

private fun inspectScanResult(foundDevice: String?, prefix: String): Boolean {
    Log.d(TAG, " Inspecting: $foundDevice")

    if(foundDevice == null) {
        return false

    return (foundDevice.startsWith(prefix))
So I'll just do what needs to be done in the onComplete()