Newblue: implement Device D-Bus interfaces |
|||
Issue descriptionThis bug tracks the implementation of Device D-Bus interface. The following functions and properties of Device interface are marked as y: required, n: not required, o: optional Functions Connect y Disconnect y ConnectProfile y DisconnectProfile y Pair y CancelPairing y GetServiceRecords n ExecuteWrite o (ARC++) Properies Address y Name y Icon y Class y Type y Appearance y UUIDs y Paired y Connected y Trusted y Blocked o Alias y Adapter y LegacyPairing n Modalias y RSSI y TxPower o ManufacturerData y ServiceData y ServicesResolved y AdvertisingFlags y MTU o (ARC++)
,
Jul 26
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/accf4ed2d762f49a49e45c45c49e3f3e0da16296 commit accf4ed2d762f49a49e45c45c49e3f3e0da16296 Author: Miao-chen Chou <mcchou@chromium.org> Date: Thu Jul 26 11:07:39 2018 bluetooth: Add utility functions and a generic UUID class for EIR parsing This provides utility functions to retrieve numbers/bytes in host order from little-endian byte stream which is adopted in Bluetooth traffic. This also provides a generic UUID class to represent UUIDs in 16-bit, 32-bit and 128-bit formats. UtilTest and UUIDTest unit tests are added. As the preparation of the incoming Device D-Bus interface, some unused EIR types are removed and some are added. For those added, the parsing logic is added correspondingly. BUG=chromium:863613 TEST=run FEATURES=test emerge-$BOARD bluetooth and verify that all unit tests pass Change-Id: I70e05075f1be6c19ca367aec6a7638f65b66c533 Reviewed-on: https://chromium-review.googlesource.com/1137473 Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org> Tested-by: Miao-chen Chou <mcchou@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org> [add] https://crrev.com/accf4ed2d762f49a49e45c45c49e3f3e0da16296/bluetooth/newblued/util.cc [modify] https://crrev.com/accf4ed2d762f49a49e45c45c49e3f3e0da16296/bluetooth/newblued/newblue_unittest.cc [modify] https://crrev.com/accf4ed2d762f49a49e45c45c49e3f3e0da16296/bluetooth/newblued/newblue.cc [modify] https://crrev.com/accf4ed2d762f49a49e45c45c49e3f3e0da16296/bluetooth/newblued/newblue.h [add] https://crrev.com/accf4ed2d762f49a49e45c45c49e3f3e0da16296/bluetooth/newblued/util.h [add] https://crrev.com/accf4ed2d762f49a49e45c45c49e3f3e0da16296/bluetooth/newblued/util_unittest.cc [modify] https://crrev.com/accf4ed2d762f49a49e45c45c49e3f3e0da16296/bluetooth/bluetooth.gyp [add] https://crrev.com/accf4ed2d762f49a49e45c45c49e3f3e0da16296/bluetooth/newblued/uuid.cc [modify] https://crrev.com/accf4ed2d762f49a49e45c45c49e3f3e0da16296/bluetooth/newblued/newblue_daemon.cc [add] https://crrev.com/accf4ed2d762f49a49e45c45c49e3f3e0da16296/bluetooth/newblued/uuid_unittest.cc [add] https://crrev.com/accf4ed2d762f49a49e45c45c49e3f3e0da16296/bluetooth/newblued/uuid.h [modify] https://crrev.com/accf4ed2d762f49a49e45c45c49e3f3e0da16296/bluetooth/newblued/newblue_daemon_unittest.cc
,
Aug 8
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/system_api/+/21991ada7903f07aa3f019f289797f9ac8ca64a1 commit 21991ada7903f07aa3f019f289797f9ac8ca64a1 Author: Miao-chen Chou <mcchou@chromium.org> Date: Wed Aug 08 20:45:52 2018 service_contants: Add kErrorAlreadyExists to bluetooth_device namespace BUG=chromium:863613 TEST=none Change-Id: Ic7207bcabc858ae33d870c592e834d83d3c70550 Reviewed-on: https://chromium-review.googlesource.com/1166455 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Miao-chen Chou <mcchou@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org> [modify] https://crrev.com/21991ada7903f07aa3f019f289797f9ac8ca64a1/dbus/service_constants.h
,
Aug 23
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/3f62d6db2bc8ec172feaa9ab19481ec2818780b6 commit 3f62d6db2bc8ec172feaa9ab19481ec2818780b6 Author: Sonny Sasaka <sonnysasaka@chromium.org> Date: Thu Aug 23 20:20:50 2018 bluetooth: Fix advertising flags causing Chrome crash Apparently Chrome expects that advertising flags contains at least 1 byte if set. Having zero-length advertising flags cause Chrome to crash. BUG=chromium:863613 TEST=Use Chrome to communicate to newblued and it no longer crashes Change-Id: I141b41ca9f99e1b16cc83c7b20566bc201173075 Reviewed-on: https://chromium-review.googlesource.com/1184375 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org> [modify] https://crrev.com/3f62d6db2bc8ec172feaa9ab19481ec2818780b6/bluetooth/newblued/newblue.cc [modify] https://crrev.com/3f62d6db2bc8ec172feaa9ab19481ec2818780b6/bluetooth/newblued/newblue_unittest.cc
,
Aug 29
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/92ce0a947a8949a13cccf7b35d27164368e5cc7e commit 92ce0a947a8949a13cccf7b35d27164368e5cc7e Author: Sonny Sasaka <sonnysasaka@chromium.org> Date: Wed Aug 29 18:14:52 2018 bluetooth: Set default advertising flags Chrome crashes with zero-length advertising flags. TODO(crbug.com/876908) to fix the Chrome side also. BUG=chromium:863613 TEST=Use Chrome to communicate to newblued and it no longer crashes Change-Id: I1e4f6f2712e8cc98ba5328502d7104b23386d107 Reviewed-on: https://chromium-review.googlesource.com/1188790 Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org> Tested-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org> [modify] https://crrev.com/92ce0a947a8949a13cccf7b35d27164368e5cc7e/bluetooth/newblued/newblue.cc [modify] https://crrev.com/92ce0a947a8949a13cccf7b35d27164368e5cc7e/bluetooth/newblued/newblue_unittest.cc
,
Sep 8
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/newblue/+/26a590ae6bf01f25a336da849dde93ed005c0169 commit 26a590ae6bf01f25a336da849dde93ed005c0169 Author: Miao-chen Chou <mcchou@chromium.org> Date: Sat Sep 08 23:51:55 2018 Reland "sm: update IO capability based on the presence of passkey request/display observers" This is a reland of 2495a5a717c306cad1bcaf2ba51e62c229c46b18 Original change's description: > sm: update IO capability based on the presence of passkey request/display observers > > The IO capability should be updated based on whether there are handlers > for passkey display and passkey request. If there is any ongoing pairing > when a client register itself as the observer, the IO capability will be > updated once the current pairing session is done. > > BUG= chromium:862849 > TEST=Run the test program on veyron_minnie with "restart bluetoothd && > new_blue_test pair <the target LE keyboard address>" and enter passkey on > the target LE keyboard > > Change-Id: I0eb38d49d5b317f0ba184910741af93f3c102b1e BUG=chromium:863613 TEST=See above CQ-DEPEND=CL:1186082 Change-Id: I3a208a987c003e64a24003c31827805238d70e44 Reviewed-on: https://chromium-review.googlesource.com/1186042 Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org> Tested-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org> [modify] https://crrev.com/26a590ae6bf01f25a336da849dde93ed005c0169/sm.c [modify] https://crrev.com/26a590ae6bf01f25a336da849dde93ed005c0169/sm.h [modify] https://crrev.com/26a590ae6bf01f25a336da849dde93ed005c0169/test.c
,
Sep 10
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/bluez/+/91886ee136e3ebdea8e4080eaf14e6953807448f commit 91886ee136e3ebdea8e4080eaf14e6953807448f Author: Miao-chen Chou <mcchou@chromium.org> Date: Mon Sep 10 08:13:28 2018 CHROMIUM: client: add cancel-pairing command This adds cancel-pairing command which can be used to cancel the ongoing pairing. BUG=chromium:863613 TEST=Run bluetoothctl, pair and immediately cancel the pairing Change-Id: I1ccaab5f946162e9011f5b82b03b5d2782dbf580 Reviewed-on: https://chromium-review.googlesource.com/1187195 Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org> Tested-by: Miao-chen Chou <mcchou@chromium.org> Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Miao-chen Chou <mcchou@chromium.org> Reviewed-by: Qiyu Hu <qiyuh@google.com> [modify] https://crrev.com/91886ee136e3ebdea8e4080eaf14e6953807448f/client/main.c
,
Sep 16
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/2b05a73c65b4cbd32f8c71c76b254e531092aa17 commit 2b05a73c65b4cbd32f8c71c76b254e531092aa17 Author: Miao-chen Chou <mcchou@chromium.org> Date: Sun Sep 16 11:04:18 2018 bluetooth: Handle Pair and CancelPairing methods for org.bluez.Device1 interface This adds a helper function for registering an async D-Bus handler to object manager wrapper, so that we can register the handlers of Pair and CancelPairing and reply to the method call later. This also adds unit tests for Pair and CancelPair to newblue_unittest. There can be only one active pairing at a time, and this is enforced by having a struct representing the ongoing pairing session. Once newblued hears back from pair state changes, we send the response(s) to the method call(s). Based on the appearance/type of the devices, newblued set the security requirement accordingly. For instance, MITM protection is set to false for mouses but true for keyboards. It is worth noting that security manager's IO capability is set to "no input no display" in the first place until any client register itself as the observer of passkey display/request; therefore this patch is tested only with BLE mouses. BUG=chromium:863613 TEST=(1) run FEATURES=test emerge-$BOARD bluetooth and verify that all unit tests pass (2) run newblued manually with restart bluetoothd && minijail0 -u bluetooth -- /usr/bin/newblued and verify that Pair/CancelPairing method calls work with bluetoothctl --service=org.chromium.Newblue CQ-DEPEND=CL:1186082 Change-Id: Icc66276c6c998e27d131a0d694e87e176608a497 Reviewed-on: https://chromium-review.googlesource.com/1187568 Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org> Tested-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org> [modify] https://crrev.com/2b05a73c65b4cbd32f8c71c76b254e531092aa17/bluetooth/newblued/libnewblue.h [modify] https://crrev.com/2b05a73c65b4cbd32f8c71c76b254e531092aa17/bluetooth/newblued/util.cc [modify] https://crrev.com/2b05a73c65b4cbd32f8c71c76b254e531092aa17/bluetooth/newblued/newblue_unittest.cc [modify] https://crrev.com/2b05a73c65b4cbd32f8c71c76b254e531092aa17/bluetooth/newblued/newblue.cc [modify] https://crrev.com/2b05a73c65b4cbd32f8c71c76b254e531092aa17/bluetooth/newblued/newblue.h [modify] https://crrev.com/2b05a73c65b4cbd32f8c71c76b254e531092aa17/bluetooth/newblued/newblue_daemon.h [modify] https://crrev.com/2b05a73c65b4cbd32f8c71c76b254e531092aa17/bluetooth/newblued/util.h [modify] https://crrev.com/2b05a73c65b4cbd32f8c71c76b254e531092aa17/bluetooth/common/exported_object_manager_wrapper.h [modify] https://crrev.com/2b05a73c65b4cbd32f8c71c76b254e531092aa17/bluetooth/newblued/mock_libnewblue.h [modify] https://crrev.com/2b05a73c65b4cbd32f8c71c76b254e531092aa17/bluetooth/newblued/mock_newblue.h [modify] https://crrev.com/2b05a73c65b4cbd32f8c71c76b254e531092aa17/bluetooth/newblued/newblue_daemon.cc [modify] https://crrev.com/2b05a73c65b4cbd32f8c71c76b254e531092aa17/bluetooth/newblued/util_unittest.cc [modify] https://crrev.com/2b05a73c65b4cbd32f8c71c76b254e531092aa17/bluetooth/newblued/newblue_daemon_unittest.cc
,
Sep 16
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/90696a59b7e5a7dfba07e9efaa17cc46993d942b commit 90696a59b7e5a7dfba07e9efaa17cc46993d942b Author: Sonny Sasaka <sonnysasaka@chromium.org> Date: Sun Sep 16 11:04:20 2018 bluetooth: Allow access to /dev/uhid for newblued For future UHID integration, newblued needs access to /dev/uhid. BUG=chromium:863613 TEST=Tested with open("/dev/uhid", O_RDWR) Change-Id: I78b895b824fc76597761fecd4a66ec4aafb8cfb6 Reviewed-on: https://chromium-review.googlesource.com/1219978 Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org> Tested-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Qiyu Hu <qiyuh@google.com> [modify] https://crrev.com/90696a59b7e5a7dfba07e9efaa17cc46993d942b/bluetooth/init/upstart/newblued.conf
,
Sep 16
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/baa1aaeff4c3a4785016d75082a467e02586bb3e commit baa1aaeff4c3a4785016d75082a467e02586bb3e Author: Sonny Sasaka <sonnysasaka@chromium.org> Date: Sun Sep 16 11:04:21 2018 bluetooth: Move common helpers to util.h Some of stuff in NewblueDaemon will be reusable by other components for future pairing agent work, so we better move it to util.h. BUG=chromium:863613 TEST=Unit test doesn't regress Change-Id: I8045741f69c4a8764e1358b83ebd3daf87ada120 Reviewed-on: https://chromium-review.googlesource.com/1224633 Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org> Tested-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org> [modify] https://crrev.com/baa1aaeff4c3a4785016d75082a467e02586bb3e/bluetooth/newblued/util_unittest.cc [modify] https://crrev.com/baa1aaeff4c3a4785016d75082a467e02586bb3e/bluetooth/newblued/util.cc [modify] https://crrev.com/baa1aaeff4c3a4785016d75082a467e02586bb3e/bluetooth/newblued/newblue_daemon.cc [modify] https://crrev.com/baa1aaeff4c3a4785016d75082a467e02586bb3e/bluetooth/newblued/util.h [modify] https://crrev.com/baa1aaeff4c3a4785016d75082a467e02586bb3e/bluetooth/newblued/newblue_daemon_unittest.cc
,
Sep 16
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/853a907630e68208ac4adc9b65af99bf5cc0675a commit 853a907630e68208ac4adc9b65af99bf5cc0675a Author: Sonny Sasaka <sonnysasaka@chromium.org> Date: Sun Sep 16 11:04:19 2018 bluetooth: Add some NOLINT for casting BUG=chromium:863613 TEST=Builds, no lint error when repo upload Change-Id: I9c72518ad30e0f7de70181178776b50dcd038908 Reviewed-on: https://chromium-review.googlesource.com/1224634 Commit-Ready: Sonny Sasaka <sonnysasaka@chromium.org> Tested-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org> Reviewed-by: Qiyu Hu <qiyuh@google.com> [modify] https://crrev.com/853a907630e68208ac4adc9b65af99bf5cc0675a/bluetooth/newblued/libnewblue.h
,
Oct 9
,
Dec 14
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/ba5aef3e357e9651c7caa7d529465de61bacc0c1 commit ba5aef3e357e9651c7caa7d529465de61bacc0c1 Author: Miao-chen Chou <mcchou@chromium.org> Date: Fri Dec 14 03:27:57 2018 bluetooth: Keep the UUIDs from previous EIR if none is provided in a new EIR In BT spec, it is recommended that a HID device "should" include HID service as an AD field. However, some HID devices do not provide any UUID in some ADV packets, and this leads to empty service UUID list. As a result, HID service UUID will not show up in UUIDs device property, and Chrome UI will not present a HID device without HID service UUID presented in UUIDs device property. As a mitigation, this patch changes the UUID caching so that the previous service UUID list will not be wiped out if no service UUID is presented in an incoming ADV packet. The same caching logic is applied to service data as well. BUG=chromium:863613 TEST=verify that HID service UUID shows up for Logitech K870 keyboard with bluetoothctl --service=org.chromium.Newblue Change-Id: I1c55e9d0df4e15ca7e8b5ecfc10b7ee10e944a03 Reviewed-on: https://chromium-review.googlesource.com/1358717 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Miao-chen Chou <mcchou@chromium.org> Reviewed-by: Sonny Sasaka <sonnysasaka@chromium.org> [modify] https://crrev.com/ba5aef3e357e9651c7caa7d529465de61bacc0c1/bluetooth/newblued/newblue.cc [modify] https://crrev.com/ba5aef3e357e9651c7caa7d529465de61bacc0c1/bluetooth/newblued/uuid.h |
|||
►
Sign in to add a comment |
|||
Comment 1 by mcchou@chromium.org
, Jul 13