rxandroidble

RxAndroidBle crash on subscribe to multiple characteristics

孤者浪人 提交于 2021-02-08 11:19:33
问题 I'm currently working on an Android app for a proprietary Bluetooth Low Energy device. I decided to use RxAndroidBle and I'm happy with it's relative ease of use compared to the built-in bluetooth stack. Where I'm running into problems: I need to subscribe to two characteristics and continuously read and aggregate their values. Looking at this example page, http://polidea.github.io/RxAndroidBle/, I have been able to read multiple characteristics as per the example, but have been unsuccessful

getServiceData returns an empty array in some devices

风格不统一 提交于 2021-01-29 11:05:32
问题 Context: I have two devices with me: 1. LG G7 2. Huawei Pra LX1 I am currently using implementation "com.polidea.rxandroidble2:rxandroidble:1.10.0" When I call to Disposable scanSubscription = rxBleClient.scanBleDevices( new ScanSettings.Builder() // .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY) // change if needed // .setCallbackType(ScanSettings.CALLBACK_TYPE_ALL_MATCHES) // change if needed .build() // add filters if needed ) .subscribe( scanResult -> { // Process scan result here. },

How to disable a notification with rxandroidble?

自古美人都是妖i 提交于 2021-01-28 23:49:53
问题 I'm currently trying to use rxandroidble in order to replace the native BLE API of Android of one of our app. How to disable a notification? I'm able to enable it with the sample code, this one: device.establishConnection(context, false) .flatMap(rxBleConnection -> rxBleConnection.setupNotification(characteristicUuid)) .doOnNext(notificationObservable -> { // OK }) .flatMap(notificationObservable -> notificationObservable) .subscribe(bytes -> { // OK }); But in my product I have a use case

RxAndroidBle Multiple Characteristic Notifications and Read/Write

笑着哭i 提交于 2020-04-14 08:14:52
问题 I'm having issues setting up notifications on multiple characteristics. I've reviewed the documentation and many of the examples only cover very granular situations. My use case is as follows: 1. scan for devices 2. user selects device to connect to (with the connection persisting until the app is closed) 3. subscribe to notifications for many characteristics 4. read/write to either single characteristics at a time, and in some cases read/write to many characteristics at a time 回答1: I got it

How to concatenate two observable operations in a linear fashion (do first this thing and after that one finishes do the second thing)?

╄→гoц情女王★ 提交于 2020-02-03 08:27:08
问题 Polidea has released a new handy library called RxAndroidBle which is very useful for dealing with a lot of issues when you're using vanilla Bluetooth APIs. Before explaining more the idea is to have a POJO model that has all the recent values that the device send (or I query) to me (in this case is represented by a Map object): If I want to be notified about multiple characteristic notifications I can do this: final UUID serviceUuid = // your service UUID final Map<UUID, byte[]> genericModel

How to establish connection and then read characteristics in one activity?

有些话、适合烂在心里 提交于 2020-01-25 16:35:31
问题 Currently modifying the sample code and I am encountering an error when try to establish a connection and then read a characteristic in one activity. I am getting BleAlreadyConnectedException when attempting to read from the device. I am first connecting on onCreate. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_device); // How to listen for connection state changes bleDevice.observeConnectionStateChanges()

How to establish connection and then read characteristics in one activity?

本小妞迷上赌 提交于 2020-01-25 16:34:25
问题 Currently modifying the sample code and I am encountering an error when try to establish a connection and then read a characteristic in one activity. I am getting BleAlreadyConnectedException when attempting to read from the device. I am first connecting on onCreate. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_device); // How to listen for connection state changes bleDevice.observeConnectionStateChanges()

Writing multiple commands to characteristic

拟墨画扇 提交于 2020-01-25 09:02:04
问题 I am just discovering rxandroidble and can reliably send a single command to the BLE device after connection However I am struggling to find the best way to write a chain of commands, ie if I have a series of 3 commands that need to be sent Of course this can be done by nesting the sends, but Im sure there is a better approach!! Single command send code is rxBleMainConection.writeCharacteristic(COMS_WRITE_CHAR_UUID,bytes).toObservable() .subscribe( characteristicValue -> { // Written

Android BLE: “Scan failed, reason app registration failed for UUID”

自闭症网瘾萝莉.ら 提交于 2020-01-23 06:37:13
问题 I am developing an application using the RxAndroidBle library that performs BLE scans regularly about every 30 seconds, and some BLE operations every minute or so. After a couple of hours, usually between 5 and 24h, the scan stops working. Every time a scan is supposed to be started, I get: 09-05 09:08:37.160 8160-8160/myapp D/BluetoothAdapter: startLeScan(): null 09-05 09:08:37.165 8160-8160/myapp D/BluetoothAdapter: STATE_ON 09-05 09:08:37.165 8160-8160/myapp D/BluetoothAdapter: STATE_ON 09

Android BLE: “Scan failed, reason app registration failed for UUID”

爱⌒轻易说出口 提交于 2020-01-23 06:35:45
问题 I am developing an application using the RxAndroidBle library that performs BLE scans regularly about every 30 seconds, and some BLE operations every minute or so. After a couple of hours, usually between 5 and 24h, the scan stops working. Every time a scan is supposed to be started, I get: 09-05 09:08:37.160 8160-8160/myapp D/BluetoothAdapter: startLeScan(): null 09-05 09:08:37.165 8160-8160/myapp D/BluetoothAdapter: STATE_ON 09-05 09:08:37.165 8160-8160/myapp D/BluetoothAdapter: STATE_ON 09