Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Format code with Black for lint compliance
  • Loading branch information
Prunier, Thierry committed Oct 23, 2025
commit 6684e37b31c2d047d5d45f00eb03e6f8a1d5d22f
15 changes: 11 additions & 4 deletions can/interfaces/ixxat/canlib_vcinpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,9 +523,12 @@ def __init__(
hwid = self._device_info.UniqueHardwareId.AsChar.decode("ascii")
except:
guid = self._device_info.UniqueHardwareId.AsGuid
hwid = '{{{0:x}-{1:x}-{2:x}-{3}}}'.format(guid.Data1,guid.Data2,guid.Data3,guid.Data4.hex())
hwid = '{{{0:x}-{1:x}-{2:x}-{3}}}'.format(
guid.Data1,guid.Data2,guid.Data3,guid.Data4.hex()
)

if (unique_hardware_id is None) or ( bytes(hwid, "ascii") == bytes(unique_hardware_id, "ascii")
if (unique_hardware_id is None) or (
bytes(hwid, "ascii") == bytes(unique_hardware_id, "ascii")
):
break

Expand Down Expand Up @@ -977,7 +980,9 @@ def get_ixxat_hwids():
hwids.append(device_info.UniqueHardwareId.AsChar.decode("ascii"))
except:
guid = device_info.UniqueHardwareId.AsGuid
hwids.append('{{{0:x}-{1:x}-{2:x}-{3}}}'.format(guid.Data1,guid.Data2,guid.Data3,guid.Data4.hex()))
hwids.append('{{{0:x}-{1:x}-{2:x}-{3}}}'.format(
guid.Data1,guid.Data2,guid.Data3,guid.Data4.hex())
)
_canlib.vciEnumDeviceClose(device_handle)

return hwids
Expand Down Expand Up @@ -1006,7 +1011,9 @@ def _detect_available_configs() -> Sequence["AutoDetectedIxxatConfig"]:
hwid = device_info.UniqueHardwareId.AsChar.decode("ascii")
except:
guid = device_info.UniqueHardwareId.AsGuid
hwid = '{{{0:x}-{1:x}-{2:x}-{3}}}'.format(guid.Data1,guid.Data2,guid.Data3,guid.Data4.hex())
hwid = '{{{0:x}-{1:x}-{2:x}-{3}}}'.format(
guid.Data1,guid.Data2,guid.Data3,guid.Data4.hex()
)
_canlib.vciDeviceOpen(
ctypes.byref(device_info.VciObjectId),
ctypes.byref(device_handle2),
Expand Down