rxandroidble

How to correctly use UUID.fromString method?

眉间皱痕 提交于 2020-01-13 19:16:18
问题 I am trying to read/write these ble characteristics: Right now, I'm trying to read AA01* I am using this library to do it. Here's my code: private void connectToSensorTag(RxBleDevice rxBleDevice) { rxBleDevice.establishConnection(getApplicationContext(), false) .doOnError(new Action1<Throwable>() { @Override public void call(Throwable throwable) { int i = 0; } }) .flatMap(rxBleConnection -> rxBleConnection.readCharacteristic(UUID.fromString("AA01*"))) .subscribe(new Subscriber<byte[]>() {

com.polidea.rxandroidble2.exceptions.BleCharacteristicNotFoundException: Characteristic not found with UUID

ⅰ亾dé卋堺 提交于 2020-01-06 08:29:20
问题 I'm trying to read an unsolicited data stream from my Bluetooth device. The data should appear as a byte array. Unfortunately, the UUID I'm supplying doesn't seem to be the correct one. What could be going wrong? val stringDeviceUUID = rxBleDevice.bluetoothDevice.uuids[0].toString() val charUUID = UUID.fromString(stringDeviceUUID) println("$stringDeviceUUID = $charUUID?") /* If device if it is not already connected... */ if (rxBleDevice.connectionState != RxBleConnection.RxBleConnectionState

com.polidea.rxandroidble2.exceptions.BleCharacteristicNotFoundException: Characteristic not found with UUID

两盒软妹~` 提交于 2020-01-06 08:29:06
问题 I'm trying to read an unsolicited data stream from my Bluetooth device. The data should appear as a byte array. Unfortunately, the UUID I'm supplying doesn't seem to be the correct one. What could be going wrong? val stringDeviceUUID = rxBleDevice.bluetoothDevice.uuids[0].toString() val charUUID = UUID.fromString(stringDeviceUUID) println("$stringDeviceUUID = $charUUID?") /* If device if it is not already connected... */ if (rxBleDevice.connectionState != RxBleConnection.RxBleConnectionState

No virtual method com_polidea_rxandroidble_internal_radio_RxBleRadioImpl$$Lambda$1_lambda$new$0()V

我只是一个虾纸丫 提交于 2020-01-05 07:22:12
问题 I am new in Android Developement and I try to implement Bluetooth LE features on my app. I have some difficulties to run my android project with RXAndroidBLE. This library use lambda and I am not able to make it run. I have updated my gradle file: apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "25.0.2" defaultConfig { applicationId "com.example.maxime.applicationtest" minSdkVersion 18 targetSdkVersion 25 versionCode 1 versionName "1.0"

RxAndroidBle keeping a persistant connection + Write/Notification handling

我们两清 提交于 2019-12-28 06:33:48
问题 I am building an Android application that has specific requirements regarding Bluetooth Low Energy. I need to write to a Write-only characteristic and receive responses on a separate notification characteristic, and I need to do it in many, many activities. Is there a Rx way to send a request on the 1st characteristic, wait for the answer on the second one, then proceed to another request? Also, to share my instance of RxAndroidBle I thought about doing some sort of BleManager Singleton where

How to respond to BLE characteristic notifications by sending a new write command

我的未来我决定 提交于 2019-12-24 20:19:04
问题 I'm updating an app to use RxAndroidBLE, and struggling with how to translate my existing callback pattern into an Rx pattern. In particular, I need to respond to characteristic notifications in different ways depending on the received data, and send a specific write command back to the device (which will then cause the characteristic to be updated, in a loop). The rationale behind this is that the BLE device I'm integrating with has a special custom characteristic, to which we can send

Combining timeout() with retryWhen()

六月ゝ 毕业季﹏ 提交于 2019-12-22 06:55:55
问题 I'm creating a simple app for connecting with the bluetooth devices using RxAndroidBle library (Cheers Guys for great work!). What I'm experiencing is sometimes when I connect to the device I receive the Gatt error with status 133. I know it may happen so what I want to do is retry everything when that error occurs. It's not a problem, I can easily do that with retryWhen() operator, however I have another requirement - the stream has to terminate after 30 seconds if the connection wasn't

RxAndroidBle can connect to peripheral but standard Android can't

此生再无相见时 提交于 2019-12-14 03:13:19
问题 Hoping that the experts might have a tip: I've inherited some code that uses the Android BLE API. It works OK with most devices, but will not connect to one, a blood pressure monitor. I wrote a quick test app using RxAndroidBle that connects fine as long as autoConnect is true. If it's false, I get an "already connected" error. With autoConnect true, I get the same error but after a few seconds it corrects itself and connects, then works as expected. With the legacy code, the call to connect

When multiple devices connect at the same time, my app crashes with an error

二次信任 提交于 2019-12-13 22:13:49
问题 When multiple devices connect at the same time, my app crashes with the below error. Why is this, and how can I resolve it? When I force devices to connect sequentially after scanning, it works nicely. java.lang.IllegalStateException: Exception thrown on Scheduler.Worker thread. Add `onError` handling. at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:60) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android

How to receive all notifications in RxAndroidBle

我是研究僧i 提交于 2019-12-13 12:31:59
问题 I'm trying to communicate with a BLE data logger/sensor using rxBleAndroid running on both an Android phone as well as the Raspberry Pi using Android Things. I'm currently having an issue, however, where up to about 5 of the first notifications are never received by my app. I have verified that the BLE device is actually successfully sending all the expected notifications. I have done that through the nRF Connect app and everything works as expected through there. When I do it through the nRF