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

Documentation update #218

Merged
merged 1 commit into from
Mar 13, 2018
Merged

Documentation update #218

merged 1 commit into from
Mar 13, 2018

Conversation

minixT
Copy link
Collaborator

@minixT minixT commented Mar 7, 2018

Updated Readme file and code comments to match api changes.

@minixT minixT requested a review from pouljohn1 March 7, 2018 16:27
Copy link
Contributor

@pouljohn1 pouljohn1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 👍

```swift
manager.rx_state
manager.observeState
.startWith(manager.state)
.filter { $0 == .poweredOn }
.timeout(3.0, scheduler)
.take(1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this take(1) is not needed. There won't be more than 1 event due to ensure(.poweredOn in CentralManager

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, question is, it is possible that CoreBluetooth will send poweredOn twice?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, I think CoreBluetooth sends this state each time user re-enable bluetooth in his device

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, but when it sends poweredOn, poweredOff, poweredOn then subscription is disposed due to poweredOff so poweredOn won't be called.
Problem might be when we will receive poweredOn, poweredOn, than without take(1) we will 2x start scanning.

@@ -73,13 +76,13 @@ public class Peripheral {
return peripheral.state == .connected
}

/// Current state of `Peripheral` instance described by [CBPeripheralState](https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBPeripheral_Class/#//apple_ref/c/tdef/CBPeripheralState).
/// Current state of `Peripheral` instance described by [CBPeripheralState](https://developer.apple.com/documentation/corebluetooth/cbperipheralstate).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@minixT minixT changed the base branch from feature/notification_observing to 5.0-dev March 13, 2018 13:47
@minixT minixT merged commit d703332 into 5.0-dev Mar 13, 2018
@minixT minixT deleted the feature/documentation branch March 13, 2018 13:58
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

Successfully merging this pull request may close these issues.

2 participants