Questions tagged [rxandroidble]

RxAndroidBle is a library wrapping the native Android Bluetooth Low Energy (BLE) API based on RxJava. Use this tag when asking questions related to usage of the RxAndroidBle library.

RxAndroidBle is a powerful painkiller for Android's Bluetooth Low Energy headaches. It is backed by RxJava, implementing complicated APIs as handy reactive observables.

Features:

  • Fancy asynchronous operations support (read, write, notifications)
  • Threading management in order to meet Android contracts
  • Connection and operation error handling

See also:

268 questions
0
votes
1 answer

How do I identify each BLE device from multiple notification?

I would like to write the same command to several devices and receive notification from each of them. With my current code, I am able to do this but I can't tell the MAC address corresponding to the each notification since they are all sharing the…
Noel Chew
  • 3,873
  • 2
  • 15
  • 16
0
votes
1 answer

Android BLE is NOT connecting again after BLE device timeout [Using RxAndroidBle ]

I am working on Android BLE using RxAndroidBle library. The BLE device has a timeout of 5 min if there is no interaction. i.e. The device will disconnect automatically if there is no read/write operations for 5 minutes. I am getting BleGattException…
0
votes
1 answer

Problems with unsubscribe

I'm doing an app that works as a remote control to a ventilator using RxAndroidBle. I have a problem with the unsubscribe because when I use .flatMap(rxBleConnection -> rxBleConnection.writeCharacteristic(Uuids.UUID_RX,…
0
votes
1 answer

Using createNewLongWriteBuilder with RxAndroidBLE Correctly

I have a device that can only accept 20 bytes at a time on the virtual serial port (using BLE). If I'm not mistaken, createNewLongWriteBuilder seems to be the perfect method for this. Here is my attempt: String newNameMsg = "SOME STRING THAT IS…
0
votes
0 answers

Scanning stops automatically: BluetoothAdapter: stopLeScan()

BluetoothManager is a class responsible for interaction with a ble device. It is injected as a singelton with RxBleClient and starts scanning on fragment/service's start method. Sometimes scanning is stopped automatically and sometimes after few…
0
votes
2 answers

RxAndroidBle errors on write & notification characteristic

Hi I am running RxAndroidBle in a service. I set it to auto-connect because the device wakeup in every 5 minutes and try to send data to paired device. I also set notification to get the data. It works but on every disconnect I get Notifications…
0
votes
1 answer

Problems with serializing RxAndroidBle classes

My app attempts to pass a fairly complex object that uses RxAndroidBle classes from one Android activity to another by adding it to an Intent as a Serializable extra. But I'm getting crashes, apparently due to problems with serialization of these…
Robert Lewis
  • 1,847
  • 2
  • 18
  • 43
0
votes
1 answer

How to make Android activity wait for completion of async process

Using RxAndroidBle for Bluetooth LE connections. It works to scan and identify devices with a given Service UUID (and add them to a Vector). But when I add a spinlock (actually an AtomicBoolean) in a while loop to detect when the scan is finished,…
Robert Lewis
  • 1,847
  • 2
  • 18
  • 43
0
votes
1 answer

Would it be appropriate to use Singles for RxAndroidBle reads and writes?

I'm still learning the Reactive paradigm, and just came across the Single and SingleSubscriber classes. It strikes me that these might be appropriate for "one-time" operations like reading or writing a control characteristic via BLE. Does…
Robert Lewis
  • 1,847
  • 2
  • 18
  • 43
0
votes
1 answer

Difference between Reactive Schedulers io and computation?

My app uses RxAndroidBle to asynchronously receive data packets from a BLE peripheral, and assembles them into a larger frame. It seems like Schedulers.io() would be appropriate, but we're warned (without explanation) not to do "computation" on an…
Robert Lewis
  • 1,847
  • 2
  • 18
  • 43
0
votes
1 answer

How can I get the cause of a BleScanException?

My first attempt at using RxAndroidBle. Scanning for a single instance of a specific kind of device: static boolean scanForDevice() { asScanSubscription = asBleClient .scanBleDevices( asServiceId ) // returns…
Robert Lewis
  • 1,847
  • 2
  • 18
  • 43
0
votes
1 answer

Throwable onError component of subscription not compiling as expected

Trying to set up monitoring of the RxAndroidBle connection status with an Observable. The code below compiles (I'm unable to test it yet), but I don't fully understand why. The second parameter of the subscribe call is supposed to be…
Robert Lewis
  • 1,847
  • 2
  • 18
  • 43
0
votes
1 answer

Ensuring only a single instance of the RxBleClient

Maybe I'm not understanding the situation correctly, but we're told it's important to have only one instance of the RxBleClient. Couldn't this be easily accomplished by making it a static member of the Application class? class MyApp extends…
Robert Lewis
  • 1,847
  • 2
  • 18
  • 43
0
votes
1 answer

RxBleConnection.setupNotification work for only the first of two characteristics

i'm having difficulty figuring out the unexpected behavior using RxAndroidBle. the short form of the issue is that i need to receive in-order notification from two characteristics of a particular device. in my example below, i scan for…
Steve Yohanan
  • 757
  • 5
  • 17
0
votes
1 answer

Notifying of error events down the chain without use of traditional listener

I have a fairly complex chain of Rx code which is used to perform a number of operations. Essentially when started, an Observable starts emitting a list of items. For each item, a connection is made (these items are BLE devices) and a characteristic…
Orbit
  • 2,985
  • 9
  • 49
  • 106
1 2 3
17
18