RxBluetooth is a Bluetooth library for Android reactive Bluetooth. RxBluetooth is just wrapper around android BluetoothAdapter that allows to receive data from observables.
Questions tagged [rxbluetooth]
19 questions
1
vote
1 answer
DistinctUntilChanged only compares equal values
let manager = CentralManager(queue: .main)
manager.observeStateWithInitialValue()
.filter {$0 == .poweredOn}
.flatMap { _ in manager.scanForPeripherals(withServices: [CBUUID.myDevice.mainService])}
.filter { $0.peripheral.identifier ==…

Eddy
- 274
- 3
- 17
1
vote
2 answers
How do I stop RxSwift ble scanner once it has found a match?
I have a ble scanner that works and looks like this:
func scan(serviceId: String) -> Observable<[BleHandler.BlePeripheral]> {
knownDevices = []
return waitForBluetooth()
.flatMap { _ in self.scanForPeripheral(serviceId: serviceId) }
…

Joakim Sjöstedt
- 824
- 2
- 9
- 18
1
vote
0 answers
RXBle Start scan does not work on Android 10 (Huawei P30)
I have problem to start BLE scan on Huawei P30 running on Android 10.
It works on Huawei P20 running Android 9 and many other devices, but Android 10 is weird.
In application I have Start Scan button, so this is scan when application is running(no…

Martin K
- 61
- 1
- 10
1
vote
1 answer
How do I get from Observable to BleHandler.BlePeripheral?
I have a variable that gets me the type Observable after using flatMap on the array.
let scannedPeripheral: Observable = instance.bleScan()
.flatMap{ Observable.from($0)}
But now I…

screenMonkey MonkeyMan
- 393
- 3
- 17
1
vote
0 answers
RxAndroidBLE: The mapper returned a null SingleSource
I use the following code to listen for an unsolicited message from my Bluetooth LE device. I am expecting a byte array with text that says "datc00099", for example. Instead, the mapper is returning a null SingleSource. What could be going wrong…

Martin Erlic
- 5,467
- 22
- 81
- 153
1
vote
0 answers
How to concatenate several subscriptions to a Disposable in RxSwift with RxBluetooth?
With RxBluetooth it never has been easier to connect to a CBPeripheral:
disposable = peripheral.establishConnection()
.flatMap { $0.discoverServices([serviceId]) }.asObservable()
.flatMap { Observable.from($0) }
.flatMap {…

Pau Senabre
- 4,155
- 2
- 27
- 36
1
vote
0 answers
Extracting Data via flatMap does not call subscribe
I am trying to extract information from observable with flatMap but it won't call subscribe after that. When I return Observable.just(it) from flatMap subscribe is called as expected but then I am not able to get the…

Kebab Krabby
- 1,574
- 13
- 21
1
vote
1 answer
Chaining multiple commands in RxBluetoothKit
Previously I had this question regarding the awesome rxAndroidBle - Writing multiple commands to characteristic
The solution works great!
Now the time has come to port this app over to an iOS version and I am struggling to find a suitable way to…

Joel Spencer
- 129
- 1
- 8
0
votes
1 answer
onScanFailure after a certain of time when scanning ble devices in android
I am using rxbleandroid library for scanning Bluetooth devices
fun startScan() {
if(rxBleClient.isScanRuntimePermissionGranted) {
Log.d("TAG", "All permission granted")
}
else {
Log.d("TAG", "Not all permission…

Teddy Consultant
- 53
- 6
0
votes
2 answers
Difference BLE throughput between PC and mobile(android)
I'm trying to receive data in mobile(android) devices from a BLE device based on nRF52840 and custom firmware.
Here is my setting
sampling rate : 250Hz
mobile devices : Galaxy flip z 3, Galaxy S22
Used library : RxBleAndroid
To check whether the…

LYG
- 41
- 1
- 7
0
votes
0 answers
Write chunk of bytes one by one using writeCharacteristics using RxAndroidBLE
I am trying to write the file to the controller using RxAndroidBLE library. Currently, i am reading a file and converting int byte[] and sending it to in chuck of 244.
To perform this task i am using below flow
.flatMap(bytes ->…

Hunt
- 8,215
- 28
- 116
- 256
0
votes
1 answer
Zip list of observables into another Zip observable RxJava2
I am trying to zip the list of zip Observables but the issue is I am only getting the same values from the zipped observables every time. The reason why I am doing this is to perform two operations 1st reading index and 2nd reading data from ble for…

Hunt
- 8,215
- 28
- 116
- 256
0
votes
1 answer
How do I deal with "Ambiguous reference to member '=='" in RxBluetoothKit?
Trying to scan for Bluetooth peripherals using RxBluetoothKit I get an error called
"Ambiguous reference to member '=='
using this code:
func observeState() -> Observable<[BluetoothState]> {
return manager.observeState()
…

screenMonkey MonkeyMan
- 393
- 3
- 17
0
votes
1 answer
Updating Firebase causes RxBLE crash
Okay, so I'm having some very odd behaviour that doesn't make much sense in my app.
My app uses BLE and I have a static class which I initialize on app launch, this typically works with no issue.
Today I made a single change in my app which was to…

Quinn
- 7,072
- 7
- 39
- 61
0
votes
0 answers
Core Bluetooth receives data from Peripheral in Background Mode continuously for more than 80 hours
I am working on an healthcare product for in hand experience to receive ECG Data with the help ECG Detection BLE Peripheral and iOS App.
This app will be installed on the patient iPhone/iPad and patient will have a BLE accessory and which will send…

Mani Palanivel
- 73
- 8