Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API MISUSE after disposing observeValueUpdateAndSetNotification #319

Closed
David2XN opened this issue Mar 14, 2019 · 1 comment
Closed

API MISUSE after disposing observeValueUpdateAndSetNotification #319

David2XN opened this issue Mar 14, 2019 · 1 comment

Comments

@David2XN
Copy link

David2XN commented Mar 14, 2019

Describe the bug

Following error occurs in Xcode Output after disposing disposable from observeValueUpdateAndSetNotification() when bluetooth is Off:

2019-03-14 15:56:18.536575+0100 test[286:5547] [CoreBluetooth] API MISUSE: <CBPeripheral: 0x282835040, identifier = FCADF30F-882E-3766-212A-81915268838D, name = pL*****, state = disconnected> can only accept commands while in the connected state
2019-03-14 15:56:18.536898+0100 test[286:5547] [CoreBluetooth] API MISUSE: <CBCentralManager: 0x280c407c0> can only accept this command while in the powered on state

To Reproduce
Steps to reproduce the behavior:

  1. Connect to BLE device
  2. Discover services and Characteristics
  3. Call observeValueUpdateAndSetNotification(), subscribe to it and store its disposable (observeDisposable)
  4. Turn Off Bluetooth in Control Center
  5. observeDisposable?.dispose() = Dispose disposable from observeValueUpdateAndSetNotification() (performed in .observeConnection().filter{ !$0 })

Expected behavior
No Errors in XCode Output

Environment:

  • Device: iPhone SE
  • OS: 12.1.4 (build 16D57)
  • Library version: 5.1.4
  • Swift version: 4.2.1
minixT pushed a commit that referenced this issue Apr 12, 2019
* Fixed issue #319 causing "API MISUSE" warning from CoreBluetooth

* Improvements after review
@minixT
Copy link
Collaborator

minixT commented Apr 13, 2019

Fixed in version 5.2.0

@minixT minixT closed this as completed Apr 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants