check adapter supported settings for LE capability (instead of current,
@@ -46,17 +46,13 @@ class MGMTBluetoothCtl:
for idx in hci_idx_list:
hci_info = btmgmt_sync.send('ReadControllerInformation', idx)
_LOGGER.debug(hci_info)
- #
- # LE capability check disabled temporary until issue #709 is resolved
- # it looks like LE capability state does not indicate the impossibility of LE scanning
- #
- # bt_le = hci_info.cmd_response_frame.current_settings.get(
- # btmgmt_protocol.SupportedSettings.LowEnergy
- # )
- # if bt_le is not True:
- # _LOGGER.warning("hci%i has no (or disabled) BT LE capabilities.", idx)
- # continue
- #
+ ## bit 9 == LE capability (https://github.com/bluez/bluez/blob/master/doc/mgmt-api.txt)
+ bt_le = bool(
+ hci_info.cmd_response_frame.supported_settings & 0b000000001000000000
+ )
+ if bt_le is not True:
+ _LOGGER.warning("hci%i has no (or disabled) BT LE capabilities.", idx)
+ continue
self.presented_list[idx] = hci_info.cmd_response_frame.address
if hci == idx:
self.idx = idx
