Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the device power-on sequence to automatically disable address resolution and generation offloading if the controller does not support LL Privacy, and adds a corresponding unit test. The feedback suggests adding informational logging when these offload settings are automatically disabled to provide better visibility to the user.
| if not self.supports_le_features(hci.LeFeatureMask.LL_PRIVACY): | ||
| self.address_resolution_offload = False | ||
| self.address_generation_offload = False |
There was a problem hiding this comment.
It would be highly beneficial to log an informational message when address_resolution_offload or address_generation_offload are automatically disabled due to the lack of controller-side LL_PRIVACY support. This provides clear visibility to the user as to why their configured privacy offload settings are being overridden during initialization.
| if not self.supports_le_features(hci.LeFeatureMask.LL_PRIVACY): | |
| self.address_resolution_offload = False | |
| self.address_generation_offload = False | |
| if not self.supports_le_features(hci.LeFeatureMask.LL_PRIVACY): | |
| if self.address_resolution_offload or self.address_generation_offload: | |
| logger.info("Controller does not support LL Privacy; disabling privacy offloads") | |
| self.address_resolution_offload = False | |
| self.address_generation_offload = False |
Bumble enables `address_resolution_offload` by default on `Device` instances. During `power_on()`, `refresh_resolving_list()` sends `HCI_LE_Clear_Resolving_List` whenever `address_resolution_offload` or `address_generation_offload` is enabled, even if the controller does not report `LL_PRIVACY` in its LE supported features. Controllers without LL Privacy (such as Raspberry Pi 4 `CYW43455`) reject this command with `UNKNOWN_HCI_COMMAND_ERROR` (`0x01`), aborting device initialization. Check `supports_le_features(hci.LeFeatureMask.LL_PRIVACY)` in `Device.power_on()` after resetting the host and disable both `address_resolution_offload` and `address_generation_offload` when `LL_PRIVACY` is unsupported.
0675c8b to
d13c775
Compare
Bumble enables
address_resolution_offloadby default onDeviceinstances. Duringpower_on(),refresh_resolving_list()sendsHCI_LE_Clear_Resolving_Listwheneveraddress_resolution_offloadoraddress_generation_offloadis enabled, even if the controller does not reportLL_PRIVACYin its LE supported features. Controllers without LL Privacy (such as the Raspberry Pi 4CYW43455) reject this command withUNKNOWN_HCI_COMMAND_ERROR(0x01), aborting device initialization.Check
supports_le_features(hci.LeFeatureMask.LL_PRIVACY)inDevice.power_on()after resetting the host and disable bothaddress_resolution_offloadandaddress_generation_offloadwhenLL_PRIVACYis unsupported.Testing
test_power_on_disables_privacy_offload_without_ll_privacyintests/device_test.py.CYW43455/hci0) running Bluetooth LE ASHA and HAP tests.