Skip to content

Commit

Permalink
Merge pull request #7 from DrAma999/hotfix/ExposeConnect
Browse files Browse the repository at this point in the history
BugFix
  • Loading branch information
DrAma999 authored Aug 26, 2020
2 parents b179ee8 + 8f3325f commit 88c649c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions LittleBlueTooth.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@
"$(TOOLCHAIN_DIR)/usr/lib/swift/macosx",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 0.4.0;
MARKETING_VERSION = 0.4.1;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited) -DTEST";
Expand Down Expand Up @@ -699,7 +699,7 @@
"$(TOOLCHAIN_DIR)/usr/lib/swift/macosx",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 0.4.0;
MARKETING_VERSION = 0.4.1;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited)";
Expand Down Expand Up @@ -733,7 +733,7 @@
"$(TOOLCHAIN_DIR)/usr/lib/swift/macosx",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 0.4.0;
MARKETING_VERSION = 0.4.1;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited) -DTEST";
Expand Down Expand Up @@ -767,7 +767,7 @@
"$(TOOLCHAIN_DIR)/usr/lib/swift/macosx",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 0.4.0;
MARKETING_VERSION = 0.4.1;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited)";
Expand Down Expand Up @@ -906,7 +906,7 @@
"$(TOOLCHAIN_DIR)/usr/lib/swift/macosx",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 0.4.0;
MARKETING_VERSION = 0.4.1;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited)";
Expand Down Expand Up @@ -940,7 +940,7 @@
"$(TOOLCHAIN_DIR)/usr/lib/swift/macosx",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 0.4.0;
MARKETING_VERSION = 0.4.1;
OTHER_CFLAGS = "$(inherited)";
OTHER_LDFLAGS = "$(inherited)";
OTHER_SWIFT_FLAGS = "$(inherited)";
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The library is still on development so use at own you risk.
Add the following to your Cartfile:

```
github "DrAma999/LittleBlueTooth" ~> 0.4.0
github "DrAma999/LittleBlueTooth" ~> 0.4.1
```
Since the framework supports most of the Apple devices, you probably want to to build for a specific platform by adding the option `--platform` after the `carthage update` command. For instance:
```
Expand Down
10 changes: 5 additions & 5 deletions Sources/LittleBlueTooth/LittleBlueTooth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public class LittleBlueTooth: Identifiable {
.flatMap { [unowned self] _ in
self.ensurePeripheralReady()
}
.flatMap { [unowned self] _ in
.flatMapLatest { [unowned self] _ in
self.peripheral!.listenPublisher
}
.share()
Expand All @@ -139,7 +139,7 @@ public class LittleBlueTooth: Identifiable {
private var _peripheralStatePublisher: Publishers.MakeConnectable<AnyPublisher<PeripheralState, Never>> {
if _peripheralStatePublisher_ == nil {
_peripheralStatePublisher_ = Just(())
.flatMap {
.flatMapLatest {
self.peripheral!.peripheralStatePublisher
}
.eraseToAnyPublisher()
Expand All @@ -157,7 +157,7 @@ public class LittleBlueTooth: Identifiable {
if _peripheralChangesPublisher_ == nil {
_peripheralChangesPublisher_ =
Just(())
.flatMap {
.flatMapLatest {
self.peripheral!.changesPublisher
}
.eraseToAnyPublisher()
Expand Down Expand Up @@ -670,14 +670,14 @@ public class LittleBlueTooth: Identifiable {
/// Starts connection for `PeripheralIdentifier`
/// - parameter options: Connecting options same as CoreBluetooth central manager option.
/// - returns: A publisher with the just connected `Peripheral`.
func connect(to peripheralIdentifier: PeripheralIdentifier, timeout: TimeInterval? = nil, options: [String : Any]? = nil, queue: DispatchQueue = DispatchQueue.main) -> AnyPublisher<Peripheral, LittleBluetoothError> {
public func connect(to peripheralIdentifier: PeripheralIdentifier, timeout: TimeInterval? = nil, options: [String : Any]? = nil, queue: DispatchQueue = DispatchQueue.main) -> AnyPublisher<Peripheral, LittleBluetoothError> {
return connect(to: peripheralIdentifier, options: options, queue: queue, autoreconnect: false)
}

/// Starts connection for `PeripheralDiscovery`
/// - parameter options: Connecting options same as CoreBluetooth central manager option.
/// - returns: A publisher with the just connected `Peripheral`.
func connect(to discovery: PeripheralDiscovery, timeout: TimeInterval? = nil, options: [String : Any]? = nil) -> AnyPublisher<Peripheral, LittleBluetoothError> {
public func connect(to discovery: PeripheralDiscovery, timeout: TimeInterval? = nil, options: [String : Any]? = nil) -> AnyPublisher<Peripheral, LittleBluetoothError> {
if cbCentral.isScanning {
scanning?.cancel()
scanning = nil
Expand Down

0 comments on commit 88c649c

Please sign in to comment.