Polidea / RxBluetoothKit

iOS & OSX Bluetooth library for RxSwift
Apache License 2.0
1.41k stars 366 forks source link

Cannot scan the peripherals #343

Open prijuly2000 opened 5 years ago

prijuly2000 commented 5 years ago

Describe the bug Trying to scan the device which brodcasts serviceA

manager.observeState()
            .startWith(manager.state)
            .filter { $0 == .poweredOn }
            .timeout(3.0, scheduler: MainScheduler.instance)
            .take(1)
            .flatMap { _ in self.manager.scanForPeripherals(withServices: [BLEService.serviceA.uuid]) }
            .take(5.0, scheduler: MainScheduler.instance)
            .toArray()
            .subscribe(onNext: { peripheral in
                print("Scanned: \(peripheral)")
            })

To Reproduce Use above code. Im trying to scan a device that broadcasts serviceA. After executing the above code, i get Scanned: [] Environment:

prijuly2000 commented 5 years ago

@paweljaneczek @cwalcott anyone? Are you guys maintaining this lib? otherwise i will go with some other

cwalcott commented 5 years ago

No, I'm not a maintainer. You could try posting on stackoverflow

dariuszseweryn commented 5 years ago

Hi @prijuly2000

Have you tried to debug the code? E.g. running without service filters and checking the results? Printing potential errors? Logging on particular steps of the flow? Or even turning the library logs on?