From dc97be5b3572c03856817f5cc495cbefb3ffb442 Mon Sep 17 00:00:00 2001 From: Josh Wu Date: Sat, 2 Dec 2023 23:29:00 +0800 Subject: [PATCH] Fix typo --- bumble/hci.py | 2 +- tests/hci_test.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/bumble/hci.py b/bumble/hci.py index f652d23..f209249 100644 --- a/bumble/hci.py +++ b/bumble/hci.py @@ -1629,7 +1629,7 @@ class HCI_Object: field_bytes = bytes(field_value) elif field_type == 'v': # 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_bytes = bytes([field_length]) + field_bytes elif isinstance(field_value, (bytes, bytearray)) or hasattr( diff --git a/tests/hci_test.py b/tests/hci_test.py index b6024ff..5607350 100644 --- a/tests/hci_test.py +++ b/tests/hci_test.py @@ -53,6 +53,7 @@ from bumble.hci import ( HCI_LE_Set_Random_Address_Command, HCI_LE_Set_Scan_Enable_Command, HCI_LE_Set_Scan_Parameters_Command, + HCI_LE_Setup_ISO_Data_Path_Command, HCI_Number_Of_Completed_Packets_Event, HCI_Packet, 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.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)