Implement HCI_Mode_Change_Event

This commit is contained in:
khsiao-google
2025-07-14 08:33:45 +00:00
parent fa6fe2aaca
commit a184cae560
3 changed files with 109 additions and 4 deletions

View File

@@ -5877,6 +5877,19 @@ class Device(utils.CompositeEventEmitter):
utils.AsyncRunner.spawn(reply())
# [Classic only]
@host_event_handler
@with_connection_from_handle
def on_mode_change(
self, connection: Connection, status: int, current_mode: int, interval: int
):
if status == hci.HCI_SUCCESS:
connection.classic_mode = current_mode
connection.classic_interval = interval
connection.emit(connection.EVENT_MODE_CHANGE)
else:
connection.emit(connection.EVENT_MODE_CHANGE_FAILURE)
# [Classic only]
@host_event_handler
@with_connection_from_address