Issue metadata
Sign in to add a comment
|
Android web bluetooth characteristic change notification duplicate values
Reported by
harri...@harrisonpham.com,
Jan 29 2017
|
||||||||||||||||||||||
Issue descriptionChrome Version : Android 55.0.2883.91 (Official Build) (32-bit) and Android 58.0.2994.3 (Official Build) canary (32-bit) URLs (if applicable) : https://dev.hdpham.com/ble/nrf_uart_bug_repro.htm Other browsers tested: Add OK or FAIL, along with the version, after other browsers where you have tested this issue: Safari: Firefox: IE: What steps will reproduce the problem? (1) Navigate to https://dev.hdpham.com/ble/nrf_uart_bug_repro.htm (ignore cert error), connect to custom 'Rainbow' BLE device. This device provides a Nordic UART service that sends data using characteristic notifications. (2) Click "Send 'Hello world'" button, this will cause the device to send 10 notifications in sequence with an incrementing payload. (3) Notice that the payload values are incorrect, some are duplicated. Duplicated values change on each run. What is the expected result? Values received from the device are correct, in order, and not duplicated. What happens instead? Values received from the device are duplicated. The correct number of notifications are received, but the values are repeated. Please provide any additional information below. Attach a screenshot if possible. Additional Notes: Works correctly on Chrome OS and Mac OS X builds. Only broken on Android builds. Android apps providing Nordic UART capabilities (such as nRF UART v2.0 and Bluefruit LE) function correctly. Does not appear to be a Android API / platform bug. Appears isolated to the Chrome Android implementation. Android Device: Pixel, Android 7.1.1, Build NMF26U; Also tested on Pixel C Bluetooth Device: Custom hardware / firmwmare, hex file for Nordic nRF52 dev kit can be provided Attached: - Screenshot of output showing duplicate values - Sanitized logcat output - Sanitized blueooth HCI btsnoop log (for Wireshark)
,
Jan 29 2017
,
Feb 7 2017
It is definitely what I predicted in https://bugs.chromium.org/p/chromium/issues/detail?id=647673. Now you just verified it! The Android stack itself only sends each notification once. Since gatt callbacks (in Android's Java API that uses Binder) are serialized for each gatt object, it will always work correctly if you extract the value from the characteristic directly in the callback on the same thread. If the work to extract the characteristic value is deferred, it can of course occur at a later point when another notification has arrived, especially if you send multiple notifications in the same connection event. Due to the fact that the issue does not appear on other platforms, I'm pretty sure this must be the root cause.
,
Feb 20 2017
|
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by ortuno@chromium.org
, Jan 29 2017