Coder Social home page Coder Social logo

polidea / rxbluetoothkit Goto Github PK

View Code? Open in Web Editor NEW
1.4K 49.0 364.0 4.03 MB

iOS & OSX Bluetooth library for RxSwift

License: Apache License 2.0

Ruby 0.21% Swift 98.56% Objective-C 0.06% Shell 1.17%
rxswift bluetooth ble bluetooth-low-energy corebluetooth peripherals discover-services scans bluetooth-library rssi

rxbluetoothkit's Introduction

RxBluetoothKit library logo

CI Status Platform Carthage 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

  • Observing manager states
  • Advertising
  • Observing read & writes
  • Observing subscribe
  • Publishing L2CAP channels
  • And a lot more!

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 guidelines here.

Installation

CocoaPods

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

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 your Cartfile:

github "Polidea/RxBluetoothKit"

Then, run carthage update to build framework and drag RxBluetoothKit.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 in Package.swift file.

Getting Started

Check our Wiki with guidelines to (almost) all library functionalites.

Documentation & Support

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

Contact us

Learn more about Polidea's BLE services here.

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

rxbluetoothkit's People

Contributors

abeintopalo avatar akmarinov avatar bartoszstelmaszuk avatar bntnam avatar c0diq avatar cierpliwy avatar dariuszseweryn avatar devandartist avatar emixb avatar ferrerohub avatar hakashun avatar kacper20 avatar krezzoid avatar literator avatar minixt avatar monikamsc avatar moogle19 avatar mpiechocki avatar orgmir avatar philfi avatar pouljohn1 avatar radumvlad avatar rafaelplantard avatar robnadin avatar scibas avatar siejkowski avatar thomas3687 avatar vladcorneci avatar walkerben avatar wojciech-kulik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rxbluetoothkit's Issues

CBCentralManagerState is deprecated in iOS 10

iOS 10 deprecated CBCentralManagerState in favor of CBManagerState.

CBCentralManager.h

@available(iOS, introduced: 5.0, deprecated: 10.0, message: "Use CBManagerState instead")
public enum CBCentralManagerState : Int {
...
}

The library would need some fixes to use the new type (the values are the same).

Do you know if there's a way to have the library compile when targeting both iOS 9 and iOS 10?

.replay(1)?

Apologies for my unfamiliarity with rx operators, but can the use of .replay(1) on a stream be explained?

From my use I believe it's convenient way to multicast something? So multiple subscribers get the same underlying sequence?

.replay(1) from my understanding would then make it so both the first and second subscriber of the observable would be subscribed to the same underlying stream.

Here for example: https://github.com/Polidea/RxBluetoothKit/blob/master/Source/RxCBCentralManager.swift#L127
What does that accomplish?

Peripheral Mode Support

Are there any plans to support Peripheral Mode functionality such that we can advertise services?

i.e. the Rx counterpart of CBPeripheralManager.

Reading Multiple Characteristics

I am having difficulty reading multiple characteristics by combining observables. For some reason the Completed event fires before the values are read from the device.

`

    peripheral.peripheral.connect()
        .flatMap
        {
            Observable.combineLatest(
                $0.readValueForCharacteristicWithIdentifier(BLEDeviceCharacteristic.ManufacturerName),
                $0.readValueForCharacteristicWithIdentifier(BLEDeviceCharacteristic.ModelNumber),
                $0.readValueForCharacteristicWithIdentifier(BLEDeviceCharacteristic.SerialNumber))
            {
                (mfg, model, serial) in

                print("Manufacturer = \(mfg)")
                print("Model Number = \(model)")
                print("Serial Number = \(serial)")
            }
        }
        .subscribe { event in

            switch(event) {

            case .Next(let value):
                print("Next Value = \(value)")

            case .Error(let error):
                print("Error = \(error)")

            case .Completed:
                print("Completed")

            }
        }
        .addDisposableTo(disposeBag)

`

listenOnRestoredState() should be Public

Hi,
finaly i am going to give staterestoration a try.

In you readme you write:
Later, just make sure to subscribe to listenOnRestoredState observable, and inspect RestoredState instance, which consists any useful info about restored state.

But listenOnRestoredState() is private. Shouldn't it be public?

Cheers

Notification issue merging to Swift 3.

Hi, I'm currently updating my Swift code to the Swift 3 and I'm now experience different behaviour even though the code structure haven't changed. I am using RxBluetoothKit to write settings to a beacon and then receiving the returning notification.

The following is the code which worked in RxBluetoothKit 2.6 and Swift 2.3, but not now with RxBluetoothKit 3.0.1 and Swift 3:

