Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
build/
Build/
.build/
*.pbxuser
!default.pbxuser
*.mode1v3
Expand Down
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0
5.1
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 6.1.0
- Updated RxSwift version to 6.x.x
- Migrated Carthage to SPM
- Increased deployment target for iOS 13.0, macOS 10.14, watchOS 6.0, tvOS 13.0

# 6.0.1
- iOS 17 support (#1, #2)

Expand Down
1 change: 0 additions & 1 deletion Cartfile

This file was deleted.

1 change: 0 additions & 1 deletion Cartfile.private

This file was deleted.

1 change: 0 additions & 1 deletion Cartfile.resolved

This file was deleted.

16 changes: 16 additions & 0 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// swift-tools-version:5.0
// swift-tools-version:5.1
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "RxBluetoothKit",
platforms: [
.macOS(.v10_13), .iOS(.v9), .tvOS(.v11), .watchOS(.v4)
.macOS(.v10_15), .iOS(.v13), .tvOS(.v13), .watchOS(.v6)
],
products: [
.library(name: "RxBluetoothKit", targets: ["RxBluetoothKit"])
],
dependencies: [
.package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "5.1.1"))
.package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "6.6.0"))
],
targets: [
.target(
Expand Down
14 changes: 7 additions & 7 deletions RxBluetoothKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "RxBluetoothKit"
s.version = "6.0.1"
s.version = "6.1.0"
s.summary = "Bluetooth library for RxSwift"

s.description = <<-DESC
Expand All @@ -13,16 +13,16 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/polidea/RxBluetoothKit.git", :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/polidea'

s.ios.deployment_target = '9.0'
s.osx.deployment_target = '10.13'
s.watchos.deployment_target = '4.0'
s.tvos.deployment_target = '11.0'
s.swift_version = '5.0'
s.ios.deployment_target = '13.0'
s.osx.deployment_target = '10.15'
s.watchos.deployment_target = '6.0'
s.tvos.deployment_target = '13.0'
s.swift_version = '5.1'

s.requires_arc = true

s.source_files = 'Source/*.swift'
s.osx.exclude_files = 'Source/RestoredState.swift', 'Source/CentralManager+RestoredState.swift', 'Source/CentralManagerRestoredState.swift'
s.frameworks = 'CoreBluetooth'
s.dependency 'RxSwift', '~> 5.1'
s.dependency 'RxSwift', '~> 6.6'
end
309 changes: 265 additions & 44 deletions RxBluetoothKit.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Source/CentralManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public class CentralManager: ManagerType {
return (peripheral, error)
}
return ensure(.poweredOn, observable: observable)
.catchError { error in
.catch { error in
if error is BluetoothError, let peripheral = peripheral {
return .concat(.just((peripheral, error)), .error(error))
} else {
Expand Down
4 changes: 2 additions & 2 deletions Source/Logging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ extension Reactive where Base == RxBluetoothKitLog {
*/
public var log: Observable<String> {
return RxBluetoothKitLog.subject.asObserver()
.observeOn(MainScheduler.instance)
.catchErrorJustReturn("")
.observe(on: MainScheduler.instance)
.catchAndReturn("")
.share(scope: .whileConnected)
}
}
2 changes: 1 addition & 1 deletion Tests/Autogenerated/Mock.generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import RxSwift

class CBManagerMock: NSObject {
var state: CBManagerState!
@available(iOS 13.0, macOS 10.15, watchOS 6.0, tvOS 13.0, *) lazy var authorization: CBManagerAuthorization! = nil
lazy var authorization: CBManagerAuthorization! = nil

override init() {
}
Expand Down
14 changes: 7 additions & 7 deletions Tests/PeripheralTest+CharacteristicOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class PeripheralCharacteristicOperationsTest: BasePeripheralTest {
}

func testWriteValueWithResponse() throws {
let characteristic = XCTUnwrap(_Characteristic(characteristic: createCharacteristic(uuid: "0x0001", service: service), peripheral: peripheral)
let characteristic = try XCTUnwrap(_Characteristic(characteristic: createCharacteristic(uuid: "0x0001", service: service), peripheral: peripheral))
let data = Data([0, 1, 2, 3])

let obs: ScheduledObservable<_Characteristic> = testScheduler.scheduleObservable {
Expand All @@ -88,7 +88,7 @@ class PeripheralCharacteristicOperationsTest: BasePeripheralTest {
}

func testWriteValueWithoutResponse() throws {
let characteristic = XCTUnwrap(_Characteristic(characteristic: createCharacteristic(uuid: "0x0001", service: service), peripheral: peripheral))
let characteristic = try XCTUnwrap(_Characteristic(characteristic: createCharacteristic(uuid: "0x0001", service: service), peripheral: peripheral))
let data = Data([0, 1, 2, 3])
peripheral.peripheral.canSendWriteWithoutResponse = true

Expand All @@ -107,7 +107,7 @@ class PeripheralCharacteristicOperationsTest: BasePeripheralTest {
}

func testWriteValueWithoutResponseWithCanSendWriteWithoutResponseCheckDisabled() throws {
let characteristic = XCTUnwrap(_Characteristic(characteristic: createCharacteristic(uuid: "0x0001", service: service), peripheral: peripheral))
let characteristic = try XCTUnwrap(_Characteristic(characteristic: createCharacteristic(uuid: "0x0001", service: service), peripheral: peripheral))
let data = Data([0, 1, 2, 3])
peripheral.peripheral.canSendWriteWithoutResponse = false

Expand All @@ -126,7 +126,7 @@ class PeripheralCharacteristicOperationsTest: BasePeripheralTest {
}

func testWriteValueWithoutResponseWaitingOnReadiness() throws{
let characteristic = XCTUnwrap(_Characteristic(characteristic: createCharacteristic(uuid: "0x0001", service: service), peripheral: peripheral))
let characteristic = try XCTUnwrap(_Characteristic(characteristic: createCharacteristic(uuid: "0x0001", service: service), peripheral: peripheral))
let data = Data([0, 1, 2, 3])
peripheral.peripheral.canSendWriteWithoutResponse = false

Expand Down Expand Up @@ -200,7 +200,7 @@ class PeripheralCharacteristicOperationsTest: BasePeripheralTest {

func testObserveCharacteristicIsNotifyingValue() throws {
let mockCharacteristic = createCharacteristic(uuid: "0x0001", service: service)
let characteristic = XCTUnwrap(_Characteristic(characteristic: mockCharacteristic, peripheral: peripheral))
let characteristic = try XCTUnwrap(_Characteristic(characteristic: mockCharacteristic, peripheral: peripheral))

let obs: ScheduledObservable<_Characteristic> = testScheduler.scheduleObservable {
self.peripheral.observeNotifyValue(for: characteristic)
Expand All @@ -221,7 +221,7 @@ class PeripheralCharacteristicOperationsTest: BasePeripheralTest {

func testCharacteristicIsNotifyingValueChange() throws {
let mockCharacteristic = createCharacteristic(uuid: "0x0001", service: service)
let characteristic = XCTUnwrap(_Characteristic(characteristic: mockCharacteristic, peripheral: peripheral))
let characteristic = try XCTUnwrap(_Characteristic(characteristic: mockCharacteristic, peripheral: peripheral))

let obs: ScheduledObservable<_Characteristic> = testScheduler.scheduleObservable {
characteristic.observeNotifyValue()
Expand All @@ -241,7 +241,7 @@ class PeripheralCharacteristicOperationsTest: BasePeripheralTest {
}

func testReadValue() throws {
let characteristic = XCTUnwrap(_Characteristic(characteristic: createCharacteristic(uuid: "0x0001", service: service), peripheral: peripheral))
let characteristic = try XCTUnwrap(_Characteristic(characteristic: createCharacteristic(uuid: "0x0001", service: service), peripheral: peripheral))

let obs: ScheduledObservable<_Characteristic> = testScheduler.scheduleObservable {
self.peripheral.readValue(for: characteristic).asObservable()
Expand Down
4 changes: 2 additions & 2 deletions Tests/PeripheralTest+DescriptorsOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class PeripheralDescriptorOperationsTest: BasePeripheralTest {
}

func testWriteValue() throws {
let descriptor = XCTUnwrap(_Descriptor(descriptor: createDescriptor(uuid: "0x0002", characteristic: characteristic), peripheral: peripheral))
let descriptor = try XCTUnwrap(_Descriptor(descriptor: createDescriptor(uuid: "0x0002", characteristic: characteristic), peripheral: peripheral))
let data = Data([0, 1, 2, 3])

let obs: ScheduledObservable<_Descriptor> = testScheduler.scheduleObservable {
Expand Down Expand Up @@ -136,7 +136,7 @@ class PeripheralDescriptorOperationsTest: BasePeripheralTest {
}

func testReadValue() throws {
let descriptor = XCTUnwrap(_Descriptor(descriptor: createDescriptor(uuid: "0x0001", characteristic: characteristic), peripheral: peripheral))
let descriptor = try XCTUnwrap(_Descriptor(descriptor: createDescriptor(uuid: "0x0001", characteristic: characteristic), peripheral: peripheral))

let obs: ScheduledObservable<_Descriptor> = testScheduler.scheduleObservable {
self.peripheral.readValue(for: descriptor).asObservable()
Expand Down