Polidea / RxBluetoothKit

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

Read or Write to a Characteristic leads to disconnect. #299

Closed PaulEhrhardt closed 5 years ago

PaulEhrhardt commented 5 years ago

Describe the bug Using RxBluetoothkit, read or write to a Characteristic leads to immediate disconnect. Read/Write action is possible on the same device when directly using Apple CoreBluetooth.

To Reproduce

  1. Using sample code: I use the example sequence on to of the Readme

    manager.scanForPeripherals(withServices: [serviceId])
    .take(1)
    .flatMap { $0.peripheral.establishConnection() }
    .flatMap { $0.discoverServices([serviceId]) }
    .flatMap { Observable.from($0) }
    .flatMap { $0.discoverCharacteristics([characteristicId]) }
    .flatMap { Observable.from($0) }
    .flatMap { $0.readValue() }
    .subscribe(onNext: { print("Value: \($0.value)") })
  2. Using Example App: I encounter the same disconnect behaviour on read/write value. 48630912-acae6080-e9bd-11e8-9588-64c99a65a8fb

Expected behavior readValue(...) and writeValue(...) on Characteristic should be possible.

Environment:

PaulEhrhardt commented 5 years ago

Further investigation tuned out that the problem was unfortunately device related. I will close this issue as no action is needed from your side.

krutitrivedi commented 5 years ago

from where you get serviceID because i get error