...

var disposeBag: DisposeBag?
var peripheral: Peripheral?
var characteristic: Characteristic?

func start(peripheral: Peripheral, blocks: [[UInt8]]) {
    
    disposeBag = DisposeBag()
    self.peripheral = peripheral
    
    let timeout = Date(timeIntervalSinceNow: timeoutInSeconds)
    
    peripheral
        .connect()
        .flatMap { peripheral in
            peripheral.discoverServices([self.serviceUuid])
        }
        .flatMap { Observable.from($0) }
        .flatMap { service in
            service.discoverCharacteristics([self.characteristicUuid])
        }
        .flatMap { Observable.from($0) }
        .takeWhile { _ in NSDate().laterDate(timeout) == timeout }
        .take(1)
        .do(onNext: { characteristic in
            debugPrint("Found characteristic")
            self.characteristic = characteristic
            self.setWriteNotification()
            Observable.from(blocks).subscribe(onNext: { self.writeBlock(block: $0) }).addDisposableTo(self.disposeBag!)
        })
        .subscribe()
        .addDisposableTo(disposeBag!)
}

fileprivate func setWriteNotification() {
    
    characteristic?
        .setNotificationAndMonitorUpdates()
        .subscribe(onNext: { (characteristic) in
            debugPrint("Did receive characteristic update")
            if let value = characteristic.value {
                // Do stuff
            }
        }, onError: { (errorType) in
            debugPrint("Did disconnect")
        }).addDisposableTo(self.disposeBag!)
    
}

fileprivate func writeBlock(block: [UInt8]) {
    debugPrint("Write next block")
    characteristic?
        .writeValue(NSData(bytes: block, length: block.count) as Data, type: .withResponse)
        .subscribe()
        .addDisposableTo(disposeBag!)
}

func close() {
    disposeBag = nil
    
    _ = characteristic?.setNotifyValue(false).subscribe()
    characteristic = nil
    
    _ = peripheral?.cancelConnection().subscribe()
    peripheral = nil
}

...

The output to the console is:

Found characteristic
Write next block
Did disconnect

The "Did disconnect" is received after 10 seconds, since the beacon automatically closes the connection after no activity in that time. However, I should not get that message since I expect a notification so I then can call close().

Do I do something wrong here? This process worked before and the only thing I have done is updating it to the current syntax.

Thanks!

Documentation fixes

Go through documentation and check every documented method, think what to add to them to be comprehensive.

Example app

Finish example app. Currently it has only scanning & connecting functionality. Next step is to create list of services with embedded characteristics.

Scan sharing

I've just switched to the new 1.0.0 version of the RxBluetoothKit. So far it's amazing and huge thanks for it. But upgrading from 0.3.* I faced with a problem that's worked before the new version.

Based on the documentation it can share the already scanned devices if the identifiers of new scans are subsets for both scans. I used to scan with nil, but also tried with one of the advertised CBUUID.
I make the same call for both peripherals but no luck with the scan sharing. I can only make it work by terminating the scan after I found what I'm looking for.

    manager.monitorState()
      .filter { state in state == .PoweredOn }
      .take(1)
      .flatMap { _ in self.manager.scanForPeripherals([Constants.DeviceInformationService], options: nil) }
      .filter { peripheral in peripheral.peripheral.name == name }
      .take(1)
      .flatMap { $0.peripheral.connect() }

Gathered small issues and cleanups for 4.0 version

  • Cleanup namings like monitor, rx_[..] and use one way to describe function that returns observable with infinite stream of values.
  • Check if there's a better way to perform equality check of protocol and it's implementation in Swift 3(it hurts us in tests currently).
  • Write in docs that user is not able to monitor descriptors value changed from outside.
  • Make sure that docs are inline with signatures of the functions.
  • Replace deprecated OSAtomicCompareAndSwap32 and use function from <stdatomic.h>
  • Prepare wiki with most common operations
  • Make needed changes in BluetoothError structure, needed by the react-native-ble-plx lib
  • Consider generalizing functions for disconnection and expose more functions like monitorDisconnectionForAnyPeripheral -> Observable<Peripheral>

Issue with running the Example

First of all, thanks so much for building an awesome bluetooth library, at least for a newbie like me. I was trying to run the Example project and ran into some errors. Could you please point me to the right direction?

Thank you very much.

(screenshot attached)

screen shot 2016-05-23 at 12 03 43 am

Setting up notification on characteristic - possible race condition.

Hi,

So basically: when we're setting up notification on characteristic that's proper way to do it(without use of convenience functions):

