Characteristic change event not received
See original GitHub issueSummary
A characteristic change event is logged but never received through the subscribed observable when a CharacteristicChangeEvent is fired while the notification is being setup
Preconditions
A RxBleDevice is connected and has a characteristic with indication property #### Steps to reproduce actual result
1. connect to a BluetoothDevice
2. setup indications
Observable.combineLatest(
connection.setupIndication(UUID.fromString(00008a82-0000-1000-8000-00805f9b34fb)),
connection.setupIndication(UUID.fromString(00008a91-0000-1000-8000-00805f9b34fb)),
(indication1, indication2) -> { return indication1;})
.flatMap(observable-> observable)
.doOnNext(bytes -> { log.d(bytes) })
.subscribe();
- As soon as onDescriptor write is fired a onChangeEvent happens that the observable never sees
Actual result
No log
Expected result
Log of bytes
Actual Log: Galaxy s6 6.0.1
D/RxBle#Radio: FINISHED RxBleRadioOperationConnect(149819350)
D/BluetoothGatt: onClientConnParamsChanged() - Device=98:7B:F3:6B:F9:99 interval=6 status=0
D/RxBle#Radio: QUEUED RxBleRadioOperationServicesDiscover(8272968)
D/RxBle#Radio: STARTED RxBleRadioOperationServicesDiscover(8272968)
D/BluetoothGatt: discoverServices() - device: 98:7B:F3:6B:F9:99
D/BluetoothGatt: onSearchComplete() = Device=98:7B:F3:6B:F9:99 Status=0
D/RxBle#BluetoothGatt: onServicesDiscovered status=0
D/BluetoothGatt: setCharacteristicNotification() - uuid: 00008a82-0000-1000-8000-00805f9b34fb enable: true
D/RxBle#Radio: QUEUED RxBleRadioOperationDescriptorWrite(72475096)
D/RxBle#Radio: FINISHED RxBleRadioOperationServicesDiscover(8272968)
D/RxBle#Radio: STARTED RxBleRadioOperationDescriptorWrite(72475096)
D/BluetoothGatt: onClientConnParamsChanged() - Device=98:7B:F3:6B:F9:99 interval=39 status=0
D/RxBle#BluetoothGatt: onDescriptorWrite descriptor=00002902-0000-1000-8000-00805f9b34fb status=0
**D/RxBle#BluetoothGatt: onCharacteristicChanged characteristic=00008a82-0000-1000-8000-00805f9b34fb**
D/RxBle#Radio: FINISHED RxBleRadioOperationDescriptorWrite(72475096)
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
onchange event not fire when the change come from another ...
The change event occurs when a control loses the input focus and its value has been modified since gaining focus. This event is...
Read more >HTMLElement: change event - Web APIs | MDN
The change event is fired for , , and elements when the user modifies the element's value. Unlike the input event, the change...
Read more >string control value change event not triggering - NI Community
i am trying to scan a barcode with a usb HID barcode scanner. i am using an event structure to detect the value...
Read more >Setting and modifying a change event on a feature in ...
First, you don't change values by modifying internal feature property .values_ . Internal OL properties should never be modifed directly. The ...
Read more >Learn Change Data Capture Characteristics Unit - Trailhead
Change Data Capture can generate change events for all custom objects defined in your Salesforce org and a subset of standard objects.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @dariuszseweryn, thanks for taking a look at this. For us, yes, receiving the indication is important to the transmission.
Our use case is that when we subscribe to the characteristic it fires a characteristic change event with a value. We then write to another characteristic which causes us to receive another characteristic change event with another value that we combine into a key.
I have had better results when writing the client descriptor myself while starting to observe the change event from RxBleGattCallback.
It will require 1.2.0. I believe I posted how I got it to work in the thread. It requires setting up the notification with the NotificationCompat option. connection.setupNotification(uuid, NotificationSetupMode.COMPAT) .flatmap { notification -> return notification.mergeWith(connection.writeDescriptor(descriptor_uuid, BluetoothGattDescriptor.ENABLE_NOTIFICATIONS).ignoreElements())
note the ignoreElements() method at the end. This merges the notification byte[] stream with the descriptorWrite byte[] stream but the write for the descriptor is ignored.
combineLatest() also works as mentioned in the thread. connection.writeDescriptor is a completeable in the rxjava2 version and therefore does not emit any values. Good luck!
Griffin
On Sat, Aug 11, 2018 at 7:44 AM SogoodIT notifications@github.com wrote: