Merge pull request #809 from khsiao-google/update

[Typing] Add controller.py typing
This commit is contained in:
khsiao-google
2025-11-03 18:58:13 +08:00
committed by GitHub
3 changed files with 465 additions and 228 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -3441,6 +3441,17 @@ class HCI_Write_Synchronous_Flow_Control_Enable_Command(HCI_Command):
synchronous_flow_control_enable: int = field(metadata=metadata(1)) synchronous_flow_control_enable: int = field(metadata=metadata(1))
# -----------------------------------------------------------------------------
@HCI_Command.command
@dataclasses.dataclass
class HCI_Set_Controller_To_Host_Flow_Control_Command(HCI_Command):
'''
See Bluetooth spec @ 7.3.38 Set Controller To Host Flow Control command
'''
flow_control_enable: int = field(metadata=metadata(1))
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
@HCI_Command.command @HCI_Command.command
@dataclasses.dataclass @dataclasses.dataclass
@@ -4338,6 +4349,15 @@ class HCI_LE_Write_Suggested_Default_Data_Length_Command(HCI_Command):
suggested_max_tx_time: int = field(metadata=metadata(2)) suggested_max_tx_time: int = field(metadata=metadata(2))
# -----------------------------------------------------------------------------
@HCI_Command.command
@dataclasses.dataclass
class HCI_LE_Read_Local_P_256_Public_Key_Command(HCI_Command):
'''
See Bluetooth spec @ 7.8.36 LE LE Read Local P-256 Public Key command
'''
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
@HCI_Command.command @HCI_Command.command
@dataclasses.dataclass @dataclasses.dataclass
@@ -4365,6 +4385,15 @@ class HCI_LE_Clear_Resolving_List_Command(HCI_Command):
''' '''
# -----------------------------------------------------------------------------
@HCI_Command.command
@dataclasses.dataclass
class HCI_LE_Read_Resolving_List_Size_Command(HCI_Command):
'''
See Bluetooth spec @ 7.8.41 LE Read Resolving List Size command
'''
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
@HCI_Command.command @HCI_Command.command
@dataclasses.dataclass @dataclasses.dataclass
@@ -5028,6 +5057,15 @@ class HCI_LE_Periodic_Advertising_Terminate_Sync_Command(HCI_Command):
sync_handle: int = field(metadata=metadata(2)) sync_handle: int = field(metadata=metadata(2))
# -----------------------------------------------------------------------------
@HCI_Command.command
@dataclasses.dataclass
class HCI_LE_Read_Transmit_Power_Command(HCI_Command):
'''
See Bluetooth spec @ 7.8.74 LE Read Transmit Power command
'''
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
@HCI_Command.command @HCI_Command.command
@dataclasses.dataclass @dataclasses.dataclass

View File

@@ -19,6 +19,7 @@ import asyncio
import sys import sys
import bumble.logging import bumble.logging
from bumble import hci
from bumble.controller import Controller from bumble.controller import Controller
from bumble.device import Device from bumble.device import Device
from bumble.gatt import ( from bumble.gatt import (
@@ -61,7 +62,7 @@ async def main() -> None:
host_sink=hci_transport.sink, host_sink=hci_transport.sink,
link=link, link=link,
) )
controller1.random_address = sys.argv[1] controller1.random_address = hci.Address(sys.argv[1])
# Create a second controller using the same link # Create a second controller using the same link
controller2 = Controller('C2', link=link) controller2 = Controller('C2', link=link)