characteristic.setNotifyValue(true)
    .flatMap { $0.monitorValueUpdate() }
    .subscribeNext {
        let newValue = $0.value
    }

So, first notification set is called, and after that .Next with characteristic that notification status was updated is emitted. Monitor on updates is called after that. The result is that in between of these two calls update event could happen and it'll be lost.

Possible way to prevent this behavior is to do it like this:

Observable.of(characteristic.setNotifyValue(true).ignoreElements(), characteristic.monitorValueUpdate()).merge()
.subscribeNext {
//Read value
}

But i'm worried it's too verbose to user.
So maybe we should leave it like it is(so basic two functionalities) and add to this function like setupNotificationAndMonitorUpdates, that'll work for setting notification in state ON.
We could implement this like i showed in second snippet.
What do you think?

Roadmap to 4.0 version of the library

  • Rewrite tests using RxSwift like approach.
  • Cleanup namings like monitor, rx_[..] and use one way to describe function that returns observable with infinite stream of values.
  • Implement connect as observable which will perform disconnection when dispose is called on subscribtion. Get rid of cancelConnection method.
  • Implement value changed observable, which will automatically set notification flag on characteristic and monitor value changes as long as subscribtion is valid. Get rid of currently used notification methods.
  • Check if there's a better way to perform equality check of protocol and it's implementation in Swift 3(it hurts us in tests currently).
  • Write in docs that user is not able to monitor descriptors value changed from outside.
  • Make sure that docs are inline with signatures of the functions.
  • Replace deprecated OSAtomicCompareAndSwap32 and use function from <stdatomic.h>
  • Support CBPeripheralDelegate: #66
  • Prepare wiki with most common operations
  • Support Swift Package Manager- #56
  • Think about giving access to CBPeripheral instance - #42
  • Make needed changes in BluetoothError structure, needed by the react-native-ble-plx lib

Support for state restoration and preservation

Hi,
is state restoration and preservation supported? I could not find anything in the docs.
As far as i can tell from the sourcecode, it is not implemented

Is there any plan on implementing it?

Thanks for the awesome work so far 💯 👍

RxSwift dependency version

I guess this should be defined as '2.6.0'. Otherwise we'll be getting an error:

[!] Unable to satisfy the following requirements:

  • RxSwift (= 2.6.0) required by Podfile
  • RxSwift (= 2.6.0) required by Podfile.lock
  • RxSwift (~> 2.5) required by RxCocoa (2.6.0)
  • RxSwift (= 2.6) required by RxBluetoothKit (2.0.0)

Memory leak when starting/stopping scanning

Hey there,

first of all thanks for making this awesome API. I really enjoy working with it.

Unfortunately I receive memory leaks when turning scanning on and off. First I thought it´s a problem in my application but then I tried the provided example project and the problem also exists there.

Configuration:
iPhone 6 Plus
iOS 9.3.1
RxBluetoothKit 1.2.0

Steps:

  1. Start RxBluetoothKit example project with simulator (Leaks)
  2. Repeat turning scanning On/Off. (I switched it around every 5 secons)
  3. Wait for leak to come

If you need any further info then don´t hesitate to ask. ;-)

Can you tell where this leak is coming from?

Thanks a lot!
Regards
Philipp

Access to underlying CBPeripheral

Let's say I already have an instance of RxBlueoothKit::Peripheral class available. How to get an access to underlying CBPeripheral instance? I have third-party library that performs Device Firmware Update (DFU) :
https://github.com/NordicSemiconductor/IOS-DFU-Library/tree/master/documentation

and it asks for reference to CBCentralManager and CBPeripheral, so would be great if I could just get it from already existing instance of RxBlueoothKit::Peripheral.

Thank you, your library is outstanding.

Migration to Swift 2.3

  • Adapt to changes in iOS 10 frameworks.
  • Update documentation
  • Use uniform code formatting conventions.
  • Make tests pass on iOS 10.
  • Check if compatibility is preserved when migrating from iOS 8.
  • Fix warnings regarding tests
  • Support Swift Package Manager

Observable.from error in Swift 3 app

I've have an app I'm converting from Swift 2 to Swift 3, using code that's pretty much identical to the discoverCharacteristics idiom from the README:

Observable.from($0.discoverCharacteristics([my_characteristic_uuid]))

Xcode 8.0 is producing the following error against the parameter of Observable.from() in the above:

/path/to/our/project/XferControlMessage.swift:109:43: 
Cannot convert value of type 'Observable<[Characteristic]>'
 (aka 'Observable<Array<Characteristic>>') to expected argument type '[_]'

