@@ -784,7 +784,7 @@ async def _client_connect(self) -> bool:
784784 bos_descriptor = get_descriptor (self ._device , bos_len , 0x0F , 0 )
785785
786786 while ofst < bos_len :
787- (len , desc_type , cap_type ) = struct .unpack_from (
787+ (size , desc_type , cap_type ) = struct .unpack_from (
788788 "<BBB" , bos_descriptor , offset = ofst
789789 )
790790
@@ -798,23 +798,23 @@ async def _client_connect(self) -> bool:
798798 uuid_str = str (UUID (bytes_le = bytes (uuid_bytes )))
799799
800800 if uuid_str == FW_REV_UUID :
801- fw_version = bytearray (bos_descriptor [ofst + 20 : ofst + len ])
801+ fw_version = bytearray (bos_descriptor [ofst + 20 : ofst + size ])
802802 self .fw_version = Version (fw_version .decode ())
803803
804804 elif uuid_str == SW_REV_UUID :
805805 self ._protocol_version = bytearray (
806- bos_descriptor [ofst + 20 : ofst + len ]
806+ bos_descriptor [ofst + 20 : ofst + size ]
807807 )
808808
809809 elif uuid_str == PYBRICKS_HUB_CAPABILITIES_UUID :
810- caps = bytearray (bos_descriptor [ofst + 20 : ofst + len ])
810+ caps = bytearray (bos_descriptor [ofst + 20 : ofst + size ])
811811 (
812812 _ ,
813813 self ._capability_flags ,
814814 self ._max_user_program_size ,
815815 ) = unpack_hub_capabilities (caps )
816816
817- ofst += len
817+ ofst += size
818818
819819 self ._monitor_task = asyncio .create_task (self ._monitor_usb ())
820820
0 commit comments