Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

iOS & OSX Bluetooth library for RxSwift

License

NotificationsYou must be signed in to change notification settings

Polidea/RxBluetoothKit

Repository files navigation

RxBluetoothKit library logo

CI StatusPlatformCarthage Compatible

RxBluetoothKit is a Bluetooth library that makes interaction with BLE devices much more pleasant. It's backed by RxSwift and CoreBluetooth and it provides nice API, for both Central and Peripheral modes. All to work with and make your code more readable, reliable and easier to maintain.

Here is a sneak peek of what you can do with RxBluetoothKit:

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)")})

With just 9 lines it started scanning, connecting to the peripheral, discovering service and characteristics and read charecteristic's value!

Central mode features

Peripheral mode features

Recent Changes

6.0.0

  • Increased deployment target for iOS to 9.0 and for osx to 10.13 (#379, #380)
  • Added support for observing ancsAuthorized property on peripheral. (#370)
  • Added Bluetooth usage description to Info.plist in Example project (#369)
  • Added initial state improvement & a minor fix for BluetoothState methods. (#371)
  • Fixed problems with SPM support (#358, #368)
  • Updated RxSwift version to 5.1 (#376)
  • Updated project configurations to decrease build time on TravisCI (#376)
  • Updated scripts to fixed problems with generating mocks (#378)

All previous changes

Want to migrate from 4.x to 5.x? Check guidelineshere.

Installation

CocoaPods

CocoaPods is a dependency manager for CocoaProjects.To integrate RxBluetoothKit into your Xcode project using CocoaPods specify it in yourPodfile:

pod'RxBluetoothKit'

Then, run the following command:$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.To integrate RxBluetoothKit into your Xcode project using Carthage specify it in yourCartfile:

github"Polidea/RxBluetoothKit"

Then, runcarthage update to build framework and dragRxBluetoothKit.framework into your Xcode project.

Swift Package Manager

Versions >= 4.0 of the library integrate with the Swift Package Manager. In order to do that please specify our project as one of your dependencies inPackage.swift file.

Getting Started

Checkour Wiki with guidelines to (almost) all library functionalites.

Documentation & Support

Remember to followPolidea's Blog blog to get all the news and updates!

Contact us

Learn more about Polidea's BLE serviceshere.

Requirements

  • iOS 9.0+
  • OSX 10.13+
  • watchOS 4.0+
  • tvOS 11.0+
  • Xcode 11.4+

Swift versions

  • 3.0 version supports Swift 3.0 and 3.1
  • 5.0 version supports Swift 3.2 and 4.0
  • 5.1.2 version supports Swift 4.1
  • 5.2 version supports Swift 5.0 and 4.2

[8]ページ先頭

©2009-2025 Movatter.jp