mirror of
https://github.com/google/bumble.git
synced 2026-05-08 03:58:01 +00:00
Remove mutable ret pattern and test feature combinations
After adding test for feature combinations, I found a corner case where, when Transport is dropped and the process is terminated in a test, the `close` Python future is not awaited. I don't know what other situations this issue may arise, so I have safe-guarded it via `block_on` instead of spawning a thread.
This commit is contained in:
@@ -1000,16 +1000,15 @@ class Controller:
|
||||
'''
|
||||
See Bluetooth spec Vol 4, Part E - 7.8.10 LE Set Scan Parameters Command
|
||||
'''
|
||||
ret = HCI_SUCCESS
|
||||
if not self.le_scan_enable:
|
||||
self.le_scan_type = command.le_scan_type
|
||||
self.le_scan_interval = command.le_scan_interval
|
||||
self.le_scan_window = command.le_scan_window
|
||||
self.le_scan_own_address_type = command.own_address_type
|
||||
self.le_scanning_filter_policy = command.scanning_filter_policy
|
||||
else:
|
||||
ret = HCI_COMMAND_DISALLOWED_ERROR
|
||||
return bytes([ret])
|
||||
if self.le_scan_enable:
|
||||
return bytes([HCI_COMMAND_DISALLOWED_ERROR])
|
||||
|
||||
self.le_scan_type = command.le_scan_type
|
||||
self.le_scan_interval = command.le_scan_interval
|
||||
self.le_scan_window = command.le_scan_window
|
||||
self.le_scan_own_address_type = command.own_address_type
|
||||
self.le_scanning_filter_policy = command.scanning_filter_policy
|
||||
return bytes([HCI_SUCCESS])
|
||||
|
||||
def on_hci_le_set_scan_enable_command(self, command):
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user