This commit is contained in:
Josh Wu
2023-12-02 23:29:00 +08:00
parent 247cb89332
commit dc97be5b35
2 changed files with 10 additions and 1 deletions

View File

@@ -1629,7 +1629,7 @@ class HCI_Object:
field_bytes = bytes(field_value) field_bytes = bytes(field_value)
elif field_type == 'v': elif field_type == 'v':
# Variable-length bytes field, with 1-byte length at the beginning # Variable-length bytes field, with 1-byte length at the beginning
field_bytes = bytes(field_bytes) field_bytes = bytes(field_value)
field_length = len(field_bytes) field_length = len(field_bytes)
field_bytes = bytes([field_length]) + field_bytes field_bytes = bytes([field_length]) + field_bytes
elif isinstance(field_value, (bytes, bytearray)) or hasattr( elif isinstance(field_value, (bytes, bytearray)) or hasattr(

View File

@@ -53,6 +53,7 @@ from bumble.hci import (
HCI_LE_Set_Random_Address_Command, HCI_LE_Set_Random_Address_Command,
HCI_LE_Set_Scan_Enable_Command, HCI_LE_Set_Scan_Enable_Command,
HCI_LE_Set_Scan_Parameters_Command, HCI_LE_Set_Scan_Parameters_Command,
HCI_LE_Setup_ISO_Data_Path_Command,
HCI_Number_Of_Completed_Packets_Event, HCI_Number_Of_Completed_Packets_Event,
HCI_Packet, HCI_Packet,
HCI_PIN_Code_Request_Reply_Command, HCI_PIN_Code_Request_Reply_Command,
@@ -455,6 +456,14 @@ def test_HCI_LE_Setup_ISO_Data_Path_Command():
assert command.controller_delay == 0 assert command.controller_delay == 0
assert command.codec_configuration == b'' assert command.codec_configuration == b''
command = HCI_LE_Setup_ISO_Data_Path_Command(
connection_handle=0x0060,
data_path_direction=0x00,
data_path_id=0x01,
codec_id=CodingFormat(CodecID.TRANSPARENT),
controller_delay=0x00,
codec_configuration=b'',
)
basic_check(command) basic_check(command)