Closed morris-lu closed 4 years ago
Describe the bug
Hi, thanks for the awesome framework. Currently, I using establish connection and subscribe observe connection. Here is my code
establish connection
subscribe observe connection
BluetoothManager.shared.peripheralManager = self.manager.observeState() .startWith(manager.state) .filter { $0 == .poweredOn } .flatMap { _ in self.manager.scanForPeripherals(withServices: [servicesId]) } .flatMap { _ in peripheral.establishConnection() } .subscribe(onNext: { peripheral in self.devicesTableView.reloadData(with: .fade) print("Connected to: \(peripheral)") }, onError: { error in print("connect error", error) } )
I got log
didConnect(to: Peripheral(uuid: 62C8B54B-81F7-0E88-284A-A84460190461, name: Optional("E1AA0000 ")))
but I didn't get call back in observe connection subscribe, when I click establish again I'll receive call back in observe connection. Do I miss any setup? Thank you very much.
Environment:
Hi, I think it was my fault, I declare let manager = CentralManager(queue: .main) in two classes.
let manager = CentralManager(queue: .main)
Now I only declare one is success to subscribe connection call back, thanks.
Describe the bug
Hi, thanks for the awesome framework. Currently, I using
establish connection
andsubscribe observe connection
. Here is my codeI got log
but I didn't get call back in observe connection subscribe, when I click establish again I'll receive call back in observe connection. Do I miss any setup? Thank you very much.
Environment: