bluetooth: Empty value received from notification is not empty in characteristicvaluechanged event |
||||||||||||||
Issue descriptionGoogle Chrome 54.0.2840.6 (Official Build) dev (64-bit) Platform 8743.4.0 (Official Build) dev-channel link What steps will reproduce the problem? (1) Go to https://beaufortfrancois.github.io/sandbox/physical-web/fatbeacon/ (2) With an Android phone, broadcast FatBeacon with https://play.google.com/store/apps/details?id=physical_web.org.physicalweb (3) Click "Read FatBeacon Web Page" button What is the expected output? The Web Page should be read completely and well formatted. What do you see instead? The end of the Web Page is repeated. Going deeper, it looks like last 317 bytes are the same. Going deeeeeeper, I've noticed last event.target.value in characteristicvaluechanged event is the same as the previous one. Looking at https://github.com/google/physical-web/blob/2933ba8dace6f4961a9977be63f2ebe8b493c54b/android/PhysicalWeb/app/src/main/java/org/physical_web/physicalweb/FatBeaconBroadcastService.java#L117, last byte received should empty. I can confirm this from dbus messages as you can see below: ... signal sender=:1.25 -> dest=(null destination) serial=11670 path=/org/bluez/hci0/dev_68_2C_3B_4A_B5_01/service003d/char003e; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged string "org.bluez.GattCharacteristic1" array [ dict entry( string "Value" variant array of bytes [ 72 2e 62 6c 75 65 74 6f 6f 74 68 2e 6f 72 67 2f 54 65 63 68 6e 6f 6c 6f 67 79 4f 76 65 72 76 69 65 77 2f 70 61 67 65 73 2f 67 61 74 74 2e 61 73 70 78 22 3e 47 41 54 54 3c 2f 61 3e 20 73 65 72 76 69 63 65 20 74 68 61 74 20 6f 66 66 65 72 73 20 75 70 20 61 20 73 69 6d 70 6c 65 20 77 65 62 20 70 61 67 65 2e 3c 2f 6c 69 3e 0a 20 20 20 20 3c 2f 75 6c 3e 0a 20 20 20 20 3c 70 3e 57 68 65 6e 20 79 6f 75 20 73 65 6c 65 63 74 20 61 20 46 61 74 42 65 61 63 6f 6e 20 66 72 6f 6d 20 74 68 65 20 6c 69 73 74 20 6f 66 20 6e 65 61 72 62 79 20 62 65 61 63 6f 6e 73 2c 20 74 68 65 20 61 70 70 20 63 6f 6e 6e 65 63 74 73 20 74 6f 20 69 74 20 61 6e 64 20 64 6f 77 6e 6c 6f 61 64 73 20 74 6f 20 70 61 67 65 20 74 6f 20 79 6f 75 72 20 70 68 6f 6e 65 20 62 65 66 6f 72 65 20 64 69 73 70 6c 61 79 69 6e 67 20 69 74 2e 20 54 68 69 73 20 6d 65 61 6e 73 20 79 6f 75 20 63 61 6e 20 69 6e 74 65 72 61 63 74 20 77 69 74 68 20 61 20 46 61 74 42 65 61 63 6f 6e 20 77 69 74 68 20 6e 6f 20 64 61 74 61 20 63 6f 6e 6e 65 63 74 69 76 69 74 79 20 61 74 20 61 6c 6c 2e 3c 2f 70 3e 0a 20 20 3c 2f 64 69 76 3e 0a 20 20 3c 2f 62 6f 64 79 3e 0a 3c 2f 68 74 6d 6c 3e 0a ] ) ] array [ ] signal sender=:1.25 -> dest=(null destination) serial=11672 path=/org/bluez/hci0/dev_68_2C_3B_4A_B5_01/service003d/char003e; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged string "org.bluez.GattCharacteristic1" array [ ] array [ string "Value" ] Somehow, event.target.value is not reset. I'm not sure why...
,
Sep 2 2016
Chrome Bluetooth logs are not that helpful: ... [23585:23585:0902/092130:VERBOSE1:web_bluetooth_service_impl.cc(262)] Services discovered for device: 6B:97:19:5B:4A:E7 [23585:23585:0902/092130:VERBOSE1:web_bluetooth_service_impl.cc(158)] Looking for service: ae5946d4-e587-4ba8-b6a5-a97cca6affd3 [23585:23585:0902/092130:VERBOSE1:web_bluetooth_service_impl.cc(161)] Service in cache: ae5946d4-e587-4ba8-b6a5-a97cca6affd3 [23585:23585:0902/092130:VERBOSE1:web_bluetooth_service_impl.cc(161)] Service in cache: ae5946d4-e587-4ba8-b6a5-a97cca6affd3 [23585:23585:0902/092130:VERBOSE1:web_bluetooth_service_impl.cc(161)] Service in cache: 00001801-0000-1000-8000-00805f9b34fb [23585:23585:0902/092130:VERBOSE1:web_bluetooth_service_impl.cc(738)] Services found in device. [23585:23585:0902/092130:VERBOSE1:web_bluetooth_service_impl.cc(139)] Looking for characteristic: d1a517f0-2499-46ca-9ccc-809bc1c966fa [23585:23585:0902/092130:VERBOSE1:web_bluetooth_service_impl.cc(143)] Characteristic in cache: d1a517f0-2499-46ca-9ccc-809bc1c966fa [23585:23585:0902/092130:VERBOSE1:bluetooth_remote_gatt_characteristic_bluez.cc(278)] Sending GATT characteristic read request to characteristic: /org/bluez/hci0/dev_6B_97_19_5B_4A_E7/service0037/char0038, UUID: d1a517f0-2499-46ca-9ccc-809bc1c966fa. [23585:23585:0902/092130:VERBOSE1:bluetooth_remote_gatt_characteristic_bluez.cc(278)] Sending GATT characteristic read request to characteristic: /org/bluez/hci0/dev_6B_97_19_5B_4A_E7/service0037/char0038, UUID: d1a517f0-2499-46ca-9ccc-809bc1c966fa. [23585:23585:0902/092131:VERBOSE1:bluetooth_remote_gatt_characteristic_bluez.cc(278)] Sending GATT characteristic read request to characteristic: /org/bluez/hci0/dev_6B_97_19_5B_4A_E7/service0037/char0038, UUID: d1a517f0-2499-46ca-9ccc-809bc1c966fa. [23585:23585:0902/092131:VERBOSE1:bluetooth_remote_gatt_characteristic_bluez.cc(278)] Sending GATT characteristic read request to characteristic: /org/bluez/hci0/dev_6B_97_19_5B_4A_E7/service0037/char0038, UUID: d1a517f0-2499-46ca-9ccc-809bc1c966fa. [23585:23585:0902/092131:VERBOSE1:bluetooth_remote_gatt_characteristic_bluez.cc(278)] Sending GATT characteristic read request to characteristic: /org/bluez/hci0/dev_6B_97_19_5B_4A_E7/service0037/char0038, UUID: d1a517f0-2499-46ca-9ccc-809bc1c966fa. [23585:23585:0902/092131:VERBOSE1:bluetooth_remote_gatt_characteristic_bluez.cc(278)] Sending GATT characteristic read request to characteristic: /org/bluez/hci0/dev_6B_97_19_5B_4A_E7/service0037/char0038, UUID: d1a517f0-2499-46ca-9ccc-809bc1c966fa. [23585:23585:0902/092131:VERBOSE1:bluetooth_remote_gatt_characteristic_bluez.cc(278)] Sending GATT characteristic read request to characteristic: /org/bluez/hci0/dev_6B_97_19_5B_4A_E7/service0037/char0038, UUID: d1a517f0-2499-46ca-9ccc-809bc1c966fa. [23585:23585:0902/092131:VERBOSE1:bluetooth_remote_gatt_characteristic_bluez.cc(278)] Sending GATT characteristic read request to characteristic: /org/bluez/hci0/dev_6B_97_19_5B_4A_E7/service0037/char0038, UUID: d1a517f0-2499-46ca-9ccc-809bc1c966fa. [23585:23585:0902/092132:VERBOSE1:bluetooth_remote_gatt_characteristic_bluez.cc(278)] Sending GATT characteristic read request to characteristic: /org/bluez/hci0/dev_6B_97_19_5B_4A_E7/service0037/char0038, UUID: d1a517f0-2499-46ca-9ccc-809bc1c966fa. [23585:23585:0902/092132:VERBOSE1:bluetooth_remote_gatt_characteristic_bluez.cc(473)] Operation failed: org.bluez.Error.Failed, message: Operation failed with ATT error: 0x01
,
Sep 2 2016
,
Sep 2 2016
From #bluez-users, 14:11 <vudentz> Ive just restarted the app 14:11 <vudentz> Attempting to read /org/bluez/hci0/dev_58_C0_73_CC_FA_0C/service002b/char002c 14:11 <vudentz> [CHG] Attribute /org/bluez/hci0/dev_58_C0_73_CC_FA_0C/service002b/char002c Value is nil 14:11 <vudentz> Invalid response to read 14:12 <vudentz> Hmm I guess is not the fragmentation then, it just that we interpret as an error 0 length which perhaps is not correct 14:13 <vudentz> The reply is actually correct: method return time=1472818253.899199 sender=:1.666 -> destination=:1.284 serial=316 reply_serial=526 14:13 <vudentz> It is just the signal the is broken for some reason
,
Sep 2 2016
14:18 <vudentz> Hmm, it is actually incorrect the response shall contain a empty array, as for the signal it is working as intended as there is no value it is then omitted
,
Sep 5 2016
BlueZ folks have been fixing this bug. Thank you Luiz! mcchou can we please merge these 3 upstream patches in Chromium: - http://git.kernel.org/cgit/bluetooth/bluez.git/commit/?id=1f1c3eb8439694b654f51860e5f3ccd6bb56aa24 - http://git.kernel.org/cgit/bluetooth/bluez.git/commit/?id=16f6ec984ea2b802d13cce07964ce386f3dcf3dc - http://git.kernel.org/cgit/bluetooth/bluez.git/commit/?id=23c8c897f08f7568e1f98eefc47be7ae3da5cd54 I've tested them successfully on my machine.
,
Sep 8 2016
,
Sep 21 2016
Please see https://chromium-review.googlesource.com/#/q/topic:chromium_issue_643591+(status:open+OR+status:merged) for the new cherry-pick list. I found that http://git.kernel.org/cgit/bluetooth/bluez.git/commit/?id=16f6ec984ea2b802d13cce07964ce386f3dcf3dc depends on http://git.kernel.org/cgit/bluetooth/bluez.git/commit/?id=262145fb496cb33abaf212e8fd472c874c92ebe4, so the above list added the patch mentioned in comment #7 and the dependency.
,
Sep 21 2016
fbeaufort, can you help with testing against https://chromium-review.googlesource.com/#/q/topic:chromium_issue_643591+(status:open+OR+status:merged)? Thanks.
,
Sep 21 2016
,
Sep 21 2016
It is tested successfully: https://chromium-review.googlesource.com/#/c/387585/2
,
Sep 22 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/bluez/+/d8f01a2d5192f8c3f378fde5124d672ed863ce8e commit d8f01a2d5192f8c3f378fde5124d672ed863ce8e Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Date: Fri Sep 02 11:42:38 2016 BACKPORT: core/device: Fix attempting to connect to random address over BR/EDR BR/EDR don't have the concept of random addresses so the only option is to over LE in that case. BUG= chromium:643591 TEST=build Change-Id: I1a92ff122f6d1f5cd1135b2d0ffbe26486d392c0 Reviewed-on: https://chromium-review.googlesource.com/381752 Commit-Ready: Miao-chen Chou <mcchou@chromium.org> Tested-by: François Beaufort <fbeaufort@chromium.org> Reviewed-by: Shyh-In Hwang <josephsih@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org> [modify] https://crrev.com/d8f01a2d5192f8c3f378fde5124d672ed863ce8e/src/device.c
,
Sep 22 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/bluez/+/7cadf1d1a2ec4a4859c8b8e2eb2aa39d21230fd4 commit 7cadf1d1a2ec4a4859c8b8e2eb2aa39d21230fd4 Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Date: Mon Sep 05 09:36:44 2016 UPSTREAM: core/gatt-client: Don't invalidate Value if length is 0 Reading 0 bytes shall be valid so it shouldn't invalidate the property. BUG= chromium:643591 TEST=build Change-Id: Ibe6eb6da15ea7e3d9beb00e67a5c44fa2e43cf58 Reviewed-on: https://chromium-review.googlesource.com/381754 Commit-Ready: Miao-chen Chou <mcchou@chromium.org> Tested-by: François Beaufort <fbeaufort@chromium.org> Reviewed-by: Shyh-In Hwang <josephsih@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org> [modify] https://crrev.com/7cadf1d1a2ec4a4859c8b8e2eb2aa39d21230fd4/src/gatt-client.c
,
Sep 22 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/bluez/+/5bb5c812996c6955be8c236ebb9c569c1cb3ff13 commit 5bb5c812996c6955be8c236ebb9c569c1cb3ff13 Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Date: Mon Jun 20 14:55:44 2016 UPSTREAM: core/gatt-client: Allow clients to call ReadValue in parallel This queues ReadValue messages if the offset is the same so all the client interested in reading the attribute value are replied when the operation is completed. BUG= chromium:643591 TEST=build Change-Id: I889d049e8e9a809d40d8a6ce1b5faef40f75015c Reviewed-on: https://chromium-review.googlesource.com/387526 Commit-Ready: Miao-chen Chou <mcchou@chromium.org> Tested-by: François Beaufort <fbeaufort@chromium.org> Reviewed-by: Shyh-In Hwang <josephsih@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org> [modify] https://crrev.com/5bb5c812996c6955be8c236ebb9c569c1cb3ff13/src/gatt-client.c
,
Sep 22 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/bluez/+/1e202c73a415fea845fb4775de151ef6ea826c7d commit 1e202c73a415fea845fb4775de151ef6ea826c7d Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Date: Fri Sep 02 12:22:16 2016 UPSTREAM: core/gatt-client: Fix not return empty array for ReadValue The response to ReadValue shall be an array which can be empty. BUG= chromium:643591 TEST=build Change-Id: I06313ffaed48c7bae264ba332a3d03352e58550c Reviewed-on: https://chromium-review.googlesource.com/387527 Commit-Ready: Miao-chen Chou <mcchou@chromium.org> Tested-by: François Beaufort <fbeaufort@chromium.org> Reviewed-by: Shyh-In Hwang <josephsih@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org> [modify] https://crrev.com/1e202c73a415fea845fb4775de151ef6ea826c7d/src/gatt-client.c
,
Sep 22 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/bluez/+/390f8341928d2be3e66475d98d6d183e9affb783 commit 390f8341928d2be3e66475d98d6d183e9affb783 Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Date: Tue Sep 06 11:00:40 2016 BACKPORT: core/device: Make it more clear random addresses can only be used with LE Any random address type can only be connected over LE as BR/EDR only support public addresses. BUG= chromium:643591 TEST=build Change-Id: Ic9aa668bf13c6f99bd1654d61aa37f47b3956b10 Reviewed-on: https://chromium-review.googlesource.com/387585 Commit-Ready: François Beaufort <fbeaufort@chromium.org> Commit-Ready: Miao-chen Chou <mcchou@chromium.org> Tested-by: François Beaufort <fbeaufort@chromium.org> Reviewed-by: François Beaufort <fbeaufort@chromium.org> Reviewed-by: Shyh-In Hwang <josephsih@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org> [modify] https://crrev.com/390f8341928d2be3e66475d98d6d183e9affb783/src/device.c
,
Sep 23 2016
,
Oct 4 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/bluez/+/3b4d7545d0004487d8fd9693f8c0ce236ffcefa6 commit 3b4d7545d0004487d8fd9693f8c0ce236ffcefa6 Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Date: Fri Sep 02 11:42:38 2016 BACKPORT: core/device: Fix attempting to connect to random address over BR/EDR BR/EDR don't have the concept of random addresses so the only option is to over LE in that case. BUG= chromium:643591 TEST=build Change-Id: Ia8b3297d65272f7292f074e628e98d4d440eae9c Reviewed-on: https://chromium-review.googlesource.com/392114 Reviewed-by: Shyh-In Hwang <josephsih@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org> Commit-Queue: Miao-chen Chou <mcchou@chromium.org> Tested-by: Miao-chen Chou <mcchou@chromium.org> Trybot-Ready: Miao-chen Chou <mcchou@chromium.org> [modify] https://crrev.com/3b4d7545d0004487d8fd9693f8c0ce236ffcefa6/src/device.c
,
Oct 4 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/bluez/+/5beeb290da44cf3b59908b27d3c7f285512b7a75 commit 5beeb290da44cf3b59908b27d3c7f285512b7a75 Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Date: Fri Sep 02 12:22:16 2016 UPSTREAM: core/gatt-client: Fix not return empty array for ReadValue The response to ReadValue shall be an array which can be empty. BUG= chromium:643591 TEST=build Change-Id: Ibc4c986910c065f7673f267358b9945d413968b4 Reviewed-on: https://chromium-review.googlesource.com/392115 Reviewed-by: Shyh-In Hwang <josephsih@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org> Commit-Queue: Miao-chen Chou <mcchou@chromium.org> Tested-by: Miao-chen Chou <mcchou@chromium.org> Trybot-Ready: Miao-chen Chou <mcchou@chromium.org> [modify] https://crrev.com/5beeb290da44cf3b59908b27d3c7f285512b7a75/src/gatt-client.c
,
Oct 5 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/bluez/+/94172d6de0639a73db00ef10f156c192f8aeb57e commit 94172d6de0639a73db00ef10f156c192f8aeb57e Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Date: Mon Sep 05 09:36:44 2016 UPSTREAM: core/gatt-client: Don't invalidate Value if length is 0 Reading 0 bytes shall be valid so it shouldn't invalidate the property. BUG= chromium:643591 TEST=build Change-Id: Ib35ad05903041acad9e00d6222d3e787bce25be3 Reviewed-on: https://chromium-review.googlesource.com/392116 Trybot-Ready: Miao-chen Chou <mcchou@chromium.org> Reviewed-by: Shyh-In Hwang <josephsih@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org> Tested-by: Miao-chen Chou <mcchou@chromium.org> Commit-Queue: Miao-chen Chou <mcchou@chromium.org> [modify] https://crrev.com/94172d6de0639a73db00ef10f156c192f8aeb57e/src/gatt-client.c
,
Oct 5 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/bluez/+/067f0e42b234b94db642fa851efd1462193c9486 commit 067f0e42b234b94db642fa851efd1462193c9486 Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Date: Tue Sep 06 11:00:40 2016 BACKPORT: core/device: Make it more clear random addresses can only be used with LE Any random address type can only be connected over LE as BR/EDR only support public addresses. BUG= chromium:643591 TEST=build Change-Id: I2bffcc78244c3ef8f8796cc94c49a0031e8b8afc Reviewed-on: https://chromium-review.googlesource.com/392117 Reviewed-by: Shyh-In Hwang <josephsih@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org> Tested-by: Miao-chen Chou <mcchou@chromium.org> Commit-Queue: Miao-chen Chou <mcchou@chromium.org> Trybot-Ready: Miao-chen Chou <mcchou@chromium.org> [modify] https://crrev.com/067f0e42b234b94db642fa851efd1462193c9486/src/device.c
,
Oct 6 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/bluez/+/e17c578da4278cd574140cd6f727360a082da70d commit e17c578da4278cd574140cd6f727360a082da70d Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Date: Fri Sep 02 11:42:38 2016 UPSTREAM: core/device: Fix attempting to connect to random address over BR/EDR BR/EDR don't have the concept of random addresses so the only option is to over LE in that case. BUG= chromium:643591 TEST=emerge Change-Id: I06726a5cb16dbeaac5bcfe2d575b74a1c732c9c4 Reviewed-on: https://chromium-review.googlesource.com/394576 Trybot-Ready: Miao-chen Chou <mcchou@chromium.org> Reviewed-by: Shyh-In Hwang <josephsih@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org> Commit-Queue: Miao-chen Chou <mcchou@chromium.org> Tested-by: Miao-chen Chou <mcchou@chromium.org> [modify] https://crrev.com/e17c578da4278cd574140cd6f727360a082da70d/src/device.c
,
Oct 6 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/bluez/+/5f42feb8ca104c3fa8372ae5b38b37d725d48178 commit 5f42feb8ca104c3fa8372ae5b38b37d725d48178 Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Date: Tue Sep 06 11:00:40 2016 UPSTREAM: core/device: Make it more clear random addresses can only be used with LE Any random address type can only be connected over LE as BR/EDR only support public addresses. BUG= chromium:643591 TEST=emerge Change-Id: I5e3289e92aabe2f791e106ca92e4f4ebdbf9f3d4 Reviewed-on: https://chromium-review.googlesource.com/394577 Reviewed-by: Shyh-In Hwang <josephsih@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org> Commit-Queue: Miao-chen Chou <mcchou@chromium.org> Tested-by: Miao-chen Chou <mcchou@chromium.org> Trybot-Ready: Miao-chen Chou <mcchou@chromium.org> [modify] https://crrev.com/5f42feb8ca104c3fa8372ae5b38b37d725d48178/src/device.c
,
Oct 7 2016
,
Nov 19 2016
,
Jan 21 2017
,
Mar 4 2017
,
Apr 17 2017
,
Apr 27 2017
|
||||||||||||||
►
Sign in to add a comment |
||||||||||||||
Comment 1 by fbeaufort@chromium.org
, Sep 2 2016