This error reads like the compiler perhaps isn't choosing the from<S: Sequence> variant defined in Observable+Creation.swift? As I understand, the whole point of Observable.from is to convert Observable<[Characteristic]> into an observable sequence Observable<Characteristic>. So this definitely seems like either a code or documentation bug, but I'm new enough to Swift, and especially the nuances of Swift 3, that I'm not immediately clear on the root cause here.

This is using RxBluetoothKit 3.0.4 and RxSwift 3.0.0.

warnning:

[CoreBluetooth] API MISUSE: has no restore identifier but the delegate implements the centralManager:willRestoreState: method. Restoring will not be supported

Working with BLE in background

Hi! I'm going to use your library as a replacement of my custom implementation in the current project and just want to know if you handle app background/foreground transitions properly as described in the Apple docs:

Reinstantiate Your Central and Peripheral Managers
When your app is relaunched into the background by the system, the first thing you need to do is reinstantiate the appropriate central and peripheral managers with the same restoration identifiers as they had when they were first created.

https://developer.apple.com/library/ios/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/CoreBluetoothBackgroundProcessingForIOSApps/PerformingTasksWhileYourAppIsInTheBackground.html

Thanks for your efforts!

WriteValue To Characteristic

Hi,
I'm trying to write some data into a BLE device, but haven't been able to succeed yet.

struct myStruct {
    private var connection: Observable<Peripheral>
    init(device: Peripheral) {
        self.connection = device.connect()
     }
    func writeCharacteristicFromDevice(data: NSData) -> Observable<Characteristic> {
               return connection.flatMap { $0.writeValue(data, forCharacteristicWithIdentifier: DeviceCharacteristics.Write, type: .WithoutResponse) }
    }
}

this is where I'm writing the value, then somewhere else I call and subscribe to it:

        contentView.sendDataButton.rx_tap
            .subscribeNext { [weak self] in
                guard let uSelf = self else {
                    return
                }
                    uSelf.serviceHelper.writeCharacteristicFromDevice(data).subscribe(onNext: { (characteristic) in
                        print("next")
                        }, onError: { (error) in
                        print("error")
                        }, onCompleted: {
                        print("completed")
                        }, onDisposed: {
                        print("disposed")
                    }).addDisposableTo(uSelf.disposeBag)
                }
        }.addDisposableTo(disposeBag)

What happens here is: next is printed, then completed, then disposed.
If I add .WithResponse: error is printed (code=3 "writing is not permitted."), then disposed
The device's status is being monitored, it's possible to verify a successful connection, but not any writing attempt. It's as if the data is never arriving to the device.

The strange part is: the same thing was done in android with the same device and it works.
It was done using your android library RxAndroidBle. code:

connectionObservable.flatMap(rxBleConnection -> rxBleConnection.writeCharacteristic(BLE_WRITE_CHARACTERISTIC_UUID,
                                                                                          new byte[]{
                                                                                            (byte) 0xaa,
                                                                                            (byte) 0x04,
                                                                                            (byte) 0x0C,
                                                                                            (byte) 0x00,
                                                                                            (byte) 0xbb
                                                                                          }))
                          .observeOn(AndroidSchedulers.mainThread())
                          .subscribe(bytes -> {
                            onWriteSuccess();
                          }, this::onWriteFailure);

Any clues on what might be wrong? I've tried different things but nothing worked so far.

BluetoothManager.rx_state property not working

I switched to the new BluetoothManager API with version 1.1.0 using rx_state property instead of monitorState() but it seems I'm not getting state changes anymore.

Running on iPad Mini 2 WiFi, iOS 9.3.1

For now I'm sticking to the old API which works fine.

Support for CBPeripheralDelegate

To cover entirely CoreBluetooth API we need to support part of it that makes possible to use Apple device as a peripheral.
I'm not entirely sure how it'll affect the other parts of API - since in iOS 10 CBPeripheralManager and CBCentralManager are inheriting from CBManager subclass it can be a good idea to make such move in our library too. This would probably mean renaming BluetoothManager, and introduce breaking change.

Need to perform further investigations of possibilities to make it as smooth as possible.

Peripheral has to be re-architected to work with CBPeripheralManager

Currently the Peripheral object acts as a CBPeripheralDelegate. This causes some issues for the implementation of the CBPeripheralManager, since the peripheral manager needs to be able to pass around Peripheral instances.

Should Peripheral be a generic protocol that can be specialized into something like OtherDevicePeripheral (which would contain the CBPeripheralDelegate implementation) and ThisDevicePeripheral, which would not?

Notifications for value updates don't work until a subscription is made

