Commit: b81d63d581a4fc2a5f76ed5fe03be2d3a32ef51b
Parent: 3f16d31cc3aad7695c56e938175e2703f143ab9a
Author: Petri Gynther <pgynther@google.com>
Committer: Johan Hedberg <johan.hedberg@intel.com>
Date: 2014-02-19 06:00:47
Tree: 84820a1175ded884eca8f1e21eb7ac715ff5ee55

adapter: Handle MGMT_SETTING_LE change On dual-mode Bluetooth adapters, BLE is not enabled by default. When bluetoothd starts, BLE is enabled in read_info_complete(), but this management action does not always complete before adapter_start() is called. Therefore, bluetoothd needs to handle the MGMT_SETTING_LE change correctly in settings_changed(). Specifically, trigger_passive_scanning() needs to be called so that paired BLE devices (e.g. HoG devices) are able to reconnect back to host. The trace below shows this case: bluetoothd[1087]: src/adapter.c:adapter_start() adapter /org/bluez/hci0 has been enabled => adapter_start() is called, but BLE is not yet enabled bluetoothd[1087]: src/adapter.c:load_link_keys_complete() link keys loaded for hci0 bluetoothd[1087]: src/adapter.c:load_ltks_complete() LTKs loaded for hci0 bluetoothd[1087]: src/adapter.c:get_connections_complete() Connection count: 0 bluetoothd[1087]: src/adapter.c:new_settings_callback() Settings: 0x000000c1 bluetoothd[1087]: src/adapter.c:settings_changed() Changed settings: 0x00000040 bluetoothd[1087]: src/adapter.c:new_settings_callback() Settings: 0x000002c1 bluetoothd[1087]: src/adapter.c:settings_changed() Changed settings: 0x00000200 => BLE got enabled, so need to call trigger_passive_scanning() bluetoothd[1087]: src/adapter.c:new_settings_callback() Settings: 0x000002d1 bluetoothd[1087]: src/adapter.c:settings_changed() Changed settings: 0x00000010 bluetoothd[1087]: src/adapter.c:new_settings_callback() Settings: 0x000002d3 bluetoothd[1087]: src/adapter.c:settings_changed() Changed settings: 0x00000002 The issue is easily reproducible with this init sequence: hciconfig hci0 up bluetoothd -n -d

Diffstat

M src/adapter.c | 7 +++++++

1 files changed, 7 insertions(+), 0 deletions(-)

View Full Diff | Patch