What I'm trying to accomplish:
For my use case I have to perform multiple writes to same characteristic (e.g. sending a long string). The application splits the long message in multiple frames, then sends such frame by writing to a characteristic. The BT device reads the message and acknowledges this by updating the value of the same characteristic. At this point, my app receives the updates and proceeds to writing the next packet.

What I did:
After connecting to the peripheral I keep track of the Characteristic I need to use for writes:

    self.connectedPeripheral = peripheral.connect()
    self.dataCharacteristic = connectedPeripheral
            .flatMap {
                $0.characteristicWithIdentifier(MirrorCharacteristic.Data)
            }
            .flatMap {
                $0.setNotificationAndMonitorUpdates()
            }
            .shareReplay(1)

So far so good. When I need to send frames I have this method:

func sendData(data: NSData) -> Observable<Bool> {
    let packets = DataCharacteristicPacket.framesForData(data)

        // Turn each packet in a series of write + ack: writes a packet and then
        // waits for an ack
        let writes = packets.map { packet in
            return dataCharacteristic
                .flatMap { (characteristic: Characteristic) -> Observable<Bool> in
                    print("write")
                    return characteristic.writeValue(packet.fullPacket, type: .WithResponse)
                        .flatMap { (characteristic: Characteristic) -> Observable<Characteristic> in
                            // switch to the notification-enabled stream
                            return self.dataCharacteristic
                        }
                        .map { (characteristic: Characteristic) -> Bool in
                            // check the data we got back was an actual ack
                            // (stripped because not much of interest)
                            return true
                        }
                        .take(1)
                        .flatMap(Observable.just)
                }
        }

        // Concatenate all writes
        return writes
            .concat()
            .reduce(true) { _ in
                true // assume all writes were ok
            }
}

But it doesn't work. If in the init I explicitly subscribe to the dataCharacteristic it works as expected:

    self.dataCharacteristic
            .subscribeNext {
                print("value \($0.value)")
            }

Questions: how can I accomplish this without having to subscribe to the Characteristic? I think this should work just by subscribing to the return value of sendData() as it internally forwards the subscription up to the original Characteristic.

Any idea? What am I doing wrong?

Migration to Swift 3.0

  • Adopt new naming convention & design guidelines
  • Remove RxCocoa dependency (& related functionality)

Support for multiple service instances with same UUID

Hello,

First of all I'd like to thank you for your great work to make this awesome library.
I really like the API and it is a pleasure to work with. :)

I have a use case when the peripheral has multiple instances of a BLE service (i.e. multiple service instances with same UUID).
Each service instance have the same set of characteristics.

I have tried the following code to test if RxBluetoothKit can handle this scenario.
The code below supposed to read the value of the same characteristic for each service instances:

peripheral.connect()
    .flatMap { $0.discoverServices([serviceId]) }
    .flatMap { Observable.from($0) }
    .flatMap { $0.discoverCharacteristics([characteristicId])}
    .flatMap { Observable.from($0) }
    .flatMap { $0.readValue() }
    .subscribe(onNext: { characteristic in
        guard let data = characteristic.value else { return }
        let dataString = NSString(data: data, encoding: String.Encoding.utf8.rawValue)!
        print("Value: \(dataString)")
    })

Unfortunately, the code above prints the characteristic value only for the first service instance.
The value printing code is invoked as many times as many instances of the same service has been discovered but
it seems that the characteristic passed to "subscriber(onNext:)" will be connected only to the first discovered service instance.

I would like to ask if you know any way to get this working when there are multiple service instances with same UUID?
Any help is appreciated.

Ambiguous use of from

The library is great! Having one issue when I drag the RxBluetooth source code directly into my project. I get an error on every use of Observable.from, saying that use of from is ambiguous.

Any idea why this may be happening or how I can debug this?

Peripheral disconnection

Hey there,

Is there any way with the current version to know if a peripheral is disconnected?
If not are you planning to have an Observable that emits when the peripheral is disconnected in the near future?

RXBluetoothKit get notified on peripheral disconnect

Hi,
I'm currently trying out the RxBluetoothKit for a project and I want my app to connect to several peripherals simultaneously. Now I'd like to be notified in some way if one peripheral drops out in some way or closes the connection.

I could actively loop over the list of connected peripherals periodically and read out the isConnected property, but this seems a bit unclean to me. Is there a more elegant way to achieve this and get notified directly?

Thanks in advance :)

Library won't compile with Xcode 8

Hi,
i 've tried the main branch and the feature/swift-2.3 with the "Use Legacy Swift Language Version" set to "Yes".
I have also tried feature/swift-3.0 with this flag set to "No".

I was not able to get any of the above settings to work. Am i doing something wrong?

Thanks, m

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.